Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Instantiate class from custom assembly/DLL
Message
De
24/03/2015 17:21:12
 
 
À
24/03/2015 17:13:03
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:
01617219
Vues:
36
That's one pupose of IoC. But there may be other ways. Is this an ASP.Net or MVC app?


>In our vertical market VFP app, we use a data-driven abstract factory to instantiate all of our classes containing business logic. Basically, that means instead of using CreateObject("MyClass"), we use Factory("MyClassKey"). The factory looks up the class in a table, then instantiates and returns the object. An important benefit of the factory is that it allows us to substitute a custom class for the standard one. For example, if a client wants us to customize a calculation for them, we put it in a custom class, install it on their system, then use the factory to instantiate the custom class in place of the standard one.
>
>I'm wanting to implement something similar in C#. The customizations for a specific client would be compiled into a custom DLL. Then I need to instantiate the custom class in place of the standard one. I figure I could probably roll my own factory using reflection and whatnot. I wondered if there was already a standard solution to this problem. I've been learning about IoC containers, but I can't tell if they do what I need. I'm not sure I buy into all of the dependency injection stuff, but I would be willing to use an IoC container if it also met my need with customizations. Or maybe there is some other mechanism built into .NET to achieve what I need. Any suggestions?
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform