3 ms·
Any time the component needs to call a method or access data from the aggregate. The kind of thing that happens all the time but the pattern is abstract so ther
by norswap 7y ago
Any time the component needs to call a method or access data from the aggregate. The kind of thing that happens all the time but the pattern is abstract so there's no killer example.
e.g. the component manages some kind of list, and the content of this list has to be kept in sync with some field in the aggregate.
No example is going to be perfect, because if you have full control over both classes, well then you can always change their interface in a way that it isn't required anymore. One need to consider the reason the thing should be a component in the first place (maybe the pattern is reused in multiple places) and other external and/or historical constraints on the code.