We Should Care About OCP…

…because closing our classes allows us to focus on new functionality. It makes us more productive.

…because more productivity means less waste. Less waste means less cost. Less cost means more money. More money is the goal.

…because when we create extension points in our classes we provide flexibility for the consumers of our software.

…because when we create extension points in our classes for our own needs, we create extension points the future needs of future customers without succumbing to YAGNI.

…because it lets us extend the behavior of components outside of our control. Even if we do control dependencies, it’s a shorter feedback cycle to add novel functionality when said dependencies are open to extension. Shorter feedback cycles equate to more productivity and, well, you know.

你可能感兴趣的:(OCP)