473,403 Members | 2,222 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Plugins: flexible & safe use of different assembly versions withdifferent features

Hello.

Are there any resources out there (because I couldn´t find any)
concerning the usage of assemblies with different features in each version?

In other words:
I´ve got one assembly A that is using assembly B - B exists in different
versions. Now I want to make it possible for A to ask B what features it
supports or what data it can give to A.

Something like:

if (B.supports(detailedData))
useDetailedData();
else if (B.supports(lessDetailedData))
useLessDetailedData();
else
useData();

An older version of A may ask only the following:
if (B.supports(lessDetailedData))
useLessDetailedData();
else
useData();

I´ve tried something like this but it didn´t work for me!

Puh - hope I could make myself clear.
Thanks for any information!

Greetings,
Tim.
Mar 22 '06 #1
1 1343
I'm not sure how you have created your assemblies, but generally
speaking, you would define an interface that B would implement. A
would be programmed against this interface. As long as the assembly
(B) has implemented the interface properly, it doesn't matter to A how
it is implemented, it should just work. This way, A doesn't have to
know what capabilities B has and B doesn't have to know what A
supplies. A just calls the interface, and B just implements it. I
suppose you could have A pass in its version number so that B can react
accordingly.

public interface IMyInterface
{
//interface definition here
public void InterfaceMethod();
}

public class PlugIn : IMyInterface
{
//PlugIn (B) implements the interface
public void InterfaceMethod()
{
//method implementation
}
}

public class Host
{
//Host class (A) uses the interface

IMyInterface var;

public Host()
{
var = getInterfaceInstance();
}

private IMyInterface getInterfaceInstance()
{
//code to instantiate an object that implements the interface
}

private void foo()
{
var.InterfaceMethod();
}
}

Hope this helps.

Mar 22 '06 #2

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

Similar topics

4
by: Arnaud Debaene | last post by:
Hello group. I have an app which can load "plugins" assemblies that are described in the registry (each registry entry gives the full path to the plugin ..dll file). The plugins may be anywhere...
4
by: GlobalBruce | last post by:
The global assembly cache on my development computer has duplicate native images of several System assemblies. For instance, the System assembly itself is present as two different native images, as...
4
by: stu_pb | last post by:
I am designing a plugin system for a window application using .NET(C# specifically). One of the requirements of the plugin system is to be able to dynamically load/unload plugins. My initial...
5
by: Florian Proch | last post by:
Hi all... i'm currently working for a big project to construct a website. We need to support some browser and OS : IE 5.0 -> IE 6, Mozilla 1.2 -> 1.7, Opera 5 -> Opéra 7.5x, Netscape 4.75 -> NS...
6
by: Pete Davis | last post by:
I'm confused about what precisely the limitations are on loading plugins in separate app domains. In all my previous apps that supported plugins, I've loaded them into the same domain as the app,...
4
by: António Pinho | last post by:
Hi, I have a big problem with an webpart/assembly. i'm trying to connect to sql server but i get the error "Request for the permission of type System.Data.SqlClient.SqlClientPermission,...
0
by: Greg Conely via .NET 247 | last post by:
I am creating a application that will be using plugins. I am doing this so that when I want to let this application work with another type of dbase system, I only have to write\install one plugin,...
1
by: bharathreddy | last post by:
This Article gives an introduction to VSTS Team Foundation & fundamental difference between Visual Source Safe (VSS) and VSTS Team Foundation. Team Foundation is a set of tools and technologies...
0
by: Jason Madison | last post by:
I would like some information on options for allowing different versions of assemblies to work together. Example: assembly1v1 makes calls to some classes in assembly2v1 A new version of...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
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...

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.