Overcoming the one weakness of OOP, comparing solutions

Table of content
- Abstract
- Which is the one weakness of OOP?
- How to overcome the one weakness of OOP? Solutions:
  - 1. Professor Karl Lieberherr work on Adaptive programming and the Law of Demeter
  - 2. Mock Objects and Growing object-oriented software, guided by tests
  - 3. Less, The path to better design
- Comparing solutions
- References



Comparing solutions

These are some similarities about the solutions suggested by the 3 sources:
  • One solution uses tools and higher-level navigation specifications to regenerate code whenever there are changes to the relationship between objects and to the structure of objects.

  • Two solutions include the use of Programming by Composition and of the dependency inversion pattern: to decouple object behaviour from the structure of the object graph, to decouple dependencies and to shield, to some degree, other objects from changes in the composed objects.

  • Two solutions include the use of a design similar to the Visitor-like pattern, used essentially to reverse the direction of an unstable dependency and so turning the dependency relationship into stable.

  • Two solutions abstract away differences between objects traversed in an object graph to protects the code, to some degree, from changes in the object graph and in the structure of objects:
    • One solution for statically typed languages does this with the Composite pattern,
    • The other solution for dynamically typed languages does this with Duck Typing.

  • All three solutions explicitly tell how to carefully choose and limit dependencies, with different but substantially equivalent means.



Print | posted @ Thursday, January 22, 2015 6:03 PM

Comments have been closed on this topic.