简体   繁体   中英

What UML relation should I use between these two classes?

I have a class called "EventManager" and one called "Event". From Eventmanager I can created and store events in a linkedlisted, which then is stored in a hashmap together with "persons" who attend these events. Now, which relationship(UML) between Event and Eventmanager?

I think it's an HAS-A. Since EventManager contains Events.

Use simple association. EventManager is not composed of Events. It only provide list of events to process. Another association would be created between event and person.

I also think it is HAS-A relationship as EventManager class has Event class as its data member.

Simple association will not suffice in this case.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM