Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Mediator Pattern

722 views

Published on

  • Login to see the comments

Mediator Pattern

  1. 1. Mediator Design Pattern (Behavioral) -Mr.Anuj B. Pawar. Roll No. 51
  2. 2. Intent Mediator Pattern _ap2  Object Behavioral an object that encapsulates how a set of objects, which can interact and refer each other independently.
  3. 3. Motivation Mediator Pattern _ap3  Requirement of system –  A system needs objects to communicate with each other and should be able to share properties of each other.  Desired system will have –  Different objects which can communicate with each other.  Problem –  Object structure will have many connections between objects  Every object ends up knowing about every other.
  4. 4. Applicability Mediator Pattern _ap4  When one or more objects must interact with several different objects.  When simple object need to communicate in complex ways.  When you want to reuse an object that frequently interacts with other objects.
  5. 5. Example- Problem Mediator Pattern _ap5
  6. 6. Example-Solution 03/04/03CS590L Mediator Pattern6
  7. 7. Example-Steps Mediator Pattern _ap7  The list box tells its director that it’s changed.  The director gets the selection from the list box.  The director passes the selection to the entry field.  Director takes action.
  8. 8. General Structure Mediator Pattern _ap8
  9. 9. Participants Mediator Pattern _ap9  Mediator -defines an interface for communicating with Colleague objects.  Concrete Mediator -implements cooperative behavior by coordinating Colleague objects. -knows and maintains its colleagues.  Colleague classes -each Colleague class knows its Mediator object. -each colleague communicates with its mediator whenever it would have otherwise communicated with another colleague.
  10. 10. Related Patterns Mediator Pattern _ap10  Façade  Observer
  11. 11. Mediator Pattern _ap11 Thank You..

×