* Adding support for maven assembly plugin to generate executable jar with all dependencies in built * Merge branch 'master' into issue-989 # Conflicts: # abstract-document/pom.xml # pom.xml * Adding maven assemly plugin for projects with name A * Update in format as per checkstyle, i.e. Spcae in place of tab with size of 2 * batch set - 2 having all project with B and C * issue-989 d-e-f * fixing eip pom and adding g-h-i-l-m-n Skipping naked object as it seems it doesn't have main method, will consider this at end * Adding for O and P projects Skipping Object-Mother as we don't have main method for same.
layout, title, folder, permalink, categories, tags
layout | title | folder | permalink | categories | tags | ||
---|---|---|---|---|---|---|---|
pattern | Mediator | mediator | /patterns/mediator/ | Behavioral |
|
Intent
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.
Class diagram
Applicability
Use the Mediator pattern when
- a set of objects communicate in well-defined but complex ways. The resulting interdependencies are unstructured and difficult to understand
- reusing an object is difficult because it refers to and communicates with many other objects
- a behavior that's distributed between several classes should be customizable without a lot of subclassing
Real world examples
- All scheduleXXX() methods of java.util.Timer
- java.util.concurrent.Executor#execute()
- submit() and invokeXXX() methods of java.util.concurrent.ExecutorService
- scheduleXXX() methods of java.util.concurrent.ScheduledExecutorService
- java.lang.reflect.Method#invoke()