3 Steps for Modeling a Complex Domain | CLEAN ARCHITECTURE & DDD From Scratch Tutorial | Part 11

preview_player
Показать описание
In Today's video, we'll see how we can take many entities with many relationships between them and split them into aggregates following DDD tactical design principles.

Follow me on 'em socials:

#dotnet #csharp

00:00. Relationships Between Entities
04:00. The Modeling Game
15:07. Model to Markdown Conversion
Рекомендации по теме
Комментарии
Автор

To recap:
1. Identify Entities and treat each entity as an aggregate root
2. Identify relationships between the entities
3. Merge aggregates if there are constraints

Possible constraints:
1. Enforcing Invariants
2. Eventual consistency cannot be tolerated

Good indicators that an entity should be an aggregate root:
1. It is referenced by other aggregates
2. It will be looked up by Id

Curious to hear what you think!

amantinband
Автор

I'm obsessed with you...but not in a creepy way 😁 You have a way of simplifying things without dumbing them down. That's a tough thing to do. I am waiting with baited breath for more in this series. PURE GOLD!!

kevlingo
Автор

This playlist is the best content about DDD available on Youtube!!!! Thank you!

leuras-dev
Автор

I’ve read “implementing domain driven design” book but always feel lost in some part, this series clear things up tremendously!

Thank you sir 💯

alvin
Автор

Wow! Amazing presentation - it looks sooo simple! Thank you!!!

ilyha
Автор

This is one of the best videos I’ve found explaining how to model the domain. I’m a complete beginner in DDD so this step by step guide helps a lot! Thank you so much!

I still have one question left though. I understand your decision to make the reservation be part of the dinner. Doesn’t it become a performance bottleneck at some point? How would you handle something like a concert where you wouldn’t like to sell more tickets than you have.
So the tickets would be part of the Concert aggregate but wouldn’t it be unreasonable to load like 50k rows just to check not that it won’t be overbooked after adding another purchase?
Would you use lazy loading and a counter in this scenario?

maexoman
Автор

Another fantastic video! Keep up the great work!

kmcdo
Автор

Great video as usual, I'm loving this series

carmineos
Автор

I have a question to the relashionships.

Example with Menu and Dinner:
In the Menu, you are referencing a collection of DinnerIds.
In the Dinner, you are referencing the MenuId.

What, if you add a Dinner and forget to add the DinnerId to the referenced Menu? Where is the correct relationship stored? In the DinnerId-Collection in the Menu or in the MenuId-Field in the Dinner?

I think, a clean way is to store the parent menuId in the Dinner. The collection in the Menu should not be used.

If you want to get all Dinners related to a Menu, you can filter the Dinner-Aggregates by MenuId. The single point of truth. If you also can ask the Menu-Aggregate for the result, you can possibly get another result.

How should the relashionships be handled in a clean and correct way?

frankoppermann
Автор

Thanks for using dark mode for the visualizations!

spottedmahn
Автор

Buddy... I will suggest google to allow a ton of likes from each person only for your videos ;) Loved it!

srinivaspitani
Автор

Another fantastic video. I think designing aggregates is really the essence of DDD.

davemasters
Автор

Best video regarding this, you're a goat

codingsavid
Автор

Thanks a lots, you are opening our eyes. Please do something on ubiquitous language (UL). How we can create one and use it to tie analysis model to code model. It would be a big boost for me. Shis you just opened me eyes. Thanks a lot.

amanamudoaka
Автор

impressão minha ou você iniciou a modelagem justamente da forma que o livro azul nao indica?

felipeklafke
Автор

Hey, I wanna thank you for this series, it helped me alot.
But forgive me for my long question because I am really confused:
🔷is the Host id and Guest id are really needed in the User aggregate ??
🔷how should I implement the authorization and authentication if so, should i add the password, email... properties to the user aggregate??..
🔷Since the Host and the Guest have different bussiness rules, how should i implement this? should it be implemented in the Domain services (the Application layer) or in the Domain layer where i can add some rules to the aggregate itself?
🔷can one aggregate inherit from another one? like the Host inherting from the user aggregate?

samirahmad
Автор

So, one thing I have sort of understood from my early diving into DDD is that an Entity is meaningless without context. So, customer means something completely different in the Sales context vs the Finance context.

So, maybe I'm confused when you say the dinner will be a value object in some other aggregate, but then on your model diagram, you list it is DinnerId... which sounds like a reference. I thought a value object had no idea, it was differentiated by it's values, not by it's id.

Perhaps when you get into code this will make more sense, but it's not clicking for me right now.

pilotboba
Автор

keren, sehat selalu bang, ditunggu share cara instal aplikasi macbook yang lain

SenthilKumar-ljcw
Автор

I'm wondering why the menu item (in sections) isn't its own entity and is also just referenced with the id like dinner is.

smliwhcirdeirf
Автор

That's a really great content, thanks for sharing it. How would you go about documenting about side-effects happening in an aggreate (domain events)?