How do I make sure that a certain class is only instantiated by a factory and not by calling new directly?
EDIT: I need the factory
It will always be created by calling new somewhere, but if you only want that to happen in your factory class, you can set all the constructors to Internal (or Private, and use a Public Static factory method on the same class).