![]() ![]() This pattern is especially useful when you need one or more colleagues to act upon events initiated by another colleague, and, in turn, have this colleague generate further events that affect other colleagues. This mediator pattern is useful to separate interactions between colleagues into an object, the mediator. The mediator facilitates colleague-to-colleague interaction: Colleagues may both send and receive messages from the mediator. In lieu of interacting with other colleagues directly, each colleague communicates through the mediator. ![]() ![]() The mediator protocol defines methods and properties that the mediator must implement.Įach colleague contains a reference to the mediator, via the mediator protocol. The mediator is the object that controls the communication of the colleagues. The colleague protocol defines methods and properties that each colleague must implement. The colleagues are the objects that want to communicate with each other. The mediator pattern is a behavioral design pattern that encapsulates how objects communicate with one another. Section IV: Advanced Design Patterns Section 4: 7 chapters Section III: Intermediate Design Patterns Section 3: 8 chapters Section II: Fundamental Design Patterns Section 2: 7 chapters ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |