Prefer composition when a 'has-a' relationship exists.
Composition should be used when a class should contain another class, rather than being a subclass. This increases flexibility and reusability. For example, a 'Car' class with an 'Engine' object is better modeled with composition, as a car 'has an' engine rather than an engine 'is a' car.
Additional Notes
When should composition be preferred over inheritance?