0 votes
in C Plus Plus by

Explain the ISA and HASA class relationships. How would you implement each?

1 Answer

0 votes
by

“ISA” relationship usually exhibits inheritance as it implies that a class “ISA” specialized version of another class. For Example, An employee ISA person. That means an Employee class is inherited from the Person class.

Contrary to “ISA”, “HASA” relationship depicts that an entity may have another entity as its member or a class has another object embedded inside it.

So taking the same example of an Employee class, the way in which we associate the Salary class with the employee is not by inheriting it but by including or containing the Salary object inside the Employee class. “HASA” relationship is best exhibited by containment or aggregation.

Related questions

0 votes
asked Jun 11, 2020 in C Plus Plus by Robindeniel
+1 vote
+2 votes
asked Jun 19, 2019 in C Plus Plus by anonymous
+2 votes
+2 votes
asked Jun 19, 2019 in C Plus Plus by anonymous
0 votes
asked Jun 15, 2020 in C Plus Plus by Robindeniel
...