1

I have several questions about UML diagrams as I am not finding them very clear (they are new to me).

1) When making a diagram with generalizations/specialization: if I do not have all of the possible child classes on my diagram and only have the main children relevant to me, do I still use a blank triangle for the connection?

2) If I have such a diagram and an entity (person in this case) can belong to multiple children categories, how is this shown? Should the fact that an entity(person) can belong to multiple child categories be shown on a UML domain class model?

3) If two of my children have a relationship between them, for the two children that are patient and physician, how is the relationship shown on UML? Is it just a line with a verb and notation (eg 0..1)?

Any advice would be greatly appreciated!

  • "Any advice would be greatly appreciated!" Any advice? Well mine would be to not bother. In my view, UML is a huge waste of time and leads to really bad designs. So don't worry about it and walk away. – David Arno Jan 28 '18 at 20:00
  • Can anyone please provide clarification or at least inform me how to better structure my questions here? – PeteyM Jan 28 '18 at 20:00
  • Sadly, the semantics of conventional UML class diagrams are so poorly defined to make them almost meaningless (hence we have Foundational UML). If you want to be serious about using UML (and it can be serious), then you have to find an appropriately well specified profile that suits your intent. If your intent is problem analysis, one such subset is Executable UML. And for what it is worth, in Executable UML all generalizations are considered "complete and disjoint" so # 2 cannot happen. At first glance you seem to be modeling roles that a Person may play and not a generalization of Person. – andy mango Jan 28 '18 at 20:16
3

There are many UML diagrams. You are obviously referring to an UML class diagram:

  1. Yes: you choose the level of details that you want to show in your diagram. So you can very well decide to show only some classes and not all. And the semantics remain unchanged, including for generalization. Note that if you use a "shared target" style for representing siblings, you could eventually put some "..." between siblings to highlight that there are others. It's not in the UML standard, but it's self-explanatory for your readers.

  2. It depends:

    • If you have a class which is a specialization of two other classes, you'd simply represent two generalizations. But not many languages can implement multiple inheritance.
    • If you have a class which is in reality a specialization of one class, and which implements a given interface, you'd represent this with a "realization" dependency. It is represented with a specialization that uses a dotted line. his semantic is supported by most of the mainstream OOP languages.
  3. Just an association between the two classes (see link for more details). But it depends, because you may or may not represent multiplicity and navigability.

This answer will not replace the reading of some tutorial or book to get familiarized with UML. May be start with the embedded links. If it's not sufficient, consider reading UML distilled, which is an excellent introduction to all the most important UML diagram types.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.