Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Instantiate class from custom assembly/DLL
Message
 
À
24/03/2015 19:11:33
Joel Leach
Memorial Business Systems, Inc.
Tennessie, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 5.0
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01617218
Message ID:
01617240
Vues:
32
This message has been marked as a message which has helped to the initial question of the thread.
>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.
-Paul

RCS Solutions, Inc.
Blog
Twitter
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform