Given the following client code:
var obj = new Class1();
Is there any way to modify the constructor of Class1 so that it will actually return a subclass (or some other alternate implementation) instead?
I would like obj to get one of two different implementations, depending on some condition. Obviously, I could change to using a factory or DI framework, but I'd like to avoid changing the client code, if possible.
I assume the answer is no, but I wonder if there's some clever way of making that happen.