GithubHelp home page GithubHelp logo

frameworkdesign's Introduction

FrameworkDesign

介绍

学习开源框架QFramework并进行的实践

架构分为四个层级:

  • 表现层:IController 接口,负责接收输入和当状态变化时更新表现,一般情况下 MonoBehaviour 均为表现层对象。
  • 系统层:ISystem 接口,帮助 IController 承担一部分逻辑,在多个表现层共享的逻辑,比如计时系统、商城系统、成就系统等。
  • 模型层:IModel 接口,负责数据的定义以及数据的增删改查方法的的提供。
  • 工具层:IUtility 接口,负责提供基础设施,比如存储方法、序列化方法等。

使用规则:

  • IController 更改 ISystem、IModel 的状态必须用 Command。
  • ISystem、IModel 状态发生变更后通知 IController 必须用事件 或 BindableProeprty。
  • IController 可以获取 ISystem、IModel 对象来进行数据查询。
  • ICommand 不能有状态。
  • 上层可以直接获取下层对象,下层不能获取上层对象。
  • 下层像上层通信用事件。
  • 上层向下层通信用方法调用。

frameworkdesign's People

Contributors

ana-kh avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.