Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Discovering aggregation relationships between classes can help the process of im

ID: 3829333 • Letter: D

Question

Discovering aggregation relationships between classes can help the process of implementation because

objects may need to share global variables to make the implementation simpler

one object may need to contain objects of another class as data elements in order to simplify the problem solution

they may need to be put together into a vector

aggregation is the only relationship that classes can have

A.

objects may need to share global variables to make the implementation simpler

B.

one object may need to contain objects of another class as data elements in order to simplify the problem solution

C.

they may need to be put together into a vector

D.

aggregation is the only relationship that classes can have

Explanation / Answer

Aggregation is a specialized form of Association where all objects have their own lifecycle, but there is ownership and child objects can not belong to another parent object.

Let's take an example of Department and teacher. A single teacher can not belong to multiple departments, but if we delete the department, the teacher object will not be destroyed. We can think about it as a “has-a” relationship.

In classes, we can use inheritance or polymorphism characteristic to implement functionality in effective manner. This is one of the use of aggregation property.

ANS->B One object may need to contain objects of another class as data elements in order to simplify the problem solution.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote