Between different object-oriented design principles there are tensions and synergies.
A professional software developer should have an overall sense of all the forces at work in the code design when coding.
Ilias Bartolini developed a coding-dojo that a group of people can run multiple times to explore and develop a sense of the forces generated in the code by different design principles.
-
This is the repository with the code for the coding-dojo.
-
These are the instructions, the material and the facilitator’s guide
-
The group can document the tensions and the synergies experienced in the sessions of the coding-dojo, this is the template
-
This is an example of a graphical representation
In this repo you find small code examples, each showing a tension or a synergy between two object-oriented design principles.
If you have more examples, please share them with a pull request.
From the original coding-dojo, attendees can refactor the 'Before' code by applying one design principle producing an 'After' code and then observing the tension with another design principle.
Here I'm adding more refactoring exercises where attendees are asked to refactor the 'After' code to resolve the tension by finding a good tradeoff.
For the facilitator, I've added a C# example for the 'TensionBetweenSRPandEncapsulation' with a 'Worse' solution and a 'Beter' solution and some notes for the facilitator. More examples are needed for the other cases of tension and for the other languages.
Thanks to Ilias Bartolini for creating a coding-dojo that explores this topic and inspired these code samples.
Thanks to Daniel Tsadok for the porting of the examples to Ruby.
Thanks to Peter Oxenham for the porting of the examples to Java.
Thanks to Jonathan Reyes for the porting of the examples to JavaScript.