Reputation: 360
Lets say I have User and Role classes in my UML class diagram. User has one to many relationship with Role class
Attributes of User class: username, password, email
Attributes of Role class: roleType
According to problem specification, a user can invite another user and assign roles. How can I show this relationship in class diagram?
Upvotes: 1
Views: 1973
Reputation: 36305
Well, either you make the Role
a public attribute of User
or you add an operation
(and probably a couple more of that) to assign (and eventually remove) Role
s. Here I made role
a protected attribute. Feel free to make it private and add query operations at your wish.
Upvotes: 0