Object Composition
The technique to use Objects to create a new Objects is called Object Composition. It models the relationship between object using a has a
type of relationship. The newly created object is composed by using existing objects. The object use functionality from the existing objects.
You can use Object Composition
to create a TrafficLight
Object that is using the Light
Objects. The Traffic Light object don’t have to care how a Light is switched on or off, but it can rely on the fact that a light can be switched on and off.