@growgrowgrower

This is great, I definitely dug myself into that hole when I started off and wished that I had this as a resource back then.

@appstratum9747

Great introductory video to this aspect of DDD. Primarily because it's thought provoking and this is an important topic that needs thoughts provoked!😀

This is the kind of video that fosters the sharing of wisdom rather than merely knowledge. And for that you deserve a lot of credit. This sort of material will be invaluable to so many careers and will really raise the bar for so many once they grasp what you're sharing with them.

Having said that, we're just scratching the surface here and I think this video needs (and deserves!) a follow-up of similar length using the same example but to a slightly greater depth (yet still introductory... linking on to other videos you've made related to this). Or episodes 2 (commands) and 3 (queries) of a three-parter with similar linking into related material. I think would help a lot of people start to get over this significant mental hurdle and start to get to grips with seeing the "Big Picture" of this important aspect of DDD.

I know you've covered all of this elsewhere in some form, but perhaps not coming at it from quite this angle of hierarchy & relationships. Or at least not with quite the same sharp focus on this topic from this perspective that you've achieved here. 

Great video, though - as usual. 🙂 And many thanks for posting this. Good work, fella!

@johannesgupta

Thanks, I've been wondering about this for years, finally you made it clear to me why an aggregate should only be used for state change and not for queries.

@alans9117

Thank you Derek! Brought me a more clarity and simplicity - considering command vs query. Great content.

@MrDomenic123

Another piece of gold, thanks a lot for this great content, Derek! I got one question though (not directly related to your video): 
Let's say you have two services (Service A and Service B). Both services are in their corresponding boundaries. Both services are aware of the same aggregate (e.g. Order) but with different attributes/properties. However, both services need the same property from the client to perform some type of calculation. Let's call that property "P".  Each service needs the property P to calculate other values that are used for validation, let's call the calculated value C.  So, the property P is just used to calculate C. Now, what if both services (Service A and Service B) have to perform the exact same calculation to resolve the property P to the calculated value C? 
 Is it better to have a dedicated service (e,g, Service C) that calculates the value of the property C for each aggregate, and publishes that via an event, or should the calculation logic be "duplicated" among both services in the first place (Service A and Service B)?

@amitev

7:32 Does this mean that we should work with the aggregate when we are executing commands and rather serve just the needed data in the queries without reconstructing the entire aggregate from the database?

@GilbertoMadeira83

Hi Derek, your videos are the best!

@ismailbayram_ce

thank you for the content. 
A classic aggregate example: Order in an e-commerce system, which includes basket, basket items with its prices and so on. But I didn't a comprehensive example project written in golang. Most of all contains basic structure

@thomasjardanedeoliveirabou9993

I don't get how you keep consistency between the location an vending machine, how do you enforce that each location can only have one vending machine with this method? Or for example, if I already have an registered vending machine that I want to place it in a location, how do I enforce that invariant across boundaries?

@romanlunin386

Thanks for the video! Top notch content, as usual.

@ZadakLeader

Sup Derek, like i mentioned in the last video, you might want to invest in a DSLR because the video looks blurry :)

Good content!

@yonatandaniyel5640

Good explanation about CQRS here.

@AndersBaumann

I agree on the idea of the video but publishing an event to make a change in another aggregate is adding complexity instead of removing it. This kind of hidden side effect will make the codebase difficult to understand, test and maintain. To me it is a misunderstanding of what domain events are for: To notify the outside world (outside the bounded context) of state changes.

@quilhon7644

This is really a more resanble way to design the software.

@tantruongthe-z7o

So, if an entity (that is mapping to a table) can be an aggregate by adding bussiness logic inside its class (rich model), then perform CRUD with that class to persist into DB ? 

The AggregateRoot, because of it empty, is only use for marking that some classes is an aggregate root ?

When you say fetch aggregate with related entities, you changed the repository codes, why ? We still can use Include() method for the same purpose.


I have a small design, see below:

A class named User (Id, Name, List<Skill> SkillList, List<Product> ProdList ), Skill class (Id, SkillName), Product (Id, ProdName).

When i create an user, it will also add all products belong to current user, i am tending to create an aggregate named UserCreateAggregate that only has 2 required props (User user // root, List<Product> ProdList) with a void CreateMethod() 
{
 user = new(); 
 user.prodList = Prodlist;
 }.

I am stucking right here, i don't know how to persist to DB, i have 2 ways, feel free to express your opinion:
   1. Pass UserRepo to Aggregate then saveChanges(), this way worked but it looks stupid :)
   2. Return current user (use prop that is declared earlier) to service class then userRepo saves it to DB. (this seems more appropriate).

Additional info, i am using EF Core with UOW and repository (For each entity).

@botyironcastle

what if you have huge data like 100000000comments in Post object. I don't think you can init a domain object with that much... looks useless to me when dealing with large chuncks of data. Thoughts?

@KasperHelwegJonassen

Thanks for the video! Good stuff as always. Did you by any chance read the "Kill The Aggregate" blog series by Sara Pellegrini? A video with your take on that would be awesome!

@roeiohayon4501

Lets say i am trying to model the problem of doing some business operations on historical stock data, so a stock is basically a symbol (for example AMZN), and a time series that represents the data of that stock. Often we want to query and do operations on the stock data based on symbols, so ultimately my question is, should symbol also be an aggregate root, alongside with stock? If not, should i still have two separate repositories? If so, should I create a repository that encapsulates both of them? How would you go about handling this situation of nested aggregate?

@ghevisartor6005

ok noob question time, i'm trying to watch this and other of your videos to see if i can put together all the pieces. It seems to me that Aggregates are basically modelling business processes.
If i have an ecommerce and i give the user a settings page to add products definitions to the catalog, aggregates are not really needed. Sure there is a "dummy" business rule that the price cannot be below zero, but it's a simple validation on a crud operation.
When instead users place an order, a whole process is spawned and we need to make sure it will go trough respecting the invariances, aka the real business rules, in which case an order places cannot be have a total below zero but it's a different story then doing crud validation like before, we have to check the quantities etc etc.

But then i see the Amichai example you reviewed in another video and i fail to see where aggregates can be usefull, where the business processes are. The user make a reservation for a dinner and that's it? now the next user might not be able to make the same reservation and he will need to choose another date, but it's not like we have to send notifications to the kitchen or other deparments to get ready for the dinner. Sorry i'm might getting confused here.

@flobuilds

How do aggregates work in a scenario where you have one entity which has many different lists of other sub entities and these may also have lists. So in highly nested entities. Could you set the aggregatr root on different entities that may be nested but need different domain events or something like that?