I know it's not possible to inherit constructors in C#, but there's probably a way to do what I want to do.
I have a base class that is inherited by many other classes, and it has an Init method that does some initializing taking 1 parameter. All other inheriting classes also need this initializing, but I'd need to create separate constructors for all of them that would like like this:
public Constructor(Parameter p) {
base.Init(p);
}
That totally violates the DRY principles! How can I have all necessary stuff initialized without creating dozens of constructors?
Initas the name of a method is generally a strong sign that objects are needlessly existing in invalid states where the only thing they are good for is causing bugs. - Jon Hannapublic,protected, andprivateover and over and over? - Slipp D. Thompsonpublic, etc., you're specifying a new piece of knowledge. Therefore, it doesn't violate DRY. - MarredCheese