473,385 Members | 1,375 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,385 software developers and data experts.

Good reference for Plugin based architecture

Friends, maybe someone knows good references for .NET plugin based program
architecture. E.g I want to be able to "put" class library(dll) in some
place (where I do not the name of the class, but only structure [maybe
abstract???]) and use it "plug-and-play" in main procedure without
recompilation

--
Tamir Khason
You want dot.NET? Just ask:
"Please, www.dotnet.us "
Nov 16 '05 #1
5 3020
Hi Tamir,

From my understanding, plugin based architecture always involves a plugin
host which is always an executable file (exe) and not dll. Ok, maybe i don't
get what you meant :(

I want to be able to "put" class library(dll) in some
place (where I do not the name of the class, but only structure [maybe
abstract???]) and use it "plug-and-play" in main procedure without
recompilation --> ??? confuse a bit

Cheers.

"Tamir Khason" wrote:
Friends, maybe someone knows good references for .NET plugin based program
architecture. E.g I want to be able to "put" class library(dll) in some
place (where I do not the name of the class, but only structure [maybe
abstract???]) and use it "plug-and-play" in main procedure without
recompilation

--
Tamir Khason
You want dot.NET? Just ask:
"Please, www.dotnet.us "

Nov 16 '05 #2
1.Define your Interface
2.Implement this interface in your concrete class
3.Create your host applicatrion and declare avariable of type Interface
4.Use reflection to create the 'Real' object
(you can put the name of the object and the assembly path in the config
file)
5.Use the Interface.


"Tamir Khason" <ta**********@tcon-NOSPAM.co.il> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Friends, maybe someone knows good references for .NET plugin based program
architecture. E.g I want to be able to "put" class library(dll) in some
place (where I do not the name of the class, but only structure [maybe
abstract???]) and use it "plug-and-play" in main procedure without
recompilation

--
Tamir Khason
You want dot.NET? Just ask:
"Please, www.dotnet.us "

Nov 16 '05 #3
Try this two articles:

http://www.codeproject.com/csharp/PluginsInCSharp.asp

http://www.codeproject.com/csharp/plugins.asp
Tamir Khason wrote:
Friends, maybe someone knows good references for .NET plugin based program
architecture. E.g I want to be able to "put" class library(dll) in some
place (where I do not the name of the class, but only structure [maybe
abstract???]) and use it "plug-and-play" in main procedure without
recompilation

Nov 16 '05 #4
Tnx
couple of problems with this architecture:
Following:
interface IInterface1
{}
interface IInterface2: Interface1
{}
class MayClass:IInterface2
{}

While doing enumeration thow dlls (public and non abstract) we check for
type of IInterface1 so
Type typeInterface = myType.GetInterface("BaseNamespace.IInterface1", true);

returns some type (IInterface1). go on:

MyPlugin.Instance =

(IInterface1)Activator.CreateInstance(pluginAssemb ly.GetType(pluginType.ToString()));
//

returns error Can not cast. Wich means that class(MyClass inherited from
Interface2, wich inherited from interface1 and not be cased to interface1)

Please advice, it looks stupid that class inh from base interface can not be
cased to it.

TNX

--
Tamir Khason
You want dot.NET? Just ask:
"Please, www.dotnet.us "

"Jonathan Yong" <da*******@someplace.com> wrote in message
news:uz**************@TK2MSFTNGP09.phx.gbl...
Try this two articles:

http://www.codeproject.com/csharp/PluginsInCSharp.asp

http://www.codeproject.com/csharp/plugins.asp
Tamir Khason wrote:
Friends, maybe someone knows good references for .NET plugin based
program architecture. E.g I want to be able to "put" class library(dll)
in some place (where I do not the name of the class, but only structure
[maybe abstract???]) and use it "plug-and-play" in main procedure without
recompilation

Nov 16 '05 #5
Tamir Khason <ta**********@tcon-NOSPAM.co.il> wrote:
Tnx
couple of problems with this architecture:
Following:
interface IInterface1
{}
interface IInterface2: Interface1
{}
class MayClass:IInterface2
{}

While doing enumeration thow dlls (public and non abstract) we check for
type of IInterface1 so
Type typeInterface = myType.GetInterface("BaseNamespace.IInterface1", true);

returns some type (IInterface1). go on:

MyPlugin.Instance =

(IInterface1)Activator.CreateInstance(pluginAssemb ly.GetType(pluginType.ToString()));
//

returns error Can not cast. Wich means that class(MyClass inherited from
Interface2, wich inherited from interface1 and not be cased to interface1)

Please advice, it looks stupid that class inh from base interface can not be
cased to it.


Chances are you've got the problem listed here:
http://www.pobox.com/~skeet/csharp/plugin.html

Otherwise, could you post a short but complete program which
demonstrates the problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #6

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

Similar topics

0
by: serge calderara | last post by:
Dear all, I have a really strange beaviour in my application. First of all I have a single plugin interface named IPlugIn which as been build in a separate project library named PLugin.dll...
4
by: Aaron Queenan | last post by:
COM has many facilities to assist with creating an application with Plugin support, for example, component categories to determine what components to load, the OLE specification and interfaces to...
2
by: Chua Wen Ching | last post by:
Hi there, I had some doubts on creatings plugins. As most example on the internet shows how to write plugins onto a plugin host which is normally a windows form program. 1) Can i replace...
1
by: Julia | last post by:
Can some one please explain me the following: "In your plugin config section, use the assembly name like "Class, Assembly, Culture, Version, PublicKeyToken" so that you can just use...
2
by: Matt | last post by:
I'm hoping someone can steer me in the right direction to try to do the following: I am developing an application where we receive files from customers. Right now we receive a variety of...
2
by: Joe_Black | last post by:
Hi all, I want to create an MDI app that allows reporting on XML data files downloaded from the equipment that we manufacture, this MDI app will have several default reports but due to the...
7
by: Oldman | last post by:
How do you conditionally reference an assembly based off of the build configuration? Imagine a scenario where I want to have an Sql Release Server build and an Oracle Release Build and the only...
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...
4
by: anglozaxxon | last post by:
I'm making a program that consists of a main engine + plugins. Both are in Python. My question is, how do I go about importing arbitrary code and have it be able to use the engine's functions,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.