Java Code Samples

Mediator

Posted in Old stuff by Cristian on May 29, 2011

Description:

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

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:

 

About these ads

One Response

Subscribe to comments with RSS.

  1. [...] Mediator [...]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: