Aggregate Design: Using Invariants as a Guide

preview_player
Показать описание
How do you compose an aggregate? For me aggregate design involves understanding the invariants. Invariants are business rules that must always be consistent.

💥 Join this channel to get access to source code & demos!

🔥 Don't have the JOIN button? Support me on Patreon!

0:00 Intro
1:32 Aggregates
2:11 Invariants
3:33 Code Example
7:38 Recommendations

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

"Don't expose domain objects that can't enforce the business rules". That closing sentence was brilliant. Thanks for the vids

skipodap
Автор

Been using DDD for over 10 years, popped in for a new take and although this confirmed what I knew, I just applaud and say it was explained brilliantly!

RobLang
Автор

I rarely ever comment on YouTube videos, but this is well deserved.

You're concise and straight to the point, fantastic content. I struggled to find video resources on DDD and resorted to books, I wish this content was here when I first started learning. Please keep doing what you're doing!

technicaltorch
Автор

Really like the concrete examples. It's really hard to imagine a technical implementation of different concepts that I've never seen before in my life. Thanks for taking the time to make these videos. They are super helpful!

xbmcme
Автор

Since watching your videos my code quality has improved 10-fold and performs 10x better, not an exaggeration. Keep it up, loving the videos!

secondry
Автор

I'm crying of joy!!! Amazing channel. What I was looking for to grasp ddd more!

kozer
Автор

Very good explanation. For me, the harder problem is how to find aggregate roots and their boundaries in a real-world project, it would be a very helpful video if you could make it for us.

hesamkashefi
Автор

Your video's are fantastic. I keep coming back and they make me a much better developer. Thanks so much. You deserve more views!

ToeShimmel
Автор

Excellent presentation. Walked away with a much clearer understanding of Aggregates.

NomadicBrian
Автор

Hi Dereck i am new to ddd but i have question on the video. Since u are passing a collection of stops to the constructer of the shipment aggregate, it means clients other than the shipment aggregate can call both the arrive and isComplete methods thereby resulting in inconsistent state, by passing the rules defined in the shipment aggregate? Does this means a refinement of what is needed to enforce the invariant is needed? Pls answer on this. Also one general rule is that entities inside an aggregate can only be reference by other aggregate by holding a transient copy of these entities. I think passing a collection of stops as shown in the videos violate this general rule. however domain services can be used to defined previousStopAreNotDeparted and used as client in stop which should be treated as aggregate. If this approach is corrected should we have two distinct aggreagete for PickupStop and DeliveryStop. Again i am a novice to ddd so please advice. Thank u.

williamsbotchway
Автор

Ok, this one I had to watch three times, but I really enjoyed it in the end.
This was a well picked example, the implementation is pretty nifty and smart and some good points were made.
I did not care for what I supose is ddd lingo, but I gues that is on me to learn.
Thanks for taking the time.

victortodoran
Автор

That's clearly explained! Wish I have learnt this earlier.

michaelwong
Автор

Inside the stop class. We have sequence as primitive. Should we create it as a value type? From what I have seen DDD says we should not have primitives

vakul_k
Автор

These videos are where you go when you fight the final boss of EDD. So good but so technical.

JohnnysaidWhat
Автор

I wish my code was that clean and readable

Eugene.g
Автор

Hi Derek, i use ef core for my database and in one service class i should update two entities in the same transaction, for the ofher entity i already have the independent service that could the operation that i would need but it must be done in the same transaction, should i implement the unit of work pattern or is ok to use directly the dbcontext even for an operation that is already implemented separately?

I hope it is clear.
Thanks in advance.

alfonsdeda
Автор

@CodeOpinion why you didn't use state machine ?

snowglider
Автор

Spotting boundaries is a complicated stuff, and DDD in general which leads to domain experts/analists comitmment.But what should we do if business people are not too cooperant?Thanks

thedacian
Автор

As far as I understood, if I have a 'manager' class which has a couple of methods such as 'Run()' something or 'Stop()' something is an aggregate class, isn't it?

ivanmiroshnichenko
Автор

Great video! A quick question...

Do you ever create extension methods on generic collection types of your domain models to represent certain filters or operations?

lost-prototype