views:

40

answers:

2

Hi all,

I'm writing a Windows Application that connects to a webshop through it's API and reads/writes values.

The Webshop can have multiple Payment gateways and I was thinking about writing a plugin to each one and create a user interface that will be available to select each one and load the correct assembly...

my idea is to have multiple Libraries (.dll) and load the correct one once set up...

I do think this is kind'a late 80's developing so I wonder if there is anything new that could help me develop such behavior on .NET 3.5 SP1

I'm new to this matter, and for that I would ask you what is the best way to approach this.

Thank you.

P.S. I read about MEF (Managed Extensibility Framework) but it's still preview (MEF Preview 8 is the current), and only be available on .NET 4.0 so I can't go that way :-(

+2  A: 

Take a look at MEF and Unity, they are two very useful projects from Microsoft that should help with extensibility in your app (MEF is actually used inside VS2010 to support extensions).

Rory
I just updated that I can't go with MEF ... soon I pressed Edit I got your answer :) But it's still very new technology and I can't based my app on beta/preview states. What people did before MEF arrived?
balexandre
Well, like I said, there's still the Unity option. It's really just a D.I. container, but it can be used as the foundation for a plug-in architecture. If you're working with Silverlight or WPF, you could also look at http://compositewpf.codeplex.com/
Rory
+1  A: 

There are a number of helper classes added into .NET 3.5 in the System.Addin namespace. These help out with a lot of the boiler plate code and more difficult aspects of this kind of development (such as loading and removing plugins at both startup and runtime as well as code isolation), but they still follow the basic pattern that you've described.

I haven't personally used them in real world code, but I have had a mess around with them and they appear at first glance to work well enough.

An overview can be found here.

Martin Harris