Say I have a C# app, which is layered.  I want to test the domain layer independently of other layers.  Therefore I have created a Domain Layer project with three classes e.g. Person, Order and OrderItem (hypothetical).I have used Inversion of Control (Castle Windosr) so I also have a whole load of other classes:PersonFactoryOrderFactoryOrderItemFactoryIPersonFactoryIOrderFactoryIOrderItemFactoryetcMy Visual Studio project looks polluted with these classes.  What can I do with these classes? I have thought about creating a folder called: Factories.  What do you do with these classes that pollute the project?
IOC Classes are polluting my project
c#;.net;visual studio
IoC is a very good thing. But factories that have a strictly 1 to 1 relationship with what they make aren't doing you much good.A factory should make something FOR something. They shouldn't be a brain dead alternative to a constructor. They should allow for good default values without ever forcing anything to ALWAYS have that default value.You should keep your behavior separate from construction.  That doesn't mean you have to keep all construction in an xml document. Not all of your construction needs to be in factories anyway. Creational patterns come in many flavors. And sometimes it's best to just build what you need in main.Don't let any IoC-container box you into a corner. If your thinking has been: I need a Person object so I need a PersonFactory you're living in a hell of your own making. 