The open-closed principle needs no introduction. It’s a part of SOLID, it’s a valuable design tool, mountains of text have been written about it. To recap: The principle says to make your software open for extension, but closed for modification. Once you decide that following that principle is valuable for a component of your software, how do you implement it? Immediately everybody thinks of a polymorphic class hierarchy. After all, that’s the example used in virtually every article on ...