class PizzaShop: def __init__(self): self.server = Server('Pat') # Embed other objects self.chef = PizzaRobot('Bob') # A robot named bob self.oven = Oven() def order(self, name): customer = Customer(name) # Activate other objects customer.order(self.server) # Customer orders from server self.chef.work() self.oven.bake() customer.pay(self.server)
def __init__(self): self.server = Server('Pat') # Embed other objects self.chef = PizzaRobot('Bob') # A robot named bob self.oven = Oven()