Cumulative performance and performance issues

I read about the cumulative template, but I'm somewhat confused. The template indicates that all objects belonging to the aggregate should be accessible through the Aggregated Root, and not directly.

And I guess that is why they say that you should have one repository for each aggregate.

But I think this adds a noticeable overhead for the application. For example, in a typical web application, what if I want to get an object belonging to an aggregate (which is NOT an aggregated root)? I will need to call Repository.GetAggregateRootObject (), which loads the aggregate root and all its children, and then iterates over the children to find the one I'm looking for. In other words, I load a lot of data and throw it away, except for the specific object that I am looking for.

Am I missing something here?

PS: I know that some of you may suggest that we can improve performance with Lazy Loading. But this is not what I am asking here ... The aggregate scheme requires that all objects belonging to the aggregate be loaded together, so we can enforce business rules.

+3
source share
1 answer

I'm not sure where you read about this "Aggregate Template". Please post a link.

One thing may be when we encapsulate a list in another object. For a simple example, if we have a shopping cart instead of scrolling through the shopping list, we use the shopping cart object instead. Then, a code that runs on the entire trolley (for example, getting total expenses) can be encapsulated in a cart. I'm not sure if this is really a template, but google found this link: http://perldesignpatterns.com/?AggregatePattern

I suspect when you say

" , , , ."

-.

, . , .

. -, , - , , . .

, . . , . , , - .

0

Source: https://habr.com/ru/post/1738860/


All Articles