How to design great Aggregate Roots in Domain-Driven Design

  Рет қаралды 8,122

Milan Jovanović

Milan Jovanović

Күн бұрын

☄️ Master the Modular Monolith Architecture: bit.ly/3SXlzSt
📌 Accelerate your Clean Architecture skills: bit.ly/3PupkOJ
🚀 Support me on Patreon to access the source code: / milanjovanovic
In this video, I'll do a deep dive into the theory behind Aggregates. I'm going to explain how to design an aggregate root and implement it in your .NET applications. The aggregate root pattern from Domain-Driven Design can help you create a better domain model. An aggregate acts as a consistency boundary and encapsulates one or more entities. Designing a good aggregate takes a lot of skill and practice.
Join my weekly .NET newsletter:
www.milanjovanovic.tech
Read my Blog here:
www.milanjovanovic.tech/blog
Chapters
0:00 What is an Aggregate?
1:05 Why do we need Aggregates?
2:15 What is an Aggregate (continued)
5:42 Aggregate design best practices
7:30 Let's look at an Aggregate example

Пікірлер: 24
@MilanJovanovicTech
@MilanJovanovicTech 12 күн бұрын
📌 Accelerate your Clean Architecture skills: bit.ly/3PupkOJ
@vantavoids
@vantavoids 12 күн бұрын
honestly the fact that i was struggling all day with my aggregate roots and you happen to release a video talking about those specially... did you hide a mic under my desk?? other than that top tier video as per usual please keep it up
@MilanJovanovicTech
@MilanJovanovicTech 12 күн бұрын
Glad it was helpful, and no worries I don't have a mic anywhere (or do I?)
@sergiom.954
@sergiom.954 12 күн бұрын
The value of your content is unique. Thanks Milan
@MilanJovanovicTech
@MilanJovanovicTech 11 күн бұрын
No, thank you! :)
@wannadie9950
@wannadie9950 12 күн бұрын
awesome job milan, love you
@MilanJovanovicTech
@MilanJovanovicTech 12 күн бұрын
Thanks a lot! :)
@davidjiang7929
@davidjiang7929 6 күн бұрын
Would you happen to have more examples on the unit of work and how to save aggregate to database?
@MilanJovanovicTech
@MilanJovanovicTech 6 күн бұрын
Well, I've got a bunch of videos on the channel covering DDD aggregates directly or indirectly
@victorgarcia3526
@victorgarcia3526 11 күн бұрын
Hey Milan, what if you push your code examples to github so we can check the code while watching the video?
@MilanJovanovicTech
@MilanJovanovicTech 11 күн бұрын
I share the code on Patreon
@user-ev9jg6ts6e
@user-ev9jg6ts6e 12 күн бұрын
Hi Milan. Nice video, appreciate it. Though not so good example on Workout aggregate, not showing any invariant between Workout and Exercises. Aggregate is about behavior and invariants and not about data.
@MilanJovanovicTech
@MilanJovanovicTech 12 күн бұрын
Wanted to focus on maintaining a consistency boundary
@alexramossilva
@alexramossilva 11 күн бұрын
Can you talk about Business Rule Engines and what are the design patterns appropriate to implement it?
@MilanJovanovicTech
@MilanJovanovicTech 11 күн бұрын
Not familiar with them
@ratanapouy
@ratanapouy 12 күн бұрын
Do you have this full course?
@MilanJovanovicTech
@MilanJovanovicTech 12 күн бұрын
Not really (yet)
@baranacikgoz
@baranacikgoz 12 күн бұрын
The change you've done to the RemoveExercise method could not be left like that. You did not specified which Include's is used inside GetById method for Workout. If you decide to do that, it is wiser to conditionally include exercises of workouts by specifying exerciseId. Otherwise if there are millions of exercises you are loading all into memory just to remove one.
@MilanJovanovicTech
@MilanJovanovicTech 12 күн бұрын
If there are a large number of exercises, we would implement this differently... But we could also impose a business constraint that a workout can have at most 30 exercises.
@euler.chavez
@euler.chavez 12 күн бұрын
@@MilanJovanovicTech What is this process like, or what would it be like? The "basic" examples are easy to understand, but the complex cases and their variations are rarely explained. For example, in a context where the Family is the aggregate, with entities such as Members and Addresses: a) If I need to obtain only the members, do I always have to access the aggregate? b) If I want to filter address based on type (house, work, business, etc), do I have to do it through the aggregate?
@ChristofferLund
@ChristofferLund 12 күн бұрын
@@MilanJovanovicTech If you could provide an example of how you could elegantly solve this if the related entity has too many to load all into memory that would be nice. I find that to be one of the bigger challenges when using aggregates. Even just having a list of IDs could be too much at one point i presume
Creating a State Machine Saga With MassTransit (Orchestrated Saga)
15:41
5 Design Patterns That Are ACTUALLY Used By Developers
9:27
Alex Hyett
Рет қаралды 173 М.
Black Magic 🪄 by Petkit Pura Max #cat #cats
00:38
Sonyakisa8 TT
Рет қаралды 25 МЛН
Miracle Doctor Saves Blind Girl ❤️
00:59
Alan Chikin Chow
Рет қаралды 48 МЛН
MOM TURNED THE NOODLES PINK😱
00:31
JULI_PROETO
Рет қаралды 15 МЛН
How To Design Amazing REST APIs
18:57
Amichai Mantinband
Рет қаралды 9 М.
Data isolation for Modular Monoliths - DB Schemas, EF Core
16:02
Milan Jovanović
Рет қаралды 6 М.
How to Use the Domain Event Pattern | DDD, Clean Architecture, .NET 6
9:48
5 Rules For DTOs
17:56
Ardalis
Рет қаралды 36 М.
8 Design Patterns EVERY Developer Should Know
9:47
NeetCode
Рет қаралды 996 М.
CQRS Doesn't Have To Be Complicated | Clean Architecture, .NET 6
24:09
Milan Jovanović
Рет қаралды 99 М.
Power up all cell phones.
0:17
JL FUNNY SHORTS
Рет қаралды 49 МЛН
What model of phone do you have?
0:16
Hassyl Joon
Рет қаралды 57 М.
cool watercooled mobile phone radiator #tech #cooler #ytfeed
0:14
Stark Edition
Рет қаралды 7 МЛН
#miniphone
0:18
Miniphone
Рет қаралды 11 МЛН