3 ms·
Thanks for pointing this out. I can't think offhand of an example to illustrate when you would like this "call back" functionality in a way that you can't anti
by gugagore 7y ago
Thanks for pointing this out.
I can't think offhand of an example to illustrate when you would like this "call back" functionality in a way that you can't anticipate when you design the component object. Do you have a killer-app for inheritance?
- dfinninger 7y agoMaybe a plug-in system? It can dynamically register itself with the parent object so that the plug-in is discovered by the system. All the plug-in author would need to do is inherit from the base plug-in class.
- norswap 7y agoAny 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.