Enterprise Integration Zone is brought to you in partnership with:

Cristian Chiovari is a Senior Software Engineer specialized in developing enterprise software applications with experience on software integration and messaging. His expertise include helping clients build software using industry best practices, Test Driven Design, Weblogic, Oracle Service Bus , Spring Frameworks, JEE. Performance improvements is something that is really passionate about and considers software development not only his job but also his main hobby. Cristian is a DZone MVB and is not an employee of DZone and has posted 10 posts at DZone. You can read more from them at their website. View Full User Profile

The Mediator Pattern

10.20.2012
| 5272 views |
  • submit to reddit

Description:

It defines 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

Benefits:

  •  Decouples colleagues
  •  Simplifies object protocols
  •  Centralizes control

When to use:

  • A set of objects communicate in well-defined but complex ways.
  • You want to customize a behavior that’s distributed between several objects without using subclasses.

Diagram:

 

Published at DZone with permission of Cristian Chiovari, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)