My question is about an "edge case" of the UML class diagram. In particular, I have loads (about 30) classes that implement an interface. They can be split into two groups of similar classes. Within each group the classes only differ by the implementation of the methods from the interface, however they represent fundamental different problems (different partial differential equations). Since they are so similar, I figured I could "stack" them on top of each other and clarify the idea with a note.
Sure, I could also create only two classes (one for each group) and pass the implementation of the function at instantiation. However, I think that this is even worse than the current representation. Also, this would not be practical, since I expect to instantiate 100 and more objects of one class.
What do you think about the current state of the class diagram in the picture? Do you have any other ideas? Any help is welcome!
1 Answer 1
Obviously, your diagram can't be used as input for a code generator, but if it is intended for communication with a human audience it appears to do its job.
The "stacked" notation is used in more places in UML to indicate multiple (near) copies and the note clearly indicates how those classes differ from each other, under the assumption that your audience knows what PDE's are and how they differ. But that assumption can not be taken away by drawing the class diagram differently.
-
As you interpreted correctly, the diagram should only convey the inner workings of the software, generating code is not intended. Do you have any further references at hand, where this stacked notation is also used?Isotope– Isotope2020年04月14日 11:16:20 +00:00Commented Apr 14, 2020 at 11:16
-
1@Isotope, no, I don't have any references at hand. The stacked notation may have been an UML 1 notation, and I only have UML 2 reference works here.Bart van Ingen Schenau– Bart van Ingen Schenau2020年04月14日 12:16:06 +00:00Commented Apr 14, 2020 at 12:16
Also, this would not be practical, since I expect to instantiate 100 and more objects of one class.
-- Just on that note - UML Class diagrams do not show instances/objects, so the number of instances of a class is irrelevant.