python3.6
class Facade:
def __init__(self):
self.sone = SOne()
self.stwo = STwo()
self.sthree = SThree()
def methodA(self):
print("方法组A---")
self.sone.moneA()
self.stwo.mtwoA()
self.sthree.mthreeB()
def methodB(self):
print("方法组B---")
self.sone.moneB()
self.stwo.mtwoB()
self.sthree.mthreeA()
class SOne:
def moneA(self):
print("类1方法A")
def moneB(self):
print("类1方法B")
class STwo:
def mtwoA(self):
print("类2方法A")
def mtwoB(self):
print("类2方法B")
class SThree:
def mthreeA(self):
print("类3方法A")
def mthreeB(self):
print("类3方法B")
if __name__ == "__main__":
fac = Facade()
fac.methodA()
fac.methodB()