Benefits:
• It decouples colleagues.
• It simplifies object protocols.
• It centralizes control.
• The individual components become simpler and much easier to deal with because they do not need to pass messages to one another.
• The components do not need to contain logic to deal with their intercommunication and are therefore more generic.
Applicable Scenarios:
• A set of objects communicates in complex but well-defined ways.
• Custom behavior distributed between several objects is required without subclassing. It is commonly used structurally in message-based systems. The messages themselves are the means by which related objects are decoupled.
博客介绍了组件相关的好处,包括解耦同事、简化对象协议、集中控制等,使组件更简单通用。还说明了适用场景,如对象以复杂但明确的方式通信,以及无需子类化实现自定义行为,常用于基于消息的系统。
162

被折叠的 条评论
为什么被折叠?



