Friday, November 30, 2018

Behavioral Design Patterns: Mediator

Previously, we had a look at the iterator pattern. The mediator pattern is very different in what it tries to achieve. It is one of the behavioral patterns and its purpose is to alter the way objects communicate with each other. Instead of the objects communicating with each other directly, the mediator will handle the objects' interactions.

For example, imagine the scenario of a financial exchange. You do want to trade and buy but you don't buy directly from the one that makes the offer. Instead, the exchange is in the middle, in order for you to make the transaction.



from DZone.com Feed https://ift.tt/2PZ90bq

No comments:

Post a Comment