软件设计模式课件 Lect3-Adapter-Structural-180907.pptVIP

  • 5
  • 0
  • 约1.57万字
  • 约 59页
  • 2020-11-10 发布于四川
  • 举报

软件设计模式课件 Lect3-Adapter-Structural-180907.ppt

* 问题: 在对象适配器模式中,能否同时适配两个类? If there are two existing classes Adaptee1 and Adaptee2, can we still use the object adapter pattern as below? Class adapter pattern- question operation1():void operation2():void operation3():void interface Target operation1():void Adaptee1 operation1(): void (在方法中调用operation1) operation2(): void (在方法中调用operation2) operation3(): void (写全新的代码) Adapter operation2():void Adaptee2 implement Call,aggregation Call,aggregation Answer: Yes Back * 使用适配器模式进行设计的例子 * 使用适配器模式进行设计的例子 Example 3. 离架软件,功能不足,欲增加新功能。 Suppose that we have purchased an off-shelf class InfoVa

文档评论(0)

1亿VIP精品文档

相关文档