When do you prefer to use composition than aggregation?
Answer Posted / rajendra tambat
when you sure that the creation and destruction of part
class is in control of whole class you will use composition
where as the part can exist without whole class you use
aggrigation.
in compositition you will create the object of part as a
member variable
in aggrigation you will hold the reference to the part
class in whole class
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
What are the different types of UML diagrams?
What is a pattern?
What are the different types of relationship composition that exists?
What is object diagram in UML?
What is package diagram in UML with example?
Difference between Activity and Sequence Diagram?
Explain all elements of a State-chart diagram.
What are the approaches to preparing state chart?
What is contract?
What are the various components in sequence diagrams?
What is collaboration diagram in UML?
What are the three different views of a system model?
What does UML do?
how will u use com+ register
What is known as static diagrams?