Live data from Hacker News

UML diagram for the DDD example in Evans' book

github.com

41–50 of 77 posts

Re: UML diagram for the DDD example in Evans' book

#41
post #33
post #8

I used to work heavily in this kind of system modeling (developing tools for it, and dogfooding), and still use it when high-value for figuring out or communicating an aspect of a system. Here's a challenge, to help appreciate the nature of these: try to find an error in the diagrams. It's usually harder than you might think, since, even when you know the notation and metamodel semantics, it's information-dense talki…

> try to find an error in the diagrams. Easy peasy, it's the 3rd blue line above the purple line /s https://github.com/takaakit/uml-diagram-for-ddd-example-in-e... I can't believe someone took time to generate such a thing, as if it is useful to anyone

> I can't believe someone took time to generate such a thing, as if it is useful to anyone

Thanks for saying this. UML is beyond useless, almost nobody understands it, almost nobody does it right and almost nobody uses it when they need to (because it makes no sense to them).

Re: UML diagram for the DDD example in Evans' book

#42
post #2

What happened to UML? I remember it was everywhere in enterprise computing 20 years ago but seems to have disappeared now. Is it still around or did it go the way of SOAP, Java Applets? If not, what has replaced it?

I think its abandonment is related to the adoption of agile methodologies. UML was used to describe systems from day one. Agile methodologies came in, claiming that we don’t need it.

You still need to describe systems in agile.

All agile does is ask you to iterate, which means updating your design, your code, and your tests & documentation, as you learn.

Please read the agile manifesto again, and actually apply it. It does not say we don’t do design at all. Never did.

Re: UML diagram for the DDD example in Evans' book

#43
post #25

Good UML is really simple UML. "Then what about complex things? Can't make everything simple" Do partial diagrams. Simplify or skip things your team already knows. Also, great UML is no UML. Sometimes the code itself is short and clear enough, requiring no diagram (of course, not all diagrams are about code... but use case diagrams are rare these days anyway). Also, use cases and use case diagrams are great. Also, pe…

I very much like your comment. It describes practical use of diagrams. In the past, I've included diagrams for a particularly complex state in the comment on top of my code. It certainly doesn't describe the whole system, or even the complete state of that code. And I expect that someone will delete the comment at some point. That's all fine.

Re: UML diagram for the DDD example in Evans' book

#44
post #2

What happened to UML? I remember it was everywhere in enterprise computing 20 years ago but seems to have disappeared now. Is it still around or did it go the way of SOAP, Java Applets? If not, what has replaced it?

It's still being taught in schools AFAIK.

Had an intern a year ago whose school forced them to go the whole nine yards with UML. Our company gave them a project to build, and their school made them draw use-case diagrams, class diagrams, sequence diagrams, and activity diagrams, before the student was allowed to write any code.

This was a waste of everyone's time, and we gave the school some choice feedback which I'm sure they'll ignore.

Sequence diagrams are still used quite a lot, and for good reason, they're incredibly useful. I see simple class diagrams quite frequently as well, but without the poorly designed arrow nonsense (shaded? open? closed? argh!).

Re: UML diagram for the DDD example in Evans' book

#45
post #2

What happened to UML? I remember it was everywhere in enterprise computing 20 years ago but seems to have disappeared now. Is it still around or did it go the way of SOAP, Java Applets? If not, what has replaced it?

In payments and most other industries with a lot of connections to 3rd parties and complicated transactional flows, UML diagrams (especially sequence diagrams) are used a lot, albeit mostly as a conceptual tool rather than some formal description (see for example the Stripe docs). I also see UML state chart-like approaches being used more formally in frontend (e.g. XState).

Re: UML diagram for the DDD example in Evans' book

#46
post #2

What happened to UML? I remember it was everywhere in enterprise computing 20 years ago but seems to have disappeared now. Is it still around or did it go the way of SOAP, Java Applets? If not, what has replaced it?

Underneath the good ideas of UML was the idea of model driven development - that you could generate code from the models.

Good diagrams are an art form though, just like other forms of good documentation. There is a big difference between a diagram being a normative source of truth, and being a good tool.

Take this diagram as an example: https://takaakit.github.io/uml-diagram-for-ddd-example-in-ev...

* Nearly the top half is taken up by relations which aren't especially helpful, and would be better expressed on the entities themselves.

* The "Location" type looks like the primary type in the system based on nearly half the types in the system connecting with it, creating a nest of graph edges. However, this is likely a simple and immutable record type. If the entities in this diagram had attributes (e.g. like a class diagram), you could refer to it by name, and greatly simplify the cognitive load in understanding this picture.

This is the sort of diagram that gets generated from code, and is at the level of specificity needed to generate code from a diagram. It also isn't very useful for using the model to convey the system to a person - a developer might be more comfortable reading the code rather than looking at a picture generated from it.

IMHO, that split focus in UML between people and tooling greatly reduced the overall usefulness and understanding of the system. It gave UML a bad reputation. Training on MDD tools prevailed over providing a baseline of common nomenclature to enable "team cave drawing on a whiteboard", which has no commercial tooling or market other than the whiteboard and markers.

The areas where visual languages have a bit more prevalence are on the business modeling side, including things like network architecture diagrams.

It is a bit of a shame - going through a set of use cases while iteratively improving the architecture by improving a set of class, sequence and ECB diagrams is something I always found to be crazy efficient vs diving immediately down to prototype code.

Re: UML diagram for the DDD example in Evans' book

#47
post #2

What happened to UML? I remember it was everywhere in enterprise computing 20 years ago but seems to have disappeared now. Is it still around or did it go the way of SOAP, Java Applets? If not, what has replaced it?

UML was a scam really. They took a lot of very useful diagrams and created a absolute behemoth of unproven system to develop software and sold it. The diagrams are very nice and useful. But the UML as a process, if taken literally, it a total disaster.

One of the creators of UML, Booch, has said so himself that it was taken to a point where it should never have. Interesting interview: https://youtu.be/u7WaC429YcU?feature=shared

Re: UML diagram for the DDD example in Evans' book

#48
post #4
post #2

What happened to UML? I remember it was everywhere in enterprise computing 20 years ago but seems to have disappeared now. Is it still around or did it go the way of SOAP, Java Applets? If not, what has replaced it?

UML as a methodology seems to have disappeared, but bits of it (e.g. sequence diagrams) seem to have been absorbed by the profession at large.

I think the UML statecharts are a much more useful diagrams than sequence diagrams. It can convey a lot more of the behaviour especially if you use the entire 'Harel' formalisms.

Too bad, they aren't that popular to document behaviour, because sequence diagrams really don't convey that much.

For example timeouts are very neatly described in a harel state chart. How will one describe timeout and timeout handling in sequence diagrams.

Re: UML diagram for the DDD example in Evans' book

#49
For the architectural documentation like this one, the C4 Model [0] is a much better fit than UML - primarily because it's less rigid in notation and modeling components. And in terms of tooling, I find IcePanel [1] to have the right combination of flexibility and simplicity.

[0] https://c4model.com/

[1] https://icepanel.io/

Re: UML diagram for the DDD example in Evans' book

#50
post #8

I used to work heavily in this kind of system modeling (developing tools for it, and dogfooding), and still use it when high-value for figuring out or communicating an aspect of a system. Here's a challenge, to help appreciate the nature of these: try to find an error in the diagrams. It's usually harder than you might think, since, even when you know the notation and metamodel semantics, it's information-dense talki…

One of my more painful design mistakes happened in this sort of way when designing a system for recording inspections. I interviewed multiple inspectors and came up with a representation that was a little bit more elaborate than I would have hoped, but it at least captured all information I believed.

Then the company progressed and eventually we got to market fit and for two years the team and I were dealing with this increasingly burdensome complexity that we were not reaping any rewards of. Then one day we had enough and a colleague redesigned the system to ditch the extra complexity resulting in a much more elegant design that was easier to reason about.

That bliss continued for less than a year, until some customers asked for a particular report that we needed to generate based on a structure of the information that was now no longer present. We had to redesign it again, migrating was super painful and involved a temporary workaround that basically involved an extra branch on literally every piece of code that touched the inspection system.

In retrospect, I still don't know how I could have convinced the team that the complexity was something we needed when no customer required it for 3 years. Especially when the colleagues who took over that system from me had gained much more experience and expertise in the domain than I had since I had designed the original.

It would probably have been better if I had recorded the requirement that prompted the complexity, but had not actually implemented it as no customer had actual need for it at the time. Then we would not have had to deal with the complexity the first three years, and then evolved the product when the need arose.

Post reply on HN