section much too literally!oop and composition"has-arelationships the notion of composition was introduced in and from programmer' point of viewcomposition involves embedding other objects in container objectand activating them to implement container methods to designercomposition is another way to represent relationships in problem domain butrather than set membershipcomposition has to do with components--parts of whole composition also reflects the relationships between partscalled "has-arelationships some oop design texts refer to composition as aggregationor distinguish between the two terms by using aggregation to describe weaker dependency between container and contained in this texta "compositionsimply refers to collection of embedded objects the composite class generally provides an interface all its own and implements it by directing the embedded objects now that we've implemented our employeeslet' put them in the pizza shop and let them get busy our pizza shop is composite objectit has an ovenand it has employees like servers and chefs when customer enters and places an orderthe components of the shop spring into action--the server takes the orderthe chef makes the pizzaand so on the following example--file pizzashop py--runs the same on python and and simulates all the objects and relationships in this scenariofile pizzashop py ( xfrom __future__ import print_function from employees import pizzarobotserver class customerdef __init__(selfname)self name name def order(selfserver)print(self name"orders from"serverdef pay(selfserver)print(self name"pays for item to"serverclass ovendef bake(self)print("oven bakes"class pizzashopdef __init__(self)self server server('pat'self chef pizzarobot('bob'self oven oven(def order(selfname)customer customer(namecustomer order(self serverembed other objects robot named bob activate other objects customer orders from server oop and composition"has-arelationships