self oven bake(customer pay(self serverif __name__ ="__main__"scene pizzashop(scene order('homer'print('scene order('shaggy'make the composite simulate homer' order simulate shaggy' order the pizzashop class is container and controllerits constructor makes and embeds instances of the employee classes we wrote in the prior sectionas well as an oven class defined here when this module' self-test code calls the pizzashop order methodthe embedded objects are asked to carry out their actions in turn notice that we make new customer object for each orderand we pass on the embedded server object to customer methodscustomers come and gobut the server is part of the pizza shop composite also notice that employees are still involved in an inheritance relationshipcomposition and inheritance are complementary tools when we run this moduleour pizza shop handles two orders--one from homerand then one from shaggyc:\codepython pizzashop py homer orders from bob makes pizza oven bakes homer pays for item to shaggy orders from bob makes pizza oven bakes shaggy pays for item to againthis is mostly just toy simulationbut the objects and interactions are representative of composites at work as rule of thumbclasses can represent just about any objects and relationships you can express in sentencejust replace nouns with classes ( oven)and verbs with methods ( bake)and you'll have first cut at design stream processors revisited for composition example that may be bit more tangible than pizza-making robotsrecall the generic data stream processor function we partially coded in the introduction to oop in def processor(readerconverterwriter)while truedata reader read(if not databreak data converter(datawriter write(data designing with classes