This page is used for the submission of contribution to Service IM discussion
Following are a couple diagrams related to the composite/atomic approach - shared in recent working sessions.
This page is used for the submission of contribution to Service IM discussion
Following are a couple diagrams related to the composite/atomic approach - shared in recent working sessions.
1 Comment
John Strassner
Hi Kevin,
thanks for taking my suggestion. I have two points.
First, please modify the multiplicity of the CompositeServiceComprisedOf aggregation from 1 - 1..n to 0..1 - 1..n. The former means that this is mandatory, and hence, is not usable for simple atomic Services. The latter lets the aggregation be optional.
Second, let me provide some additional reasons why recursive associations are in general a bad idea:
All subclasses inherit a recursive relationship, so you must be careful to follow the Liskov substitution principle if you use it
It is impossible to differentiate between an atomic instance and a composite instance (i.e., fails to provide a single responsibility - another famous software principle)
Additional constraints must be implemented in order to prevent cycles (e.g., your grandfather cannot be your grandson)
It is impossible to differentiate between a tree and a forest
Finally, as noted in our call, the MEF Core model defines Products, Services, and Resources using the composite pattern.
best regards,
John