473,473 Members | 1,867 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Plugin assembles best practices

This is a lengthy post; please bear with me...

This will be a large system with dozens of plugins. In addition to plugins
developed internally there will be 3rd parties that will write their own and
integrate them into our application. I will be managing the identification
and loading of these plugins. In addition, there are a number of assemblies
that plugins will reference, some shared, and others private.

There are a couple of approaches I am considering.

It is expected that all plugins will need to be registered so that the app
does not blindly load up
all assemblies searching for plugins to load.

FIRST OPTION - separate directories
The expected directory layout is like this...

BaseDirectory (application)
PluginManifest.xml (info on which ones to load)
|
|
-- Common (shared.dll, all versions forced to latest)
|
|
-- PlugIn1 directory (Plugin1.dll, private1.dll, v1.0)
|
|
-- PlugIn2 directory (Plugin2.dll, private1.dll, v1.1)
|
|
-- PlugIn3 directory (Plugin3.dll, private1.dll, v1.2)

All assemblies that share types are to be relocated to the common
directory. This occurs when the
assembly is installed. This involves determining if an assembly is intended
to be shared - this
implies that the assembly is exporting a type that the consumer of that
assembly (i.e. the plugin) is
also exporting or importing.
All shared assemblies will have binding redirects so that all other
assemblies will all be pointing
at the same one.

All assemblies that are intended to be private will remain in the
subdirectory of the plugin. A codebase hint
for each assembly to be loaded will be placed into the app.config file so
that the assembly lives in the fusion load context.
ALTERNATIVE:
Put all assemblies into the same directory and enforce a naming convention
like this...
<namespace>.<asmName>.<version>.dll

This is intended to result in all assemblies having a unique name; the
name to include the assembly
version number.
No binding redirects to be done, nor will codebase hints be used, unless
there is a common assembly that
all others must share. This will be identified manually and a binding
redirect put into the app.config file.

The layout looks like this...

BaseDirectory
PluginManifest.xml (info on which ones to load)
|
shared.v1.0.dll, shared.v1.1.dll, shared.v1.2.dll,
|
|
PlugIn1.dll
PlugIn2.dll
PlugIn3.dll
private1.v1.0.dll
private1.v1.1.dll
private1.v1.2.dll

PROS and CONS:
Separate directories.
PROS
Prevents clutter. Makes it easier to separate "system" *(i.e. our)
assemblies from addins, 3rd parties,
etc.
Ensures that all private assemblies remain that way as they are isolated
by directories.
There is no global naming scheme we need to maintain or enforce.
Each plugin can have separate associated data files. Can use its own
subdirectories.
No naming conflicts.
CONS
Much more overhead in managing the system. I have to write a fusion-like
layer to handle all
the locations that assemblies can be in, the binding redirects, etc.
All plugins need to be analyzed for common items during the registration
process.
One directory
PROS:
Has the advantage of simplicity. Easy to locate and load assemblies.
No fusion-like layer to manage the assemblies is needed.
CONS
Requires a global naming scheme that everyone must adhere to.
Each plugin may be using a different version of an assembly and there is
no way to tell which one
is using what since they are all located in the same directory.
Identifying conflicts will be a nightmare.
If an assembly accidentally exports a type that is supposed to be private
will result in an error (typecase)
that will be very hard to troubleshoot.
Will be hard to "know" what assemblies are actually used and needed.
Clutters the directory.
If a plugin uses a data file may result in a name conflict with another
plugin.

So, anyone have any comments? Which method would be best? What other methods
are there that I did not mention?

Thanks,
David Levine

Nov 16 '05 #1
0 1849

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

Similar topics

2
by: byrocat | last post by:
I'm chasing after a documetn that was available on one of the Microsoft websites that was titled somethign like "MS SQL Server Best Practices" and detailed a nyumber of best practices about...
136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
13
by: john doe | last post by:
A quick question, about so-called 'best practices', I'm interested in which of A/B of the two examples people would choose, and why. public enum MyEnum { Option1 = 0, Option2 = 1, Option3 =...
10
by: jojobar | last post by:
Hello, I am trying to use vs.net 2005 to migrate a project originally in vs.net 2003. I started with creation of a "web site", and then created folders for each component of the site. I read...
3
by: Rune Jacobsen | last post by:
Hello all, I mailed our common hero and fellow newsgroupian Jon Skeet a question regarding his article on plugins at http://www.yoda.arachsys.com/csharp/plugin.html, and he suggested that I...
0
by: sayalikulkarni | last post by:
Hello all, I have been trying to develop a security plugin for DB2 V8.2 using the GSS APIs. I have a library of GSS APIs implemented by a third party which I am using in my plugin. This plugin is...
4
by: Paciente8159 AKA Klayman | last post by:
Hi, I have a couple of doubts reggarding a plugin based application in C++? I want to build a c++ plugin based app. I have searched alot of things in the net but I still don't know how to...
8
by: Flavio | last post by:
Hi, Nowadays the addition of functionality to programs by means of plugins is very frequent. I want to know the opinions of experienced Python developers about the best practices when it...
1
by: Olie | last post by:
I was quite surprised to find virtually nothing about this but I may have been searching for the wrong thing. I want to know the best way to provide a programming interface to a plugin. I...
0
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,...
0
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...
0
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,...
1
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
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 ...

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.