下图是________________设计模式的类图,该设计模式的目的是________________,图中,Decorator和Component之间是________________关系,ConcreteDecorator和Decorator之间是_

admin2021-01-11  63

问题 下图是________________设计模式的类图,该设计模式的目的是________________,图中,Decorator和Component之间是________________关系,ConcreteDecorator和Decorator之间是________________关系。


选项 A、依赖
B、关联
C、继承
D、组合

答案C

解析 本题考查软件设计模式的基础知识。要求学生了解常用的设计模式。本题考查装饰模式(Decorator),其目的是动态地给一个对象附加额外的职责,不必通过子类就能灵活地增加功能。在上述类图中,Decorator和Component之间是关联关系和实现关系,注意这里的Component是接口。ConcretcDecorator和Decorator之间是继承关系。
转载请注明原文地址:https://kaotiyun.com/show/MGPZ777K
0

相关试题推荐
最新回复(0)