<<< Generalization, Aggregation, Association, and Cardinality     Index     Modularity >>>

2. Difference between inheritance and composition


  • Inheritance is an "is-a" relationship. also known as generalization.

  • For example, Employee is a Person.

  • On true contrary, composition relationship represents interaction between objects.

    inheritance relationship
<<< Generalization, Aggregation, Association, and Cardinality     Index     Modularity >>>