Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What subset constraint means in the UML class diagram

Tags:

class

uml

There is subset between Department class and person class but I don't know what does than mean?

enter image description here

like image 542
Andrew Avatar asked Dec 06 '13 14:12

Andrew


1 Answers

Homerwork per chance...?

Look at the two relationships linked by the subset constraint:

  • Each Department has many members
  • Each Department has one manager

The subset expresses a constraint between those two. If the elements of the latter relationship are a subset of the first, then how would you describe the implication?

EDIT

In response to your comment:

Without the constraint, a Person can be a member of a Department and manage any Department. There's nothing that says whether they have to be a member of the department they manage. That's what the constraint says: a manager must be a member of the department they manage.

I think I will describe it by inheritance. right ?

Depends what you mean by inheritance. Subtyping perhaps (at least analogously) but not implementation inheritance. It's probably not how I'd prefer to describe it. It is properly a subset: you'd be better describing why one is a subset of the other and what the implications are.

hth.

like image 106
sfinnie Avatar answered Oct 31 '22 00:10

sfinnie