• abstract factory 创建相互关联的类


    Function:
     Provide an interface for creating families of related or dependent objects without specifying their concrete classes.

    Participants:
  • AbstractFactory  (ContinentFactory)
    • declares an interface for operations that create abstract products
  • ConcreteFactory   (AfricaFactory, AmericaFactory)
    • implements the operations to create concrete product objects
  • AbstractProduct   (Herbivore, Carnivore)
    • declares an interface for a type of product object
  • Product  (Wildebeest, Lion, Bison, Wolf)
    • defines a product object to be created by the corresponding concrete factory
    • implements the AbstractProduct interface
  • Client  (AnimalWorld)
    • uses interfaces declared by AbstractFactory and AbstractProduct classes
  • 相关阅读:
    上传文件(一)
    momentjs
    asp.net中session的原理及应用
    聊天程序(基于Socket、Thread)
    接口与抽象类
    asp.net 发送邮件
    Web.Config文件详解
    Apache Sqoop
    HBase 数据模型(Data Model)
    HBase框架学习之路
  • 原文地址:https://www.cnblogs.com/kevinge/p/1548243.html
  • Copyright © 2020-2023  润新知