Design Pattern (2) 设计模式(2) Institute of Computer Software 2022-2-27 Nanjing University
设计模式(2) Design Pattern (2) 2022-2-27 Institute of Computer Software Nanjing University 1
&雪扇 摘要 UNIVE 2 Design Patterns ▣Why,What,How Creational,Structural and Behavioral Patterns Institute of Computer Software 2022-2-27 Nanjing University
摘要 Design Patterns Why, What, How Creational, Structural and Behavioral Patterns 2022-2-27 Institute of Computer Software Nanjing University 2
Structural Patterns 3 结构模式描述如何将类或者对象结合在一起形 成更大的结构。 口类的结构模式:结构型类模式使用继承机制来组合 接口或实现。 口对象的结构模式:结构型对象模式描述了如何对一 些对象进行组合,从而实现新功能的一些方法。可 以在运行时刻改变对象组合关系。 Institute of Computer Software 2022-2-27 Nanjing University
Structural Patterns 结构模式描述如何将类或者对象结合在一起形 成更大的结构。 类的结构模式:结构型类模式使用继承机制来组合 接口或实现。 对象的结构模式:结构型对象模式描述了如何对一 些对象进行组合,从而实现新功能的一些方法。可 以在运行时刻改变对象组合关系。 2022-2-27 Institute of Computer Software Nanjing University 3
&雪扇 Structural Patterns 0o2 UNIVE 4 Adapter Bridge Composite Decorator Facade Flyweight Proxy Institute of Computer Software 2022-2-27 Nanjing University
Structural Patterns Adapter Bridge Composite Decorator Facade Flyweight Proxy 2022-2-27 Institute of Computer Software Nanjing University 4
般感 Adapter 5 Aliases:Wrapper Intent 口将一个类的接口转换成客户希望的另外一个接口。 Adapter模式使得原本由于接口不兼容而不能一起 工作的那些类可以一起工作 Motivation ▣有时为复用而设计的工具箱类不能够被复用的原因 仅仅是因为它的接口与专业应用领域所需要的接口 不匹配 Institute of Computer Software 2022-2-27 Nanjing University
Adapter Aliases:Wrapper Intent 将一个类的接口转换成客户希望的另外一个接口。 Adapter模式使得原本由于接口不兼容而不能一起 工作的那些类可以一起工作 Motivation 有时为复用而设计的工具箱类不能够被复用的原因 仅仅是因为它的接口与专业应用领域所需要的接口 不匹配 2022-2-27 Institute of Computer Software Nanjing University 5