Intent
Define an object that encapsulates how a set of objects interact. Mediator promotes loose coupling by keeping objects from referring to each other explicitly, and it lets you vary their interaction independently.
Define an object that encapsulates how a set of objects interact. Mediator promotes loose coupling by keeping objects from referring to each other explicitly, and it lets you vary their interaction independently.
Why is this used?
This increases the res-usability of objects supported by the Mediator by decoupling them from the system. In addition, this simplifies the maintenance of the system by centralising control logic. Also, this simplifies and reduces the variety of messages sent between objects in the system.
This increases the res-usability of objects supported by the Mediator by decoupling them from the system. In addition, this simplifies the maintenance of the system by centralising control logic. Also, this simplifies and reduces the variety of messages sent between objects in the system.
UML diagram representation
https://i.stack.imgur.com/T4KCw.png
Visual representation
http://www.jamesportis.com/wp-content/uploads/2015/11/mediator-software-design-pattern.gif
https://i.stack.imgur.com/T4KCw.png
Visual representation
http://www.jamesportis.com/wp-content/uploads/2015/11/mediator-software-design-pattern.gif
Source code example
https://dzone.com/articles/design-patterns-mediator
More to follow...
No comments:
Post a Comment