https://en.wikipedia.org/wiki/Adapter_pattern 维基百科 这篇关于 适配器设计模式的介绍非常好
mark
In the above UML class diagram, the client
class that requires a target
interface cannot reuse the adaptee
class directly because its interface doesn't conform to the target
interface. Instead, the client
works through an adapter
class that implements the target
interface in terms of adaptee
:
- The
object adapter
way implements thetarget
interface by delegating to anadaptee
object at run-time (adaptee.specificOperation()
). - The
class adapter
way implements thetarget
interface by inheriting from anadaptee
class at compile-time (specificOperation()
).
并且总结了适配器模式 跟装饰器模式跟 外观模式的 区别
UML之类图_chls的博客-CSDN博客_uml类图 这个 博客介绍了类图的主要一个元素
realization 实现
generalization 泛化
association 关联
aggregation 聚合
composition 组合
dependency 依赖