What subset constraint means in the UML class diagram
Asked Answered
S

1

6

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

enter image description here

Savil answered 6/12, 2013 at 14:16 Comment(0)
S
9

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.

Sportsmanship answered 6/12, 2013 at 14:25 Comment(1)
thanks @Sportsmanship . Is it only refers that the manager is a subset of the other members ? I think I will describe it by inheritance. right ?Savil

© 2022 - 2024 — McMap. All rights reserved.