# -*- coding: utf-8 -*-
"""
Created on Sat Mar 3 21:56:58 2018
@author: mz
"""
class IFactory(object):
def ProduceB(self):
pass
def ProduceA(self):
pass
class IMethod(object):
def DoAsIMean(self):
pass
class IOtherMethod(object):
def DoAsIMean(self):
pass
class AOtherMethod(IOtherMethod):
def DoAsIMean(self):
print("do as a other method means")
class BOtherMethod(IOtherMethod):
def DoAsIMean(self):
print("do as b other method means")
class AMethod(IMethod):
def DoAsIMean(self):
print("do as a method means")
class BMethod(IMethod):
def DoAsIMean(self):
print("do as b method means")
Python 抽象工厂
最新推荐文章于 2024-09-20 20:09:26 发布
本文详细探讨了Python中的抽象工厂设计模式,包括其概念、使用场景和具体实现。通过实例解析,阐述了如何在Python中创建和使用抽象工厂,以达到在不同平台或环境中生成一致接口的目的。
摘要由CSDN通过智能技术生成