当前位置:网站首页>When the main process architecture game, to prevent calls everywhere to reduce coupling, how to open the interface to others to call?
When the main process architecture game, to prevent calls everywhere to reduce coupling, how to open the interface to others to call?
2022-07-01 13:58:00 【Stroll along the Star River】
I understand and analyze three methods , If you have any suggestions or deficiencies, please put them forward , thank you
( It depends on the project and architecture )
Method 1:
You can write your own classes or interfaces , Let the responsible colleagues write specific code
Data class : When we call it ourselves, we pass in parameters , Or you can tell colleagues how to safely call data classes
Method 2:
api: Write an event interface enumeration , Register the method in the event manager .
You can refer to Unity In the official document Api And then through api Call to write , Or use IOC Dependency inversion
For example, shops : Open the store and display the store props Parameters (list(id And the price ))
E.g. Backpack : Open the contents of the backpack Parameters (id And quantity )
Backpack props :UI Display description , Incoming props id, Get prop information from data class
Operation of props :( Move unity Provided the interface )
Activities : Active interface open interface
Method 3:
Using frames IOC The principle of Dependence Inversion
边栏推荐
- 小程序- view中多个text换行
- C language ordering management system
- 【剑指 Offer】55 - II. 平衡二叉树
- 2022. Let me take you from getting started to mastering jetpack architecture components - lifecycle
- 研发效能度量框架解读
- 【241. 为运算表达式设计优先级】
- 被裁三個月,面試到處碰壁,心態已經開始崩了
- Animesr: learnable degradation operator and new real world animation VSR dataset
- Simplex, half duplex, full duplex, TDD and FDD
- 队列的基本操作(C语言实现)
猜你喜欢

被裁三個月,面試到處碰壁,心態已經開始崩了

Scheme of printing statistical information in log

【NLP】预训练模型——GPT1

Understand the window query function of tdengine in one article

B站被骂上了热搜。。

【241. 为运算表达式设计优先级】
![[flask] flask starts and implements a minimal application based on flask](/img/45/77df241c85c4916914a37bb78275a5.png)
[flask] flask starts and implements a minimal application based on flask

2022. Let me take you from getting started to mastering jetpack architecture components - lifecycle

QT learning management system

奔涌而来的数字化浪潮,将怎样颠覆未来?
随机推荐
Word2vec training Chinese word vector
3.4 《数据库系统概论》之数据查询—SELECT(单表查询、连接查询、嵌套查询、集合查询、多表查询)
QT社团管理系统
Listen in the network
leetcode622.设计循环队列(C语言)
User defined annotation realizes the function of verifying information
Leetcode question 1: sum of two numbers (3 languages)
程序设计的基本概念
Etcd 概要 机制 和使用场景
Logic is a good thing
盲盒NFT数字藏品平台系统开发(搭建源码)
leetcode 322. Coin Change 零钱兑换(中等)
我们该如何保护自己的密码?
[NLP] pre training model - gpt1
【NLP】预训练模型——GPT1
2022 · 让我带你Jetpack架构组件从入门到精通 — Lifecycle
原来程序员搞私活这么赚钱?真的太香了
Interpretation of R & D effectiveness measurement framework
二传感器尺寸「建议收藏」
Build your own website (21)