This Is How Domain-Driven Design Makes Object-Oriented Design More Powerful

  Рет қаралды 10,929

Zoran Horvat

Zoran Horvat

Күн бұрын

Пікірлер: 31
@stjepankarin
@stjepankarin 6 ай бұрын
This is probably the best video summarizing all important aspects of DDD and its relation to OOP, CQRS and (eventual) consistency. Balancing all of these is hard, unique to every application and use case, as there are pros and cons in which ever path you choose, and this video also mentions few words on that as well. Thanks for this awesome content!⭐
@zoran-horvat
@zoran-horvat 6 ай бұрын
Thanks!
@ShahidMogul
@ShahidMogul 6 ай бұрын
Love Zoran's unique style of story telling.
@user-iv9nj9nx8q
@user-iv9nj9nx8q 10 күн бұрын
What a time to be alive!
@F2H16
@F2H16 3 ай бұрын
Amazing! You are an articulate person, it would be nice to get a DDD course (An affordable one) from you. It would have covered your programming mastery and eloquence to deliver the goods.
@viktorasmickunas2527
@viktorasmickunas2527 6 ай бұрын
Very, very useful and interesting video and at just the right amount level of detail. Captures the gist of DDD perfectly! Thank you.
@majormartintibor
@majormartintibor 6 ай бұрын
Masterpiece of a video!
@benqbenq
@benqbenq 6 ай бұрын
3:08 when you see it
@rorycawley
@rorycawley 6 ай бұрын
Truely masterful work, thank you
@davidpccode
@davidpccode 6 ай бұрын
Wowwwww wowww wowwwwww what the **** you my friend are the best of the best .thank you
@ThugLifeModafocah
@ThugLifeModafocah 6 ай бұрын
This was a good one. Thank you.
@user-nw8oi9vn9y
@user-nw8oi9vn9y 6 ай бұрын
DDD doesn't define the concept of a "transaction" very well which makes the rule of "one transaction operating on one aggregate" confusing. For example, if one aggregate does an operation on a database and then that aggregate calls the root of another aggregate which then also does an operation on a database, is that one or two transactions? Or also, if some service (say for example in the application layer or in the domain layer - it doesn't matter) calls a repository in the unit of work and then based on the result later calls a different repository in a different persistence layer which operates on a different aggregate, did we just witness one transaction operating on two aggregates (thus breaking the rule) or did we have an acceptable one transaction per aggregate situation because one repository call operated on one aggregate (as the first transaction) and the other repository call operated on a second aggregate (as the second transaction)? I once had a manager who believed that any front-end app call to a Web API endpoint qualified as one transaction, and so therefore you were only allowed to make one atomic unit of work per controller endpoint. The debate became heated and . . . let's just say I don't work there anymore, LOL. But the DDD concept of a transaction is usually not well explained in the sources I've studied so far. I hope there is somewhere that explains these rules more clearly.
@zoran-horvat
@zoran-horvat 6 ай бұрын
DDD defines that the single instance of a single aggregate is updated atomically. That definition is aligned with what most document databases promise, i.e. they guarantee writing a single document atomically and usually nothing more.
@PieJee1
@PieJee1 9 күн бұрын
I'd love to hear your opinion if MVC complicates DDD if used together. To me the reason anemic domain objects exist is because MVC is in the DNA of a a web developer and if you would apply the DDD concepts the problem is keeping the ubiquitous language in the domain objects. I loved for example the concept of the Symfony API Platform when it was released where you just define entities and let it create the API yourself, but now a few years later I do not like the path it took; it is unusable if you don't build everything as anemic domain objects. I'm now working on my own implementation of naked and restful objects and even though it's still in early developments, many DDD concepts fit much nicer!
@abj136
@abj136 6 ай бұрын
I learned a long time ago about OO Design, but Entity, Service, Bounded Context, CQRS are outside my parlance.
@zoran-horvat
@zoran-horvat 6 ай бұрын
Those are very useful in complex systems design. I warmly suggest you read the DDD book by Eric Evans.
@user-nw8oi9vn9y
@user-nw8oi9vn9y 6 ай бұрын
Eric Evans' book is great, but everywhere I've worked treat developers like code-zombies who are not allowed to talk to the stake-holders and the real domain experts whereas Evans' book rightly and correctly says not to treat us like dumb coders. What usually happens in the real world is that the stake-holders give explanations to some business analyst who explains it to a software manager who then gives us instructions which we are supposed to blindly execute. The problem is that the instructions can be interpreted in many ways and often times, asking questions leads to more confusion. What ends up happening is that the BA has one concept of the domain, the project analyst thinks of it differently, the QA has a different interpretation and says there is a defect where the developer saw it as correct, and the manager is angry that the task goes over the sprint time and says it must be because you're a slow developer (ignoring the details of what happened). Then you have to address that defect while working on the next sprint. Eric Evan's DDD (like the agile methodology) has been made rigid, regimented, conquered by upper management who want use it to incorrectly measure progress and velocity, and dogmatic. We're not allowed to talk to the stake holders, we get ambiguous instructions, there's no document clearly explaining the model, there is no reference to a ubiquitous language, etc. No, there's just domain objects, aggregates, etc. that are found only in code. DDD and Agile were great ideas but no one does them correctly and they've been made mechanical like developers are just parts of a code assembly line machinery. @@zoran-horvat
@zoran-horvat
@zoran-horvat 6 ай бұрын
@@user-nw8oi9vn9y I am very well aware of the things you have explained here. The business analyst idea, along with rate releases and feedback organized around bug reports is the old way of doing things, ridden with issues.
@_IGORzysko
@_IGORzysko 6 ай бұрын
Hi Zoran, great video! What in your opinion is the better way of doing: (1) entity create methods defined within entity classes OR (2) entities without any create methods, just with particular constructors. In my opinion there is no much danger with constructors as far as properties of entity class are properly defined, with great awareness - do you notice any red flags here? 🤔
@zoran-horvat
@zoran-horvat 6 ай бұрын
That is pretty much the same thing in my opinion. The only meaningful difference is that factory methods are - methods, and as such they are assignable to delegates. You cannot assign a constructor to a delegate because it is not a method.
@_IGORzysko
@_IGORzysko 6 ай бұрын
@@zoran-horvat Thanks!
@aanders0n
@aanders0n 6 ай бұрын
Thanks for this one! Will you release a new OOP course on Udemy that is being recorded right now, if so will be any different from the current one?
@zoran-horvat
@zoran-horvat 6 ай бұрын
The new course I am working on is the continuation of the Beginning OOP with C#. It will convert the most important design and coding principles when using C# to design a domain model, structures, and algorithms.
@manya.korolevskaya
@manya.korolevskaya 6 ай бұрын
Hi Zoran! Do you use anything except MediatR for domain events publishing/subscribing?
@zoran-horvat
@zoran-horvat 6 ай бұрын
Actually, no. MediatR is a good choice.
@GC-qe8vc
@GC-qe8vc 12 күн бұрын
On this point, you should watch David Comartin's videos on the outbox pattern. We implement it with MassTransit. It is absolutely necessary for Integration Events (i.e. the ones that cross bounded contexts) and... mostly necessary for Domain Events (i.e. within the same bounded context). I say "mostly" because you may have (rare) cases where you don't need guaranteed delivery of a Domain Event, although I would suggest using the outbox pattern by default even within your bounded context.
@pyce.
@pyce. 6 ай бұрын
What is the best attempt to reduce complexity?
@zoran-horvat
@zoran-horvat 6 ай бұрын
That depends on the problem you are solving but also on what you consider important in that problem. There is no single design strategy that solves all problems.
@nickbarton3191
@nickbarton3191 6 ай бұрын
One way to update, as the aggregate; bolt of lightning just struck me.
@zoran-horvat
@zoran-horvat 6 ай бұрын
That was my reaction, too, when I first learned about that idea from the DDD book. My whole life passed before my eyes as I saw innumerable occasions where I had an explosion in the number of ways to materialize models from the database only because there were many ways to mutate them. Now, with the aggregates idea, we sustain a certain drop in performance by always materializing the entire aggregate, even in operations that only affect a small portion of it. But then a dozen carefully crafted sets of methods that used to mutate the state in the database suddenly become only one method! The simplifying effect on code is so dramatic that I never looked back after I learned this technique.
@franciscorusso8062
@franciscorusso8062 6 ай бұрын
I feel so related with this description. Once I started to use Aggregates, even as you mentions to change a small portion, everything became so clear and smooth
Have You Ever Signaled async/await Progress in These Three Ways?
7:37
Чёрная ДЫРА 🕳️ | WICSUR #shorts
00:49
Бискас
Рет қаралды 6 МЛН
Or is Harriet Quinn good? #cosplay#joker #Harriet Quinn
00:20
佐助与鸣人
Рет қаралды 14 МЛН
Get 10 Mega Boxes OR 60 Starr Drops!!
01:39
Brawl Stars
Рет қаралды 19 МЛН
娜美这是在浪费食物 #路飞#海贼王
00:20
路飞与唐舞桐
Рет қаралды 6 МЛН
Avoid This Common Mistake in DDD Modeling
10:17
Zoran Horvat
Рет қаралды 9 М.
Liskov: The Liskov Substitution Principle
4:23
Turing Awardee Clips
Рет қаралды 21 М.
The Lesson About GUID IDs I Learned the Hard Way
15:43
Zoran Horvat
Рет қаралды 29 М.
Why is C# Evolving This Way?
15:02
Zoran Horvat
Рет қаралды 21 М.
Let C# Tuples Become Your Best Friends
11:51
Zoran Horvat
Рет қаралды 10 М.
3 Shocking Misconceptions Among C# Programmers
9:25
Zoran Horvat
Рет қаралды 14 М.
Master the Power of Composite Pattern in Rich Domain Modeling
14:07
Wish To Remove Primitive Obsession? Try This Effective Technique!
15:28
Самый дорогой телефон 2000х
0:54
МАДНЕСС
Рет қаралды 2,6 МЛН
Опасность фирменной зарядки Apple
0:57
SuperCrastan
Рет қаралды 13 МЛН
zamzam electronic Samsung S24 Ultra power🔥
0:14
Reversal gamer
Рет қаралды 15 МЛН
ПС 110/10. Кто то подключил "левак" 110000 вольт!?
0:34
Советы электрика
Рет қаралды 1,4 МЛН