软件设计模式课件 lect8_Mediator-Behavioral-new.pptVIP

  • 7
  • 0
  • 约1.1万字
  • 约 42页
  • 2020-11-10 发布于四川
  • 举报

软件设计模式课件 lect8_Mediator-Behavioral-new.ppt

Hotel Airline TourCompany The three objects are tightly coupled Example of Mediator Pattern In such a way, all the 3 companies are tightly coupled as figure below. notifyAirLine() notifyHotel() notifyTour() notifyHotel() +notifyAirLine() +notifyTour() 设计缺点:各个对象之间直接交互 调用关系复杂 可扩展性差 等缺点 解决方案:使用中介者模式,引入中介者类 BusinessMediator. Example of Mediator Pattern Hotel Airport TourCompany Use mediator to reduce the coupling Example of Mediator Pattern BusinessMediator HotelGUI -m: BusinessMediator +addCustomer(String c); +addPossibleCustomer(String c) +displayInfo(String txt) TourGUI -m: Busin

文档评论(0)

1亿VIP精品文档

相关文档