Analyst Integration Question:

Can you please explain the difference between composition, aggregation and association?

Integration Programmer Interview Question
Integration Programmer Interview Question

Answer:

Association means two objects are related to each other but can exists without each other, Composition is a form of association where one object is composed of multiple object, but they only exists together e.g. human body is composition of organs, individual organs cannot live they only useful in body. Aggregation is collection of object e.g. city is aggregation of citizens.


Previous QuestionNext Question
Explain loose-coupling?Can you please explain the difference between an interface and an abstract class?