Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

The Mediator Pattern

DZone's Guide to

The Mediator Pattern

· Java Zone
Free Resource

Download Microservices for Java Developers: A hands-on introduction to frameworks and containers. Brought to you in partnership with Red Hat.

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:

 

Download Modern Java EE Design Patterns: Building Scalable Architecture for Sustainable Enterprise Development.  Brought to you in partnership with Red Hat

Topics:

Published at DZone with permission of Cristian Chiovari, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}