user2652051
user2652051

Reputation: 109

How to make a complex large UML class diagram in a simple and understandable way?

I have company workflow management project and am trying to design a UML class diagram, but the display is getting very large and clumsy so what I require is to make a complex class diagram into simple and easily understandable.

Upvotes: 8

Views: 6896

Answers (3)

Daniele Pallastrelli
Daniele Pallastrelli

Reputation: 2552

In general, you shouldn't represent too many classes in the same diagram: you'd better split the structure of your software in multiple diagrams. Every diagram should contain just classes interacting together. Ideally, in a single diagram you should have few classes that depend on each other but with few dependencies on classes contained in other diagrams. If you cannot divide your diagrams in this way because you have too many dependencies, your diagram is trying to tell you something: maybe your design has classes too coupled and you need to modularize more the project.

Another piece of advice: if you're using UML as a tool for reasoning (and not just for documentation), class diagrams are useful to show the static structure of your software and in particular the dependencies between classes. You don't need to put every detail in the diagram, so don't show every attribute and method of the classes, but only the most important methods. Ideally you should show just the methods that can suggest the behaviour of your software. Remember that UML stands for Unified Modeling Language, and a model is not a copy of the real thing with all its details :-)

Upvotes: 11

xmojmr
xmojmr

Reputation: 8145

Adding links to some examples (as requested) to the answers of @Daniele and @Aleks

Links are arranged in my recommended reading order:

all the other "conceptual" points were already answered.

BTW: good modeling tools allow interactive switching of required level of detail (collapse not interesting classes, zoom in/zoom out, turn display of properties on/off etc.) so reading one complex diagram may be possible, if it is not supposed to be printed on single A4 sheet of paper

Upvotes: 2

Aleks
Aleks

Reputation: 5854

"Divide to conquer"!

Use different strategies of structuring and breaking your diagram in more manageble units:

  • Group related classes in packages and manage dependencies between packages. Show packages in separate diagrams that give your overall model kind of "navigational backbone" (like folders and files)
  • Use inheritance hierarchies to simplify your class structures
  • Use composition relationship whenever possible to couple highely related classes based on Whole-Part paradigm
  • Finally break complex diagrams in several smaller and logically meaningfull ones

Semantic value in UML comes from the elements and their relationships and other features and not the way the diagrams are layed out. So the same semantic value from 100 classes in 1 diagarm can be achived with 10 diagrams. On the other side is the second case much easier fo follow, understand, extend and maintain.

Upvotes: 3

Related Questions