2 ms·
> We already have a perfectly good way of representing the details of a system - it's called source code. Interestingly enough, that's a bit of a false dichoto
by wyldfire 11y ago
> We already have a perfectly good way of representing the details of a system - it's called source code.
Interestingly enough, that's a bit of a false dichotomy.
Imagine it's your first day on the team, and there's thirty classes (or thirty functions) in this software package, and you want to understand their inheritance/composition, what's a good way to take a step back and just see how they relate to each other? You can browse some interface files or some source files, accumulating a model in your head. But the visual throughput into your brain is just so much better when you can see it in a diagram.
Regardless of whether a human draws the UML representation of the design in advance of the implementation or a machine deduces this from the existing source code, you can still benefit from a class diagram that will cut out the noise of the implementation itself. As long as we're drawing a diagram, why not have a common way to represent the concepts we use in software?
- arethuza 11y agoIf I wanted to see a class diagram I'd simply use a tool to generate a class diagram from the code - which I'd then know was completely up to date. Edit: DRY
- wyldfire 11y agoNothing about UML specifies its use in relation to when or how you wrote the code. Like I said, it's a false dichotomy to suggest that we can have source code or UML but not both. Yes, UML diagrams or any other design docs rot quickly. But like you said, we can generate diagrams after the fact too (or in lieu of ever writing UML diagrams before coding). > perfectly good way of representing the details of a system - it's called source code. ... > simply use a tool to generate a class diagram from the code Once you resolve to generate that class diagram you have a choice in how to represent it. UML is just one way, proposed as a standard way, to represent that visually.