Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This is just an idea, but consider if the mediator pattern is applicable.</p> <p>From <a href="http://en.wikipedia.org/wiki/Design_Patterns" rel="nofollow">the gang of four</a>:</p> <blockquote> <h2>Intent</h2> <p>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.</p> <h2>Applicability</h2> <p>Use the Mediator pattern when</p> <ol> <li>a set of objects communicate in well-defined but complex ways. The resulting interdependencies are unstructured and difficult to understand.</li> <li>reusing an object is difficult because it refers to and communicates with many other objects.</li> <li>a behavior that's distributed between several classes should be customizable without a lot of subclassing.</li> </ol> <h2>Consequences</h2> <p>The Mediator pattern has the following benefits and drawbacks:</p> <ul> <li>It limits subclassing. A mediator localizes behavior that otherwise would be distributed among several objects. Changing this behavior requires subclassing Mediator only; Colleague classes can be reused as is.</li> <li>It decouples colleagues. A mediator promotes loose coupling between colleagues. You can vary and reuse Colleague and Mediator classes independently.</li> <li>It simplifies object protocols. A mediator replaces many-to-many interactions with one-to-many interactions between the mediator and its colleagues. One-to-many relationships are easier to understand, maintain, and extend.</li> <li>It abstracts how objects cooperate. Making mediation an independent concept and encapsulating it in an object lets you focus on how objects interact apart from their individual behavior. That can help clarify how objects interact in a system.</li> <li>It centralizes control. The Mediator pattern trades complexity of interaction for complexity in the mediator. Because a mediator encapsulates protocols, it can become more complex than any individual colleague. This can make the mediator itself a monolith that's hard to maintain.</li> </ul> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload