Mediator Pattern vs. Facade Patt

作者: JoeJiang | 来源:发表于2017-10-15 16:09 被阅读69次

Copyright @ Joel Jiang(江东敏) at 2017.10.15 15:00 p.m
in Shenzhen.China. LIST- TE- E33 -03

Paste_Image.png

To define a mediation object to encapsulate the interaction between a series of objects.
The mediator allows each object to refer to each other without the need for display, thus allowing it to be loosely coupled. It's slightly like "facade mode."

The mediator pattern function is to make two classes not directly related to each other, but through intermediaries. The intermediary is not biased towards the either party somehow, and the two sides through the intermediary.The relationship with the other party is a two-way street.

Paste_Image.png

The facade pattern also makes two classes not directly related, but the front side is biased towards one side, the other side through the facade and one side of the relationship, but one side.It doesn't even have to be the relationship between the door and the other side, that is, the relationship tends to be one-way,

For example (From internet):
The mediator mode is that I have to find an intermediary to deal with, as to the intermediary can't find you, I don't care.
The facade pattern is that I have to go to you for something, but you have set up a service window for better service, and I'll go to the service window to find you, and basically,You won't have to come to me.

The sharing of knowledge, the spirit of encouragement.
By Joel Jiang (江东敏)

相关文章

网友评论

    本文标题:Mediator Pattern vs. Facade Patt

    本文链接:https://www.haomeiwen.com/subject/uctysxtx.html