Last post Dec 15, 2010 03:01 PM by benl2k
Dec 15, 2010 02:31 AM|benl2k|LINK
Usually when writing a plug in we create some service or interface that the plug in can talk to in the existing system. My work want me to create a plug in for our existing product which will work when being dropped into any version of the code
without modifying any of the existing code. The product is several versions old now and some of these versions have been frozen for maintenance only so it is not possible for me to add additional code for my plug in to interface with, however
it does need to use certain parts of the core functionality such as our built in security for example.
The only way I have managed to achieve this so far is to compile the so called "plug in" against each version of the code base before it is deployed. However this is clearly not a true plug in and does not simply drop into each version of the code. Is it
possible to create this level of independence from the core software without re-writing/extracting the chunks of functionality that I want the add on to use?
If it is possible could anybody suggest possible pseudo architectures or explain technically how I might achieve this.
Dec 15, 2010 02:54 AM|XIII|LINK
if both ends make use of a certain interface you can change what's behind the plugins implementation of that particular interface. For dropping the plugin and having it automatically be used a composition container like MEF might work out for you quite well.
I suggest you take a look at this video tutorial:
In this episode we are going to take a quick look at the new plugin framework from Microsoft the Managed Extensibility Framework (MEF for short).
In this episode we will explore how to setup your first MEF based plugin system and show how easy it can be.
Dec 15, 2010 03:01 PM|benl2k|LINK
Thanks for your quick response! I will have a look at the video tutorial when I get chance.
Currently there is no shared interface at all. All the functionality I need comes from a base page which all standard pages in our product inherit from. In my current solution the plug in also inherits from this base page however it requires the plug in
to be built against the core code and is therefore tightly coupled with the core software.
What I wanted to do was to write an interface which shares the base page methods without having to inherit directly from it. Therefore we can have a common interface that doesn't change between versions and doesn't require a rebuild of the source code each
time we deploy for a new version of the product. However, I was unable to do this due to the fact that certain versions are closed for maintenance and cannot have any new code checked in.