The One Question To Haunt Everyone: What is a DDD Aggregate? - Thomas Ploch - DDD Europe 2022

preview_player
Показать описание
Domain-Driven Design Europe 2022

There is one question that I am getting asked at almost every conference or meetup: What is and what isn't an Aggregate? How do we design an Aggregate? To be honest, it's not an easy answer, even for experienced practitioners.

In this session I am summarizing the current state of affairs regarding Aggregate design in the Domain-Driven Design community.

I am Thomas, and I design systems for people and computers for fun and profit!

My career has navigated me through various industries like Finance & Insurance, Medical, Automotive and Travel. I have been wearing many differently shaped hats over the last 15 years. From System Administration, Test Automation, Web Development, Software Architecture & Design, Product Design & Organisation Design, I can draw on a bit of experience that currently helps me every day as a Principal Solutions Architect FlixBus.

The biggest realization over the last few years is that the most important component of success is not running the latest distributed architecture in the cloud, but to enable people to work smart to manifest their ideas in helpful products. I want to share my experiences and hope that you can take away a bit of knowledge that can help you later.

It is impossible to design useful software without understanding the underlying forces driven by market conditions, competitors, business strategy and the actual people using or building the software. Hence, I firmly believe that a wider definition of system design is required to achieve an adaptive and evolvable environment of people, processes and technology that can react to changing conditions in our fast paced digital world.
Рекомендации по теме
Комментарии
Автор

Best overview of aggregates and the reasoning behind it so far for me.

DevOpsCraftsman
Автор

It's encapsulation (a Facade (AR) provides an interface to effect aggregate behaviors) & cohesion (the aggregate being a group of closely related coevolving objects) - it's just that it's applied beyond the level of a single object.

filipmilovanovic
Автор

IMO, a fundamental flaw that involves the DDD aggregate concept is that persistence concerns leak into their design - eg: race conditions because big object graphs, load to the database due to lots of entities, etc. This might lead to designs dictated because of your infrastructure components, not your domain.

jorgeolive
Автор

Great talk Thomas! Thanks DDD Europe for sharing!

toinbis
Автор

the quote may come from Vaughn Vernon paper "Effective Aggregate Design". I quote the paper : "Therefore, it is just plain smart to limit aggregate size. When you occasionally encounter a true consistency rule, then add another few entities, or possibly a collection, as necessary, but continue to push yourself to keep the overall size as small as possible"

matthieujacquot
Автор

What an excellent talk, thank you very much for putting it out!

Felipe-
Автор

My opinion based on months of exploration trying to understand this topic. No offense intended...

Q: "What does this picture represent? Why does it take 3 months to implement a small little change?"

A: Tight coupling and low cohesion caused by incorrect boundaries.

Suggesting that Aggregates, in and of themselves, can stop a system from spinning out of control is highly questionable. The boundaries need to be correct or coupling will take over. Everything will start breaking with even the most simple change, regardless of any Aggregate implementation.

Of course, Aggregates, just like any other software construct, are "artificial" and "invented", but the proper boundaries most certainly are not. I really think that this is a misinterpretation of the blue book. Evans effectively said the opposite, "Forcing the required domain functionality to be the responsibility of an ENTITY or VALUE either distorts the definition of model-based object or adds meaningless artificial objects".

Even in the cutlery metaphor, this becomes evident. Sure, cutlery is used together. So, keeping it in the same drawer (Aggregate) seems reasonable. However, the number of tines on a fork has absolutely nothing to do with knives or spoons. We have now coupled completely separate concerns and planted the seed for future disaster.

Q: Why should Aggregates "be as small as possible" ?

A: Because Vaughn Vernon said so!

Q: OK, maybe, but why did he say that?

Aggregates should be as small as possible because the immediate transactional consistency boundaries that they protect are relatively small by their very nature.

"Finding correct service boundaries is really, really hard." - Udi Dahan paraphrase circa 21st century earth, local time.

vincentcifello
Автор

Insightful Talk on just what Aggregates are, a Deep, Revealing Dive. Thank you so much.

charlesopuoro
Автор

if these things have to be explained the ddd book cant be so good

joachimdietl
Автор

Very well explained! But there is one question left! how aggregates communicate with each other? do they "just" reference each other, for simplicity in the same bounded context?

sotsch
Автор

Very engaging and informative presentation.

jelenacupac
Автор

awesome talk, very clear explanation thanks

mohamedbeyremmakhlouf
Автор

its fun to get there, but its not fun to be there

never been more accurate!

ehm-wgpd
Автор

Fantastic explanation, very useful talk.

ismailm
Автор

I heard so many people struggling with Aggregate term, but all I see is just a classic GoF Facade done right.

sighupcmd
Автор

composite: all functionality in one class.
aggregate: functionality spread over multiple classes and one (facade) aggregating them.
(mentioned in Ivar Jacobson‘s OOSE book 😁)

mv
Автор

@3:33 il problema non è se il system arriva o no a questo livello di complessità, il problema è chi scrive una query che implica 1000 tabelle...

boltthrower
Автор

what if you have huge data like 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?

botyironcastle
Автор

Lol, zero real solutions given.

The first rule of distributed computing should be : don't do distributed computing (unless you really need to). Not "split your ACID boundaries early on" into various "agregates".

For instance, this talk doesn't explain all the inconsistent system states that can occur if that UserAccount is deleted on one side, the CRMAccount should react to it and a third system losely depends on the existence of the CRMAccount. Like billing a user that shouldn't exist in your system anymore. Stuff like that. Without the saga patterns to monitor such inconsistencies and try repairing them, offering cancellation or refund.

Premature distribution is a recipe for disaster. Agregates teached this way hence are a recipe for disaster.

kboite
Автор

Very long way to explain plain old encapsulation of the object-oriented design

McRakns