zoukankan      html  css  js  c++  java
  • 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
查看全文
  • 相关阅读:
    TP-LINK,TL-WR885路由器无线桥接方法
    python3 urllib.request.Request的用法
    requests模块
    python3中引入扩展包时的几个注意事项
    Flask-sqlacodegen之ORM操作
    mysql ERROR 1049 (42000): Unknown database '******' ”错误处理办法
    Python各种包下载路径
    python在Apache中的部署
    Python3 基于 Nginx或Apache 部署 Django 项目
    Python如何发布程序
  • 原文地址:https://www.cnblogs.com/kevinge/p/1548243.html
  • Copyright © 2011-2022 走看看