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
查看全文
  • 相关阅读:
    P3688 [ZJOI2017] 树状数组 【二维线段树】
    CF516D Drazil and Morning Exercise【并查集,结论】
    Luogu5540 最小乘积生成树
    CDW数学小笔记
    ZROI 金华集训 线性代数选讲
    多项式乘法(代码)
    我的vimrc
    P4562 [JXOI2018]游戏
    [POJ3585]Accumulation Degree
    [CH5302]金字塔
  • 原文地址:https://www.cnblogs.com/kevinge/p/1548243.html
  • Copyright © 2011-2022 走看看