extension pattern in .NET – Decorate the class with attributes

 Consider a simple class hierarchy with an abstract base class and 3 derived classes. A typical implementation of a factory would be a static method on the base class, like this                         Problem: The above pattern is bad in different ways        1. Base classes must have references to the sub classes and that…

4