by dragontamer · 5y ago · 0 comments
If your inheritance structure is so complicated that you need a class diagram, you are probably in for pain... But class diagrams do their job for sure.
I find UML useful as post-coding documentation. After you figured out how things work, you UML diagram your code to help explain the complicated parts.
UML is also useful for talking with coworkers. As a 'sketch' don't try to get everything right, but coworkers often need to know what your plans are if they are to find work that won't conflict with your plan.
I think another UML post was talking about sketch 'masala' graphs (throw everything into a touchy feely graphic that really doesn't say much). Being absolutely vague and nontechnical is an advantage in some cases, but not useful to engineers. UML, for all of it's faults, is precisely defined. Every symbol means something.
That said, the formalism does not say much about error handling. This is where state machines can get really hairy, in much the same way that throw/catch gets nasty in any non-trivial system.
This misses the point of UML, entirely. The point is not that diagramming was invented, it was that it was standardized.
So you don't have to spend half your meeting discussing just exactly what this particular arrow between these two boxes means.
That's another fault, in my opinion. I'd rather have a vague high-level diagram with a write-up that rigorously describes all the invariants and structure than have a really semantic diagram which is meant to stand alone.
I think software structure is too complex to model with anything less powerful than natural language — that's why we add comments into code to explain the things that even the code itself doesn't make obvious.