Search code examples
printingumldocumentclass-diagram

Handling UML class diagram of a large class in a document for printing


I am currently writing a formal document in which I should place a specific UML class diagram.

The class has about 30 members, and roughly the same amount of methods. When I create a class diagram using any tool, it makes it a really long list - over 60 lines. It simply doesn't fit on a single page (I need the document printed).

Redesigning the class is out of the question.

How should I handle this problem? I have two ideas:

  1. Split the diagram - make one diagram for data members, and second one for methods.
  2. Make the diagram in two columns - one column for data members, and second one for methods.

Would such diagrams still be technically correct? I am unsure whether that would still make a valid UML.


Solution

  • There are tools that you can use to hide members of a class. I think Rational System Architect supports this and surely Sparx Enterprise Architect does. With such a tool I would create two diagrams, one displaying the members only (and a collapsed methods part) and one displaying the methods only (and a collapsed members part). Something like:

    +--------------------+
    | SomeClass          |
    +--------------------+
    | methods            |
    +--------------------+
    | +DateOfBirth: Date |
    | +Name : String     |
    | …                  |
    +--------------------+
    
    +----------------------------+
    | SomeClass                  |
    +----------------------------+
    | members                    |
    +----------------------------+
    | +void Say(String message)  |
    | +void Sleep(TimeSpan time) |
    | …                          |
    +----------------------------+
    

    If you want to be sure the readers of the documents understand the meaning of your diagrams you could drop a line explaining why you hid parts of the class.