当前位置:网站首页>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
边栏推荐
- QT社团管理系统
- Summary of 20 practical typescript single line codes
- What "hard core innovations" does Intel have in the first half of 2022? Just look at this picture!
- 小程序-小程序图表库(F2图表库)
- 建立自己的网站(21)
- Leetcode question 1: sum of two numbers (3 languages)
- 分布式事务简介(seata)
- 【IoT毕设.上】STM32+机智云AIoT+实验室安全监控系统
- 开源者的自我修养|为 ShardingSphere 贡献了千万行代码的程序员,后来当了 CEO
- [IOT design. Part I] stm32+ smart cloud aiot+ laboratory security monitoring system
猜你喜欢

Après avoir été licencié pendant trois mois, l'entrevue s'est effondrée et l'état d'esprit a commencé à s'effondrer.

2022上半年英特尔有哪些“硬核创新”?看这张图就知道了!

The best landing practice of cave state in an Internet ⽹⾦ financial technology enterprise

介绍一种对 SAP GUI 里的收藏夹事务码管理工具增强的实现方案

建立自己的网站(21)

Liu Dui (fire line safety) - risk discovery in cloudy environment

leetcode622. Design cycle queue (C language)

当你真的学会DataBinding后,你会发现“这玩意真香”!

So programmers make so much money doing private work? It's really delicious

Enter the top six! Boyun's sales ranking in China's cloud management software market continues to rise
随机推荐
Fiori applications are shared through the enhancement of adaptation project
App automation testing Kaiyuan platform appium runner
那个很努力的学生,高考失败了……别慌!你还有一次逆袭机会!
Leetcode question 1: sum of two numbers (3 languages)
Etcd 概要 机制 和使用场景
App自动化测试开元平台Appium-runner
Listen in the network
QT学习管理系统
[flask] flask starts and implements a minimal application based on flask
C语言课程设计题目
What "hard core innovations" does Intel have in the first half of 2022? Just look at this picture!
Machine learning summary (I): linear regression, ridge regression, Lasso regression
[IOT design. Part I] stm32+ smart cloud aiot+ laboratory security monitoring system
C语言订餐管理系统
二传感器尺寸「建议收藏」
Dragon lizard community open source coolbpf, BPF program development efficiency increased 100 times
[Jianzhi offer] 54 The k-th node of binary search tree
刘对(火线安全)-多云环境的风险发现
Texstudio tutorial
Fiori 应用通过 Adaptation Project 的增强方式分享