The most important thing you can do when trying to learn Domain-Driven Design is still very much Eric's book amzn.to/3b1Uqrx People are not recommending this book enough because few have actually finished it.
It has a reputation of being hard to read, which is deserved. Read a little bit every day. Or read the bold parts first, then start over to read it thoroughly.
It also has a reputation of being too academic or too theoretical. This is undeserved: it is highly pragmatic, but it approaches software design from an angle that didn't exist anywhere else before, so it introduces many concepts that seem foreign at first.
Accept that some parts will not make sense on the first go. That's ok. I'm still discovering things in there, that I have read 10y ago, but hadn't needed yet. Sometimes you need to feel the pain to understand the solution.
Do work through the modelling examples. Superficially they look like a bunch of objects, but it's the process of continuous refinement of the model that you need to learn.
I love the DDD community dearly, but my criticism is that we haven't explored many of the ideas in that book yet. A few of the concepts get all the spotlight, and newcomers therefore are only learning those ideas too, instead of learning from the source material.
Do study the community resources, there's a lot of ideas there that have expanded on Eric's work in phenomenal ways, or that explain it in more accessible ways. But don't use them as a substitute for Eric Evans' work.
Domain-Driven Design is one of the few ideas in software design that span from the micro level (code, patterns) to the meaning (models, language) to the large (systems, boundaries, integration) to the macro (systems of systems). That alone is reason to study it.
• • •
Missing some Tweet in this thread? You can try to
force a refresh
The larger the client, the more likely they hire me because they want to "get it right the first time and avoid rework", and the more likely they end up not hiring me because before they do, they want to agree on the scope of what I will do for them.
"As small as possible" (DB partitions, message size, μsvcs, Bounded Contexts, class names, method arity, ...) is almost universally bad advice in software design. Some critical logic is going to cross those boundaries and result in poorly implemented, preventable workarounds.
But, "Whenever something is wrong, something is too big" (Kohr 1957) is also true for software. Big things are more obviously bad. Small things look simple, because the wrongness hides not inside the things, but in their connections.
Things usually tend to get bigger, rarely smaller or stable. @CarloPescio calls this gravity (things with mass acquire more mass) in the Physics of Software. Our usual reaction is to advocate smallness.
The problem is not that you shipped on Friday. The problem is that you have no way of knowing if shipping will break it. Most software is massively undermodeled and undertested.
Models (1) and tests (2) are two sides of software success: 1) do I understand this software so well that I can accurately predict the impact of a change in the system's behaviour 2) can I delonstrate confidence in its behaviour by repeatedly testing lots of scenarios
The irony is that both automated testing and modelling are crazy cheap compared to the perpetual burden and risk of undertested and undermodeled business-critical systems.
I wish we'd stop debating OOP vs FP, and started debating individual paradigms. Immutability, encapsulation, global state, single assignment, actor model, pure functions, IO in the type system, inheritance, composition... all of these are perfectly possible in either OOP or FP.
Some are better, some are worse, some are highly dependent on context, let's figure that out instead of religuously bashing umbrella terms like OOP and FP. And there may be many more paradigms to discover.
Take encapsulation: in #Haskell, you can choose for a module not to export your type constructors, and only export smart constructors and functions operating on your data structures. Sounds close enough to encapsulation to me.
1/9 Software design is invisible design. Its primary audience is the other designers.
2/9 Decision makers are used to design being something that produces visible outcomes: things, UIs, features, experiences. It's very hard for them to understand why they should care about software design.
3/9 But make no mistake: software design does impact users. If the software's model is congruent to the domain, it will help solve the users' problems, as oppose to generate more problems. It will lower communication cost about the system, and therefore enable speed.
1/ I've started publishing some Patterns for Decoupling in Distributed Systems on my blog. It's all very rough around the edges for now, I hope to improve them based on feedback.
2/ Summary Event: Instead of emitting a stream of Domain Events, emit a single Summary. verraes.net/2019/05/patter…
3/ Domain Queries: Replace Free Queries with Domain Queries to decouple from knowledge of the server's internals. verraes.net/2019/05/patter…