zyzhang
Explorer
发贴: 155
积分: 30
|
于 2004-12-20 21:05
I think mediator contributes on the promotion of the complex of many to many relationship. It encapsulates the communication between other objects. On the other hand, Observer design pattern handle one-to-many relationship by introducing "observer" and "subject" objects. From reusability point of view, Observer is easier than Mediator.
Actually, you can see the idea of Mediator design pattern applied in many places, such as j2ee session facade, enforce the relational integrity,and ect.
Command design pattern generally specifies a sender-receiver connection with a subclass through interface. Instead, Mediator makes senders and receivers reference each other indirectly.
|