Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

精读《设计模式 - Mediator 中介者模式》 #299

Closed
ascoders opened this issue Jan 29, 2021 · 3 comments
Closed

精读《设计模式 - Mediator 中介者模式》 #299

ascoders opened this issue Jan 29, 2021 · 3 comments

Comments

@ascoders
Copy link
Owner

ascoders commented Jan 29, 2021

中介者模式很常见,通过第三方中介引用子模块,从而避免子模块之间的相互引用,不仅可以解耦,甚至可以解决循环依赖的 “难题”。


精读《设计模式 - Mediator 中介者模式》

@ascoders ascoders closed this as completed Feb 1, 2021
@xusanduo08
Copy link

将数据认作中介总感觉有些别扭。实际开发中操作的是数据,中间通过UI工具生成页面,数据-> UI工具 -> 页面,所以中介为啥不是UI工具呢?

@ascoders
Copy link
Owner Author

ascoders commented Feb 9, 2023

@xusanduo08 站在开发者角度,数据驱动是中介者模式最有力的证明。不知道你提的 UI 工具是哪一类的,如何使制作页面的过程变得耦合松散呢?
我能想到的比如搭建系统,要做到耦合松散本质上还是数据驱动,所以还是以数据 -> 代码的例子更本质一些。

@xusanduo08
Copy link

大概明白你的意思:从开发者角度,在开发者到web页面之间,数据是一个中介,是否这样理解?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants