Drew
Drew

Reputation: 1261

Plantuml, supertype/subtype generalization

I am working on an object diagram and would like to use this kind of notation: enter image description here

To convey a disjoint. Is there a way to do this?

Upvotes: 2

Views: 1214

Answers (1)

Peter Uhnak
Peter Uhnak

Reputation: 10217

In your picture you have Entity-Relationship diagram, which has nothing to do with UML. Likewise UML Object diagram is concerned with visualizing actual instances, so my guess is that you were looking for Class Diagram.

In UML, you could model this as a generalization set

hide circle

class Patient

Patient <|-- Outpatient
Patient <|-- Resident


GeneralizationSet ..(Patient, Outpatient)
(Patient, Resident) .. GeneralizationSet

class GeneralizationSet {
  isDisjoint = true
}

enter image description here

the isDisjoint = true tells us that it can be either one or the other, but not both.

Upvotes: 1

Related Questions