Object-Oriented Programming In C++: Objects Composition
In real-life, complex objects are often built from smaller, simpler objects. You are built from smaller parts: a head, a body, some legs, arms, etc ... This process of building complex objects from simpler ones is called object composition.
Composition is used for objects that have/has a relationship to each other. A house has a door, has a roof, has a balcony. C++ allows us to do object composition in a very simple way by using classes as member variables in other classes.
- Read more about Object-Oriented Programming In C++: Objects Composition
- Log in or register to post comments
- 142 views