In real-world programs an object is made up of several parts. For example a car is made up of several parts (objects) like engine, wheel, door etc. This kind of whole part relationship is known as composition which is also known as has-a relationship. Composition allows us to create separate class for each task. Following are the advantages or benefits of composition: Each class can be simple and straightforward. A class can focus on performing one specific task. Classes will be easier to write, debug, understand, and usable by other people. Lowers the overall complexity of the whole object. The
The post what is object composition in c++ programming appeared first on Coding Security.
what is object composition in c++ programming
read more
Tidak ada komentar:
Posting Komentar