You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8816ce4
Browse filesBrowse the repository at this point in the historyBrowse files
// Mediator is a behavioral design pattern that lets you reduce chaotic dependencies between objects.
2
+
// The pattern restricts direct communications between the objects and forces them to collaborate only via a mediator object.
3
+
// Usage examples: The most popular usage of the Mediator pattern in C++ code is facilitating communications between GUI components of an app.
4
+
// The synonym of the Mediator is the `Controller` part of MVC pattern.
5
+
// Appicability:
6
+
// (*) when your collection has a complex data structure under the hood, but you want to hide its complexity from clients (either for convenience or security reasons).
7
+
// (**) when you can’t reuse a component in a different program because it’s too dependent on other components.
8
+
// (***) when you find yourself creating tons of component subclasses just to reuse some basic behavior in various contexts.
* Components are various classes that contain some business logic.
95
+
* Each component has a reference to a mediator, declared with the type of the mediator interface.
96
+
* The component isn’t aware of the actual class of the mediator, so you can reuse the component in other programs by linking it to a different mediator.
0 commit comments