且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

为什么是代理模式结构模式,为什么是状态模式行为模式?

更新时间:2021-07-28 21:50:52

模式是结构性的,如果关注点是如何组织对象之间的关系以形成更大的组件,而行为模式则关注对象的责任分配和之间的沟通他们

Patterns are structural if the focus is on how relationships between objects are organised to form larger components whereas behavioral patterns are focused on the allocation of object responsibilities and the communication between them

代理是结构性的,因为它充当另一个对象的代理,状态是行为的,因为状态被传递给对象以在运行时影响其行为.

The proxy is structural because it acts as a surrogate for another object, state is behavioral because the state is passed in to an object to influence its behaviour at runtime.