为什么是代理模式结构模式,为什么是状态模式行为模式? [英] Why is proxy pattern Structural Pattern and why is State Pattern behavioral pattern?

查看:124
本文介绍了为什么是代理模式结构模式,为什么是状态模式行为模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么代理模式是结构模式,为什么状态模式是行为模式.确定新模式的标准应被视为结构性或行为性的?

why is proxy pattern a structural pattern and why is state pattern a behavioral pattern. What is the criteria for determining a new pattern should be considered structural or behavioral?

推荐答案

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

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.

这篇关于为什么是代理模式结构模式,为什么是状态模式行为模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆