Why do you want to manually draw UML, whether on paper or on a computer?
I agree that you need a model to represent the design. But even in large projects with about 500 man-months, I noticed that in reality only 3-4 sequence diagrams matter and have a chance to survive throughout the entire application life cycle. These 3-4 sequence diagrams (and class diagrams that represent their static time relationships) typically represent a high-level application design.
Or look at it this way:
Any decent corporate application will not have 20 different call flows. There will be one or two generic (or abstract) call flows that are implemented by all specific use cases. Take the simple Struts / EJB application. The overall thread will be something like: an action class that calls the validator, and then the session without the bean state, which in turn calls the domain class that will call the DAO. All use cases for the application simply implement this stream with specific classes specific to this use case.
Do you agree?
If you do not, I would like to hear about applications that have 20 different call flows and survived for 5 years after the first release.
If you agree with me, we boil up to 3-4 classes and sequence diagrams even for large corporate applications, including several thousand classes. Why is it important how you draw and maintain these 3-4 diagrams?
You can say that you want to document all use cases for training or documentation. During my last 14 years of working in the real world of enterprise software, I don’t remember having a good look at UML documentation. Firstly, good documents are difficult to produce and often do not occur. Secondly, they do not synchronize with the code most of the time. Most of my experience is associated with large banks, insurance companies, car companies, etc. These environments are too stressful and their resources are limited (in fact, are we talking about banks? Yes, it's hard to believe, but true) to “maintain” good documentation.
I suggest getting rid of UML?
No. We need visual models to represent complex systems. The human brain seems to be in a better condition when processing visual effects. visual corax , which is responsible for processing visual images, is the largest system in the human brain.
So, what is a smart solution to easily create and maintain UML models?
- We should probably use the current UML toolkit to draw these 3-4 high-level UML diagrams. If you hate using them, check option 3. below.
- For diagrams at the next level of abstraction (any utility models must have different levels of abstraction), generate UML from the source code. You can generate class and sequence diagrams.
- At this age of agile methodologies, why not just write shell classes and generate these 3-4 high-level UML classes and sequence diagrams? Thus, UML will not support at all.
Source code is true.
Can you argue with this statement? If not, why not generate models from the source code itself? By the way, I do not propose a round-trip technique. I just offer a one-way ride - from code to models.
There are two main problems, but with the UML created.
- When we draw a class diagram, we show the relationships between the classes involved in the script. Most existing class diagram generation tools allow the user to drop Java classes (source code) into the tool, and the tool automatically displays the relationships between the classes. The problem here is how to find out about the classes involved in the script, for starters?
- The second problem is the verbosity of the constructed diagrams. Means exist for generating execution sequences and class diagrams for a script. But diagrams are often very verbose and downplay the goal of models whose purpose is to highlight important aspects and filter out irrelevant details.
Good UML generation tools should solve both of these problems. In the Java field, there are several tools that try to solve these problems. Check out the discussion below:
What tools should be used to visualize the structure of my code
Are there any tools for detecting architectural and design patterns in code?
I hope I answered the original question:
Are there any other interesting ideas? I would love to hear that others are using their software design and progress.
I am the author of the MaintainJ UML runtime generator , but I tried to objectively resolve the original question. Your comments are welcome.