473,785 Members | 2,882 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Plug-in architecture leads to version problems.

I have a .NET 1.1 C# app (lets call it MyApp.exe) which is designed to
do some boring thing (not important now) but it can be extended with
plug-ins. These plug-ins are subclasses of a type (PlugInBase)
contained in a shared assembly (MySDK.dll). At startup, MyApp.exe
reads the registry for a list of plug-in assemblies to load from the
GAC. These assemblies are instanciated (using Assembly.Load) and
searched for types that subclass MySDK.PlugInBas e. When found, these
types are instanciated with Activator used normally.
From its inception, it was my intention to have others (3rd parties)

create the plugins. I xpected them to develop their plugin by
referencing MySDK.dll and implementing their own subclasses of
PlugInBase. Then, to integrate their plugin into MyApp, they need to
install their assembly into the GAC and add a registry entry requesting

MyApp to load it by name.

My initial testing worked well. I created projects within my main
VS.NET solution that contained implementations of PlugInBase and were
installed into the GAC with a post-build event. Everything seemed to
be fine... until I tried to separate the plug-in projects from the main

solution. It became a versioning nightmare.
What I have missed is the simple fact that MySDK.dll is strongly named
and everytime I fix a bug and release a new version of it (example
1.0.0.0 to 1.0.0.1), all plug-ins must be recompiled using the new
version of MySDK.dll. This is impractical, since it would require
massive coordination with 3rd party authors - some of whom I may not
know.
The solution I seek would allow me to patch MyApp.exe and MySDK.dll,
without requiring a recompile of the 3rd party plug-ins. Can this be
done?
I have pondered this question and have some thoughts and questions?
Can an assembly load event be hooked which allows me to substitute the
new assembly?
Would a config file setting help?
Should I change my plug-in communication from inprocess to something
else (maybe .NET remoting)?
Is there something in .NET 2.0 which can help? I don't want to
upgrade, but will if necessary.
Should i consider an interface only approach - removing my
implementation from the MySDK assembly and thereby minimizing the
number of updates to the assembly?
I welcome all ideas and advice

Jan 9 '06 #1
2 1121
Instead of using a base class that your plug-in authors must inherit
from, use an interface instead. The plug-in authors can create classes
that implement the interface. You can still use the same method for
detecting and loading the plug-ins, but when you fix a bug, it will not
affect the plug-ins because the interface will not have changed. The
only time the plug-ins will be affected will be if the interface itself
changes which should be rare or not at all.

Jan 9 '06 #2
"Chris Dunaway" <du******@gmail .com> wrote in message
news:11******** **************@ o13g2000cwo.goo glegroups.com.. .
Instead of using a base class that your plug-in authors must inherit
from, use an interface instead. The plug-in authors can create classes
that implement the interface. You can still use the same method for
detecting and loading the plug-ins, but when you fix a bug, it will not
affect the plug-ins because the interface will not have changed. The
only time the plug-ins will be affected will be if the interface itself
changes which should be rare or not at all.


To further add to Chris's post, I would also say to define the interface in
a separate DLL so that it is distributable to your 3rd parties.

Also, some may disagree, but I think it's a good idea to put a version
number in the interface name in this situation. For example, IFoo_v1. That
way any given assembly could support multiple versions of the interface and
keep them straight. Taking it one step further, you could define IFoo_Base
and derive IFoo_v1 and IFoo_v2, etc. from IFoo_Base if there is some common
base functionality to be supported.

-- Alan
Jan 9 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
2457
by: Tian | last post by:
I am writing an audio game using Python. in this game you can apply some sound effects for the clips you have recorded. I want to make this function extensible. I want user to be able to add new sound effect plug-ins in the future. I want the plug-in to be a simple python code (text file) and a description file. I will set some rules for plug-in writing (like you must inherit some class and implement some method). I hope plugin can be...
2
1419
by: Jesper | last post by:
Im creating a host application (a game) which allows for users to supply a custom computer AI. This will be in the form of a plugin assembly which supports a specified interface. So the host will call interface functions in the plugins like PerformMove(GameState gs). The host application is a trusted application that runs on a server, and users upload plugins to this server, but I can't trust the plugins. PlugIn: - Must adhere to a...
1
1702
by: gnuoytr | last post by:
being a retrograde vi kind of guy, i can run a vi-able editor when i use WSAD or Eclipse (both java programs), but i don't see any plug-in menu items here. any chance of getting plug-in support into Dev Center?? LUW/v8.1 (not 8.2, yet) btw, the cygwin/gcc hack works. did that yesterday. cool. now, if only gcc worked on z/os <G>
2
2047
by: Kelvin | last post by:
To all, I've got another question. Does anybody know how to write plug-ins using VC++?? Actually, my friends and I will develop a Photo enhancing system, and so we'll need some technique to allow additional packages/plugins to attach the system. (maybe need to integrate commercial plugins such as KPT6-- photoshop)
4
2240
by: Brad Markisohn | last post by:
Is there a way to determine, programmatically, when Plug-and-Play devices are connected or removed from the PC? In VB 6 I caught events from the SysInfo control, but I don't believe that this control is supported in .Net. Any suggestion? TIA Brad
0
1054
by: Ant | last post by:
Sourceforge's Project of the Month (an IT monitoring system written using Zope and Twisted) is a good advert for Python: http://sourceforge.net/potm/potm-2007-03.php
1
1127
by: =?Utf-8?B?YWxlb24=?= | last post by:
Plugin.ocx file continues to be removed when we run MS Updates. The databases are 2003 and forms don't work without the plugin.ocx. Tried making the .ocx file read only, but that didn't work. We have to copy it back into Windows System folder each time we run updates. Any ideas? -- aleon
8
1500
by: Joe Kovac | last post by:
Hi! Is there any recommendation how to develop plugin-like Asp.Net pages? The use case: We have a framework, where you can administrate employees, customers, etc. Now, customers always want some specific additional views, which should be integrated into the web site. How should I organize the web site(s), the solution(s) and the projects? Thanks
19
1707
by: jim | last post by:
(from http://www.news.com/8301-13578_3-9798715-38.html ) October 16, 2007 5:56 PM PDT RIAA tries to pull plug on Usenet. Seriously. Posted by Declan McCullagh The Recording Industry Association of America has found a new legal target for a copyright lawsuit: Usenet. In a lawsuit filed on October 12, the RIAA says that Usenet newsgroups contain "millions of copyrighted sound recordings" in violation of federal
1
1993
by: diwakar09 | last post by:
hi all, could you tell me how to write plugins for mac safari how to start, i have the dll's but i don't know how to start, pls. guide me, if possible send me some links from where i can access the information thanx
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10327
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10092
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7499
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.