If in class diagram I have a parent "Account" and three childs "Child1", "Child2", and "Admin". The "Admin" has control over "Child1" and "Child2" accounts. Will the relation be like this?
1 Answer 1
The diagram is is close to what you said. But, just going by the names, Child1
and Child2
should not be classes. Those names are instances of Child
.
Also, according to the zero one infinity rule, in a design, there is no such thing as 2. Everything is either zero, one, or some arbitrary user configurable number. That's what the * you used is. A design with a 2 in it should raise your eyebrows.
-
Many thanks. I see your point. Actually the real diagram doesn't contain Child1 and Child2, it contains two different classes, maybe I had to specify that.Arwa– Arwa2016年12月20日 10:34:52 +00:00Commented Dec 20, 2016 at 10:34
Admin
to other classes. Lastly, you have a design where an admin can edit a child1 or child2, but not another admin, which sounds like a bug already. Just replace all of this with aallowedToEditOtherAccounts
flag inAccount
and move on. Job done.