I’m trying to understand what these terms mean. And I came with few examples like:
Aggregation : Facebook has a user
Composition : Each user in facebook has a session.
Association : People uses a browser
But I’m getting confused with has a and uses a examples of mine. Why can’t it be User uses a facebook account or Facebook uses a session to authenticate user?
Is that wrong in terms of OOP? Where I’m missing the concept?
The uses a relationship means two things
->both can exist independently
->Data flows from the whole classifier(people) to the part classifier(browser)
The has a relationship means two things
->the lifetime of the part classifier(session) is dependent on the lifetime of the whole classifier(facebook)
->data usually flows in only one direction (that is, from the whole classifier(facebook) to the part classifier(session)).