Mediator Design Pattern
This article describes the Mediator design pattern. This is a behavioral design pattern, a category of design pattern used by software engineers, when writing computer programs.
Introduction
A Mediator is a design pattern, used in software engineering, to communicate between parts within an application. It provides a unified interface.
It is defined as a behavioral design pattern because messages can cause the program to behave differently, like actions resulting from an event message.
Benefits
As programs grow in complexity, and more and more classes and relationships are added, it becomes harder to follow the chain of communication around the code. The mediator pattern attempts to centralize and standardize the methods and channels of communication around the application, thus reducing complexity, enhancing readability and maintainability.
The mediator is especially useful in projects are built around the MVVM pattern, because it enables communication between separate and unrelated ViewModels, which may reside in different parts of the application (like separate windows), or from deep within autogenerated controls (like in cells of DataGrid).
See Also
Link to domain parent articles and related articles in TechNet Wiki.
Community Resources
These are the external links, including links to Microsoft and TechNet sites that are non-Wiki
- The Mediator Pattern
- How to Build, Manage and Navigate the User Interface of a WPF Application
- The "Mediator" has been encapsulated into Sacha Barber's Cinch
- Called a "Messenger" in Gala's MVVMLite framework
- An early example from Josh Smith - A Mediator Prototype for WPF Apps
- MVVM Foundation version - http://mvvmfoundation.codeplex.com/
References section
Use this section if you pulled source material and ideas from other sites, blogs, or forums. Make sure you have permission from authors to use their material.
- [Please contribute]