views:

432

answers:

1

I have an architectural question for you :) In my new project i'm developing a wcf service that has a "driverName" string input parameter and for that name the service must create a "driverType" class that implements an "IDriver interface" and execute a method. The application will be extensible and i want put other assembly with other driver implementation at runtime.

I don't know very well wcf but reading the new wcf4 in my mind i have thinked the following two possible implementations:

1) Using a "factory pattern" in a generic wcf (and my question is: there is a framework that i can use for my purpose?)

2) Use many wcf, one per single driver, and the discoverable feature of the WCF4 (and my question is: can discoverable help me?)

Sorry but my english is poor and i don't have many experience about this kind of problem. Please help me.

+1  A: 

I don't see any reason to create multiple services. Simply use a factory pattern.

Since you're using .NET 4.0, you should consider using the Managed Extensibility Framework.

John Saunders
do you think that MEF is better than structuremap and other IOC in this case (i'm trying it in this days and that question in recurrent in my mind :) )
tartafe
I don't know. I haven't used structuremap. I do know that MEF is the extensibility framework used inside of VS2010 itself to extend the text editor, and that it will become the extensibility framework for all aspects of VS Extensibility in future releases. In other words, the VS team likes MEF a lot!
John Saunders