Dedian |
|
|||
-- 關注搜索引擎的開發 |
日歷
統計
導航常用鏈接留言簿(8)隨筆分類(45)
隨筆檔案(82)
文章檔案(2)Java Spaces搜索積分與排名
最新評論
閱讀排行榜評論排行榜 |
Purpose:
Encapsulate a set of objects which interact with each other. The benefit to do this is keeping objects from communicating with each other directly. All the messages between objects should be sent to mediator at first and then mediator will control and coordinate those interaction. Also, mediator can handle external interaction request and decide which object to response the external request. Structure: star topology: Mediator class is as a hub which connects to a set of classes (colleague classes). Difference from Facade Pattern: Facade differs from Mediator in that it abstracts a subsystem of objects to provide a more convenient interface. Its protocol is unidirectional. That is, Facade objects make requests of the subsystem classes but not vice versa. In contrast, Mediator enables cooperative behavior that colleague objects don't or can't provide, and the protocol is multidirectional. reference: Gamma, E., R. Helm, R. Johnson, J. Vlissides (1995). Design Patterns. Addison Wesley. ISBN 0.201-63361-2 http://sern.ucalgary.ca/courses/seng/443/W02/assignments/Mediator/ http://my.execpc.com/~gopalan/design/behavioral/mediator/mediator.html
|
![]() |
|
Copyright © Dedian | Powered by: 博客園 模板提供:滬江博客 |