Do you have enough Complexity for a Domain Model (Domain Driven Design)?

preview_player
Показать описание
Should you be applying domain driven design? Do you need a domain model? You might want to if you have a lot of complexity within your domain. I often get asked, "what is a lot of complexity?". I'm going to provide an example by uncovering more and more complexity within a domain. And give a few different insights that should help you make the decision.

🔗 EventStoreDB

💥 Join this channel to get access to private Discord!

🔥 Don't have the JOIN button? Support me on Patreon and get the same access!

0:00 Intro
1:07 Little Complexity
2:34 Add More Complexity
6:22 Insights

#domaindrivendesign #softwarearchitecture #softwaredesign
Рекомендации по теме
Комментарии
Автор

Do you struggle with figuring out if you have "a lot" of complexity? Does everything seem like it should fit in CRUD?

CodeOpinion
Автор

Love your videos, just a little tip, on mobile the red line at the bottom implies that I’ve already viewed the video. I almost skipped past the video because of it.

jpsytaccount
Автор

Great video! Loved that you also talked about what “complexity” could look like.
Here’s another take on DDD vs. CRUD: DDD sets you up for applying the things you learn on top of the code you already wrote. CRUD sets you up for redoing the stuff you wrote after you learn things. People that use CRUD generally underestimate the complexity, and have a hard time throwing away their code (and simple mental model).
It remains an issue to explain why you could go super fast delivering features in the beginning and you can’t anymore in CRUD. At least in DDD you build with more clear assumptions, and with a more predictable albeit slower pace.

TimSchraepen
Автор

I’ve come across solutions where they’ve tried to use DDD and micro services etc, when all there is is a data pipeline that should take data from sources x, y and a and then just put it somewhere for lookup. That to me is definitely adding complexity where it is not needed.

TomasJansson
Автор

I only consider CRUD applications to literally be frontends for a database table without any rules. As soon as there are rules, basically starting with one if put in there somewhere, I create a domain model. It gives me so much peace of mind, freedom of change, clear boundaries and supreme testability.

florianfanderl
Автор

IMO the whole CRUD vs "domain model" comes mostly from the tension of developers abandoning classic OO design to write procedural / imperative code on top of an OO language - which tends to be the norm these days -. Proper encapsulation and abstractions seem to have been turned into some kind of trade-off, only to be embraced at some specific scenarios. Then, what's the point of using OOP langs for all these projects?

jorgeolive
Автор

Great video as always, but no matter how "not complex" the domain is, if CRUD is done poorly it will have adverse effects like some aspects of the domain leaking into the user interface or even stored procedures inside the DBMS itself.

salmanmohammed
Автор

I would love to see a more detailed outline of domain model vs transaction scripts.

Are those necessarily mutually exclusive? Can't I use richer models from mediator handlers?

lost-prototype
Автор

DDD sounds like you need to use an iterative process to work with it. The domain expert isn't going to be available 24/7 and complexity in larger projects can evolve quickly. Are there any start to finish real world examples that are publicly available?

gimmedatcake
Автор

What are your feelings on a hybrid model whereby some of the logic can be crud and other logic is more crud based? Separate service/boundary?

brandonlange
Автор

As I watched you add extra complexity to your use cases, I started to wonder whether adopting a pattern like CQRS/ES actually makes the modeling simpler and open to the gradual introduction of those more complex workflows vs a third normal form/CRUD style of modeling especially in terms of migrating/evolving the object models and persistence. I'm not well versed enough in CQRS/ES to feel confident in my answer, but I tend to think that it might be the case. What do you think?

jriggatx
Автор

Could an indication of complexity be whether or not the business rules are modeled by conceptual abstractions that do not or would not have a corresponding database table/collection?

Consider your logistics example: any given truck could be viewed as a graph, any given pickup or dropoff event as a vertex, and any given shipment a path across the graph (with legs corresponding to edges). It seems like graph algorithms would be very useful, but a graph itself requires at least two tables and neither of them is useful in the context of graph theory without the other. Does my question make sense in this light?

As usual, tyanks for another great video. And as usual, the topic is immediately relevant to what I'm trying to figure out 😂

drewjaqua
Автор

😎 👍 awesome. Where did you learn to model logistics so well? Any resources? I would really appreciate it

armenchik_dzhan
Автор

crud its about create read update delete, ddd has too, its better say vs mvc or something architectural

filipemazzon
Автор

I see, we can choose between crud model or domain model based on complexity. but what are crud model and domain model? 🤔

photon
Автор

Cool comments here, we have primitive type obsession at work, another reason for ddd. Write some value objects guys.

neilsg