Live data from Hacker News

Why Domain Driven Design?

yehohanan7.medium.com

141–150 of 175 posts

Re: Why Domain Driven Design?

#141
post #110
post #104

Every problem has its fitting programming paradigm, at least in the main paradigms: declarative, imperative, functional, object oriented. DDD seems to be inevitably connected with OOP, at least I've never read something else. Hyping one paradigm will lead to using this paradigm in an inappropriate way, sometimes or often. (FYI: I didn't read the linked blog posting, because of medium.com)

That's funny, I always thought of DDD as a statically typed functional programming hhing.

Well, Evans and Vernons books use OOP. And when I was interested in the topic (actually it was event sourcing, which seems to be near 100% married to DDD, if you search online resources), I found only blog postings using OOP.

I found it funny, too, because IMHO event sourcing is fundamentally data driven, so FP would be a more natural fit.

Re: Why Domain Driven Design?

#142
post #83

Earlier quoted context omitted.

Oh--just that I couldn't understand the first chapter in Stepanov fully on first reading, so I need to read it again (and again, and again). The Feynman reference is Well, I asked him, “How can I read it? It’s so hard.” He said, “You start at the beginning and you read as far as you can get, until you are lost. Then you start at the beginning again, and you keep working through until you can understand the whole book…

That takes quadratic time though, assuming one “gets lost” with roughly constant likelihood throughout new text. I’m sure there must be a better way.

It would indeed take forever, even assuming we are not only reading, but writing notes too.

The only way through is to make it computable: writing programs and making it concrete.

Another is to obsess over it externally: taping index cards up on the walls, ruminating on it in the bath, and transferring that to software.

There's just too much to learn now. My bet is on first principles from cheap books, but the world keeps turning.

What has worked for you?

Re: Why Domain Driven Design?

#143

Earlier quoted context omitted.

> But do you know what helps? Having physical boundaries you can't cross so easily. Microservices. Or as I call them... just "services". Eric Evans has said that people using microservices may represent the most successful application of DDD's principles, not because people using them were fans or even aware of DDD, but microservices enforce the patterns DDD Evans was describing. Sir, your assembly code is so hard to…

It's as I've always said, every function ("unit") should be responsible for a single thing, and it must be developed by an independent company with no knowledge of the other companies involved. Otherwise you just can't do software engineering right.

I believe that never works in practice. The thing that binds units together is also code. Only while designing / implementing that code, you encounter the flaws in the interfaces of those units, and conclude that half of the units need to be replaced or their specifications need change.

Re: Why Domain Driven Design?

#144
post #141
post #110

Earlier quoted context omitted.

That's funny, I always thought of DDD as a statically typed functional programming hhing.

Well, Evans and Vernons books use OOP. And when I was interested in the topic (actually it was event sourcing, which seems to be near 100% married to DDD, if you search online resources), I found only blog postings using OOP. I found it funny, too, because IMHO event sourcing is fundamentally data driven, so FP would be a more natural fit.

He clearly says on the book that it's written using the tools that most people use, and that this is not a recommendation for the tools in any way.

He also gives a counterexample about implementing it in Prolog.

Re: Why Domain Driven Design?

#145
post #134

Domain Driven Design is a poison. The book is one of the most poorly written technical books out there. There are a handful of good ideas buried in the 1,000 page unedited verbose rambling slog. The whole book should only have been 10 pages. Besides Eric Evan’s inability to write, the poison of DDD comes from locking in businesses/domain concepts into your core technology, making them inflexible and making it difficu…

I worked on a number of software projects with Eric and got a lot out of his book before that. I'm sure you have good reasons for disliking DDD and I bet Eric would probably agree about most of them. This is what happens when ideas spread broadly. They end up getting applied in ways the originator never intended. (Jung reportedly said "thank god i'm not a jungian") Eric's a fine writer and one of the smartest and mos…

I read the whole book, and I think my gripes are with Eric’s core thesis. Modeling your software around your core business concepts is a poison in most cases. If you hard code product names, stakeholder names, and specific business processes into your core software, you’ve locked your business into a bad place. The reality is businesses domains shift regularly, especially in new and evolving companies. Instead, software should focus on business agnostic functional layers. The business domain, as much as possible, should live in configuration and data. Even for the core data models you choose, they should be flexible and business agnostic to support future types of business operation. A good test of the poison is how easy it is to add a new product/service line/workflow/stakeholder/onboard a new customer. DDD creates bespoke work and pain around these business needs.

There are probably a minority of times where you want to lock in your business concepts to your core model and service layer, like in a stagnated business that isn’t changing, or something that’s a universal domain model in that industry. The rest of the time business domains should be configured at a higher level. The linked article makes a good argument about the flexibility of spreadsheets.

Re: Why Domain Driven Design?

#146
post #34

My definition of DDD involves drawing up a series of relational tables in excel and reviewing those with the business stakeholders. If the product is like most, I'd then convert those excel workbooks to SQL schemas and start building some vertical slice demos. None of this has anything to do with micro services, source control, etc. The schema (domain) is the most important part of the product. If your manager can un…

Do you have an example of this flow somewhere? I never thought about prototyping it in excel and it sounds weird. I'm intrigued

Check out the relational data modelling capabilities in the Power Pivot Diagram view. It helps you graphically see the relations between basic excel tables.

Re: Why Domain Driven Design?

#147

Earlier quoted context omitted.

> But do you know what helps? Having physical boundaries you can't cross so easily. Microservices. Or as I call them... just "services". Eric Evans has said that people using microservices may represent the most successful application of DDD's principles, not because people using them were fans or even aware of DDD, but microservices enforce the patterns DDD Evans was describing. Sir, your assembly code is so hard to…

this is a good summary of why I pay zero attention to power point decks and blog posts. there is never a right answer and it's just people masturbating in circles. it's not rocket science, half of the time it's not even computer science. design patterns, at a certain point, become full of themselves.

[deleted]

Re: Why Domain Driven Design?

#148
post #110
post #104

Every problem has its fitting programming paradigm, at least in the main paradigms: declarative, imperative, functional, object oriented. DDD seems to be inevitably connected with OOP, at least I've never read something else. Hyping one paradigm will lead to using this paradigm in an inappropriate way, sometimes or often. (FYI: I didn't read the linked blog posting, because of medium.com)

That's funny, I always thought of DDD as a statically typed functional programming hhing.

From experience I've found it easier in FP languages to get right, and have them stand a few years than standard OO without it being a maintenance headache having written a few of them. So yes - I figured the same thing.

Re: Why Domain Driven Design?

#149
I only read the first third of the DDD book, the conceptual parts, which I thought were excellent, especially concepts like ubiquitous vocabulary and domain boundaries, which put a name to practices we’d already discovered.

But the underlying problem is that engineers are learning the domain as they write the code. This leads them to make invalid assumptions, which can go very deep, and make it extremely difficult to factor out later. If you build a feature based on bad assumptions, it can be really hard to remove or refactor it years later.

As it happens, I have written about 10 billing platforms in my life. If I was to build a new one today, I know exactly how to do it, and it will be super fast, efficient, and cover all the edge cases you can think of (please hire me :). My code structure would look nothing remotely like that written by someone doing this for the first time. They will make a bunch of fundamental mistakes, and most of those mistakes will be conceptual, because how can they know?. The problems range from accounting principles, to the nature of time, to user behaviour, and much more.

And the problem is that they will make the mistakes not because they don’t know how to write software, but because they haven’t spent years coming to understand the nuances and constraints of the billing domain.

No amount of software engineering boilerplate can fix that. In fact, the problem is that software engineering is largely discussed as a homogenous activity, but actually there are a million domains, each of them with different constraints, and because there are a limited number of specialists, we are constantly reinventing the wheel. To use my example, anyone can build a billing system because it seems obvious. But mostly those systems are going to be pretty flakey when they encounter the real world. And this principle applies to just about any domain.

Re: Why Domain Driven Design?

#150

I only read the first third of the DDD book, the conceptual parts, which I thought were excellent, especially concepts like ubiquitous vocabulary and domain boundaries, which put a name to practices we’d already discovered. But the underlying problem is that engineers are learning the domain as they write the code. This leads them to make invalid assumptions, which can go very deep, and make it extremely difficult to…

Speaking of billing, are there any good resources or examples for an engineer who gets thrown into this domain?
Post reply on HN