nus-cs2113-AY1920S2 / forum

4 stars 0 forks source link

1. How to tell the difference between composition and aggregation #77

Closed lowxizhi closed 4 years ago

lowxizhi commented 4 years ago

In this case, there is a composition association between Email class and Subject object

class Email { private Subject subject; ... }

In this case, there is an aggregation association between Team class and Person object.

class Team { Person leader; ... void setLeader(Person p) { leader = p; } }

damithc commented 4 years ago

You can edit your own issues. No need to close and open a new one :-)

lowxizhi commented 4 years ago

I accidentally posted this issue by pressing Enter. Will take note!