
You really need to stay focused and draw a fine line how detailed the diagram should be to achieve expected results. I need to warn you though - even relatively simple system produces extensive interaction overview diagram. You can think of it as a large activity diagram, where for some activities you use actual sequence diagrams to depict those. The interaction overview diagram kind of combines activity diagram with a sequence diagram. It will work only for a system with relatively few function though (as a single diagram of course, if you split it into smaller chunks you may be successful even for large-scale systems). However, there is one diagram you may consider, assuming you want to stay on a high enough level - and that is the interaction overview diagram. Yet, doesn't bring a value so no, don't expect to have such standard.
#Sequence diagrams code#
It would be most probably less readable than the code itself, though maybe (just maybe) it's doable. I cannot imagine how a single sequence diagram could work. Activity diagrams or state diagrams are very interesting alternatives in many situations.

Last but not least, interactions are not always the best choice to explain what happens. I let you extrapolate what might happen if you'd add all the scenarios of all the use-cases, with all the objects. Your diagram will grow very big, have nested messages, and might quickly become unreadable. Still not convinced?Ī sequence diagram only show one specific scenario under the viewpoint of interactions (message exchanges) between objects/parts inside the system.įor alternative scenarios in the same diagram, combined fragments are needed.

Modeling experts can easily read more complex diagrams, but only because their experience trained them to cluster items, and with this trick they can go up to 6-7 clusters. Urban legend? No! Experiments on short term memory by AI pioneer Herbert Simon proved in the 70s this limitation of the human brain. Independently of UML, there is a limit to graphical visualisation: any diagram with more than 6-7 elements will appear difficult to understand to the average reader. So keep each of it as simple as possible but not more.

Based on this principe, an UML model of a complex system is made of many simpler diagrams. Complexity is mastered by breaking complex matters down into simpler ones.
