当前位置:网站首页>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
边栏推荐
- 【Flask】Flask启程与实现一个基于Flask的最小应用程序
- This paper introduces an implementation scheme to enhance the favorite transaction code management tool in SAP GUI
- Realize queue with stack and stack with queue (C language \leetcode\u 232+225)
- What "hard core innovations" does Intel have in the first half of 2022? Just look at this picture!
- Leetcode question 1: sum of two numbers (3 languages)
- Fiori applications are shared through the enhancement of adaptation project
- 2022. Let me take you from getting started to mastering jetpack architecture components - lifecycle
- Word2vec training Chinese word vector
- QT社团管理系统
- How can we protect our passwords?
猜你喜欢
![[NLP] pre training model - gpt1](/img/bd/9803ad946b33159de51b93106a2151.png)
[NLP] pre training model - gpt1

Realize queue with stack and stack with queue (C language \leetcode\u 232+225)

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

原来程序员搞私活这么赚钱?真的太香了

学会使用LiveData和ViewModel,我相信会让你在写业务时变得轻松

研发效能度量框架解读

洞态在某互联⽹⾦融科技企业的最佳落地实践

04 redis source code data structure dictionary

QT learning management system

队列的基本操作(C语言实现)
随机推荐
1.8 new features list
So programmers make so much money doing private work? It's really delicious
Simplex, half duplex, full duplex, TDD and FDD
[Jianzhi offer] 55 - ii balanced binary tree
QT社团管理系统
建立自己的网站(21)
盲盒NFT数字藏品平台系统开发(搭建源码)
【修复版】仿我爱看电影网站模板/海洋CMS影视系统模板
Enter the top six! Boyun's sales ranking in China's cloud management software market continues to rise
Etcd 概要 机制 和使用场景
机器学习总结(一):线性回归、岭回归、Lasso回归
uni-app实现广告滚动条
开源实习经验分享:openEuler软件包加固测试
SWT/ANR问题--当发送ANR/SWT时候如何打开binder trace(BinderTraces)
Applet - multiple text line breaks in view
MySQL日志
小程序-小程序图表库(F2图表库)
[machine learning] VAE variational self encoder learning notes
Interpretation of R & D effectiveness measurement framework
使用CMD修复和恢复病毒感染文件