Maintainability supports decision-making
When building a software system, we solve problems every day. For most problems we face, there is more than one solution. We have to make decisions to choose between those solutions.
Do we copy this bit of code for the new feature we’re building? Do we create our objects ourselves or do we use a dependency injection framework? Do we use an overloaded constructor to create this object, or do we create a builder?
Many of these decisions we don’t even make consciously. We just apply a pattern or principle we’ve used before that our intuition says will work in the current situation, as follows:
- We apply don’t repeat yourself (DRY) when we find code duplication
- We use dependency injection to make the code more testable
- We introduce a builder to make it simpler to create an object
If we take a look at these and many other well-known patterns, then what is their effect? In many cases, the main...