Moment of zen


Figure 8.3: Complex is better than complicated

The aircraft_model() method is an example of 'complex is better than complicated':

def aircraft_model(self):
return self._aircraft.model()

The Flight class is more complex – it contains additional code to drill down through the aircraft reference to find the model. However, all clients of Flight can now be less complicated; none of them need to know about the Aircraft class, dramatically simplifying the system.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset