I have made this simple UML diagram.
I want to have a list of treatments inside class Customer.
My question is if I need another association to make this possible.
I have made this simple UML diagram.
I want to have a list of treatments inside class Customer.
My question is if I need another association to make this possible.
A class diagram describes classes and not objects. A TreatmentList
is a TreatmentList
, regardless if you look at it from the Menu
or the Customer
persepective.
So indeed, if you want a list of treatment "inside" the class Customer
, you'll need just to add another association between the classes you want to connect.
Now I wonder if you did not try to design user interface using a class diagram:
Main
-> Menu
-> List 1
or List 2
looks terribly like a flow in the user interface, more than a set of related classes. You don't need this. And lass diagrams are not meant for this purpose. If you want to model an UI Menu
, you'd model a menu class, i.e a general class that could instantiate any kind of menus, with a one-to-many association with MenuAction
. Perhaps ShowTreamtmentList
would be a specialization of such an action.TreatmentList
and CustomerList
only make sense if these are classes, i.e. they could be instantiated into one or several objects that each represent a different list. If, for an association, you'd have a multiplicity of *
on the side of customer or treatment, you would not need to add a special list/set/bag in the middle.