don' try to model objects or actions that might be useful in the future model exactly those tasks that the system needs to performand the design will naturally gravitate towards the one that has an appropriate level of abstraction this is not to say we should not think about possible future design modifications our designs should be open ended so that future requirements can be satisfied howeverwhen abstracting interfacestry to model exactly what needs to be modeled and nothing more when designing the interfacetry placing yourself in the object' shoes and imagine that the object has strong preference for privacy don' let other objects have access to data about you unless you feel it is in your best interest for them to have it don' give them an interface to force you to perform specific task unless you are certain you want them to be able to do that to you composition so farwe learned to design systems as group of interacting objectswhere each interaction involves viewing objects at an appropriate level of abstraction but we don' know yet how to create these levels of abstraction there are variety of ways to do thiswe'll discuss some advanced design patterns in strings and serialization and the iterator pattern but even most design patterns rely on two basic object-oriented principles known as composition and inheritance composition is simplerso let' start with it composition is the act of collecting several objects together to create new one composition is usually good choice when one object is part of another object we've already seen first hint of composition in the mechanic example car is composed of an enginetransmissionstarterheadlightsand windshieldamong numerous other parts the enginein turnis composed of pistonsa crank shaftand valves in this examplecomposition is good way to provide levels of abstraction the car object can provide the interface required by driverwhile also providing access to its component partswhich offers the deeper level of abstraction suitable for mechanic those component parts canof coursebe further broken down if the mechanic needs more information to diagnose problem or tune the engine this is common introductory example of compositionbut it' not overly useful when it comes to designing computer systems physical objects are easy to break into component objects people have been doing this at least since the ancient greeks originally postulated that atoms were the smallest units of matter (theyof coursedidn' have access to particle acceleratorscomputer systems are generally less complicated than physical objectsyet identifying the component objects in such systems does not happen as naturally