Expressing the Open Closed Principle in terms of Deletion

Most definitions of the Open Closed Principle talk in terms of extension. This makes it hard to check for because you need to imagine all possible extensions. There is a simpler equivalent test: How much would I need to change to remove this feature? Theoretically it could be as little as deleting one class that self registers (plus the tests). The advantage is that it’s easier to reason about removal.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s