Approaches to mitigate or prevent such problems are following the stable dependencies principle and abstracting the actual relationship itself via a mediator.
--
---
You received this message because you are subscribed to the Google Groups "Growing Object-Oriented Software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to growing-object-oriente...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to growing-object-oriented-software+unsubscribe@googlegroups.com.
Hey Steven
thanks for the clarifying question to Christopher points.
If that helps the discussion, the kind of changes to the relationships and the object structure are like these:
1) We are given a conglomerate of companies and we have to compute the total salary paid by the whole conglomerate.
2) Once the software is written, there are changes like
- the list of employees is now available directly for every company, without the need to go through the list of offices and look into every office
- the computation of the total salary now should include also subsidiary companies
While this introduces changes in the objects hierarchy and in some object structure, the logic of the computation of the total salary
and the logic of the navigation of the object essentially is still the same, still the related code needs to be changed.
This is another example I just sketched:
Correct me if I'm wrong but it seems that you are describing two objects where the consumer has be written in such a way that it is coupled to the implementation of it's neighbor rather just dependent on it's interface.Your typical Solid principles can limit this headache.This ripping effect can also occur when one makes the mistaken of over separating his design. By separating functionality that can't be reasoned about on its own across multiple objects resulting in this cascading changes. Kent beck has a short article on this
ThanksSteven SolomonSent from my Apple Lisa.
Approaches to mitigate or prevent such problems are following the stable dependencies principle and abstracting the actual relationship itself via a mediator.
On Jan 1, 2015 9:21 AM, "Luca Minudel" <luca.m...@gmail.com> wrote:
--
Thanks to encapsulation, it is easy to locally understand an object in isolation, reuse it, extend it, evolve it, and most of all change it without affecting the rest of the program.
OOP does not provide a built-in support, comparable to encapsulation for flexibility, in object interrelationship such that relationships between objects or structure of objects in a relationship can change, without affecting the rest of the program. Instead :
- When an object’s unstable dependency changes, it can trigger changes into the object itself and this can start a chain reaction of changes in dependent objects.
- When an object hierarchy changes or some responsibilities or state is moved from one object to another, code traversing the objects and making computations on the traversed objects needs to be changed too, to adapt to the new object hierarchy and the new objects structure.
I'm writing a post based on my understanding of GOOS book, Mock Objects papers, Professor Karl Lieberherr work on Adaptive programming, and Sandi Metz's 'Less the path to better design:'
In the meanwhile I'd like to hear your thoughts and what solutions have been found so far to deal with this OO weakness?
Luca
---
You received this message because you are subscribed to the Google Groups "Growing Object-Oriented Software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to growing-object-oriented-software+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
---
You received this message because you are subscribed to the Google Groups "Growing Object-Oriented Software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to growing-object-oriented-software+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to growing-object-oriente...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to growing-object-oriente...@googlegroups.com.