Well, there is a risk that your code will be poorly typed, and you wonโt know that you accidentally tried to use it with a type that does not have an open constructor without parameters until runtime ... and it will be slightly worse than calling the constructor directly . Other than that, everything should be in order.
If you can design around it to use strongly typed factories, that would be preferable in many ways, but I fully understand that this is not always appropriate. In principle, this should be a bit of a final trick for those cases where normal design patterns fail, but this is a perfectly reasonable last resource :)
Do you have any specific problems?
source share