>>Thanks for the info. IoC/DI adds a little more complexity than I'd like, but I'm still learning. I just found this book on Unity, and I'm finding it a good resource:
http://unity.codeplex.com/documentation>>
>
>Yeah, an IoC container will do what you want. You specify the interface and it gives you the concrete implementation based on how it's configured (plus injects any dependencies into the class). Unity is pretty complex - I'd pick something simpler - Ninject, or Autofac, or even StructureMap.
>
>Viv's suggestion also works well. I actually do something like that for a lot of my projects where I mostly want a central place to configure my objects and don't want the additional complexity of an IoC and don't want to introduce interfaces everywhere. If you want to swap them out, you'd still need to use interfaces.
Thanks, I'll check out those other containers. As far as I can tell, I can instantiate a subclass in place of a parent class without an interface, as long as the reference is typed to the parent class. Am I wrong about that? Or do you mean that IoC containers require interfaces to swap anything?