473,385 Members | 1,587 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.

Question about loading class elements dynamically

Hello Everyone,

I'm totally lost and I hope someone can help me out or point me to
something that can. Here's the deal:

I have an application that will implement a 'plugin' archetecture of
sorts. The application requires the user to fill out various forms.
Each agency that we deploy the application to will have different
forms and those forms will change over time. If we build each form
into the application through hard code, changing, adding, or removing
forms requires that the entire application be recompiled and
reinstalled.

So what I'm doing is designing the forms as part of a class library.
So let's take filling out a log for example. I'll create a new class
library and then add three Windows forms to it. Let's call them
frmStep1, frmStep2, and frmStep3 (all which pass data amongst
themselves). I build my class library and let's say that is called
LogFormLib.dll. What I need to happen is that I can distribute this
dll to my users, have them drop it in a special directory and have my
application automatically pick it up and make it available via the
menu system. This way, new forms can be added by simply distributing
a new DLL that contains the code.

I know this sounds easy, and I'm sure it is somewhat, but I am totally
lost. How can I do this? Are there any tutorials?

Thanks!
Anthony

Sep 21 '08 #1
5 1021
Easyest way in my opinion would be that you define a generic interface for
the class in the by you descibed situatien if lots of changes might happen
and you do not want to redeploy , i guess a invocation and comunication
interface to your main app would be the way to go

If you have defined this interface you can invoke anny plugin dll that
contains this interface , so in basic the once defined invocation interface
can never change cause then you need to redeploy your app however everything
that is beyond the interface can be changed to anything you like

to help you get started investigate "reflection" techniques

HTH

Michel Posseth [MCP]


"Anthony P." <pa*******@gmail.comschreef in bericht
news:bf**********************************@c65g2000 hsa.googlegroups.com...
Hello Everyone,

I'm totally lost and I hope someone can help me out or point me to
something that can. Here's the deal:

I have an application that will implement a 'plugin' archetecture of
sorts. The application requires the user to fill out various forms.
Each agency that we deploy the application to will have different
forms and those forms will change over time. If we build each form
into the application through hard code, changing, adding, or removing
forms requires that the entire application be recompiled and
reinstalled.

So what I'm doing is designing the forms as part of a class library.
So let's take filling out a log for example. I'll create a new class
library and then add three Windows forms to it. Let's call them
frmStep1, frmStep2, and frmStep3 (all which pass data amongst
themselves). I build my class library and let's say that is called
LogFormLib.dll. What I need to happen is that I can distribute this
dll to my users, have them drop it in a special directory and have my
application automatically pick it up and make it available via the
menu system. This way, new forms can be added by simply distributing
a new DLL that contains the code.

I know this sounds easy, and I'm sure it is somewhat, but I am totally
lost. How can I do this? Are there any tutorials?

Thanks!
Anthony

Sep 21 '08 #2
Thank you Michael. This seems a bit complex but exactly what I need!
So, I know how I'm going to spend my Sunday! lol

Thanks Again,
Anthony
Sep 21 '08 #3
Michael,

I thought everything was going to be fine but I'm already confused so
let me ask a few pointed questions if you don't mind. I think if I get
these answered, I will be well on my way to properly using reflections
and building my plugin archetcture:

1. Do I define my interface in a seperate class file that will be
included in my main applications project?

2. What kinds of informatition do I need to put in my interface class?

For example:
Any given plugin will contain a bunch of Windows Forms that will
interact with each other AND the main application that loads them. So
let's say I have a menu item that loads form1 from an external dll
file. Form1 will have multiple controls on it that will take data from
the user and then call from2 (also contained in this external dll).

The only cavaet is that each plug-in will need to access variables
definied in the main application as Friends.

3. If I understand this correctly, I will basically be doing three
things:
1. Creating my main application.
2. Creating a SEPERATE class library that defines an interface
(this dll will be distributed with my main app)
3. Create seperate plugins that implement that interface.

I suppose I am maybe getting a small understanding of how this is
going to work but I still need a small bit of directlion.

Thanks in Advance
Anthony
Sep 21 '08 #4
Anthony P. wrote:
Hello Everyone,

I'm totally lost and I hope someone can help me out or point me to
something that can. Here's the deal:

I have an application that will implement a 'plugin' archetecture of
sorts. The application requires the user to fill out various forms.
Each agency that we deploy the application to will have different
forms and those forms will change over time. If we build each form
into the application through hard code, changing, adding, or removing
forms requires that the entire application be recompiled and
reinstalled.

So what I'm doing is designing the forms as part of a class library.
So let's take filling out a log for example. I'll create a new class
library and then add three Windows forms to it. Let's call them
frmStep1, frmStep2, and frmStep3 (all which pass data amongst
themselves). I build my class library and let's say that is called
LogFormLib.dll. What I need to happen is that I can distribute this
dll to my users, have them drop it in a special directory and have my
application automatically pick it up and make it available via the
menu system. This way, new forms can be added by simply distributing
a new DLL that contains the code.

I know this sounds easy, and I'm sure it is somewhat, but I am totally
lost. How can I do this? Are there any tutorials?

Thanks!
Anthony
It occurs to me that you might think of this application the other way around.

If you build the "main" application as a dll, then you can build a series of
custom executable apps that use that dll. All the main processing, and perhaps
the main form, would be in the dll. Each custom app would use the dll, and
include the specialized forms and processes it needs.

I think that approach might make the whole thing easier to organize and
implement, than trying to do a plug-in architecture.

Sep 21 '08 #5
http://www.google.com/search?hl=fr&q...rlz=1W1GPRE_fr

"Anthony P." <pa*******@gmail.comwrote in message
news:bf**********************************@c65g2000 hsa.googlegroups.com...
Hello Everyone,

I'm totally lost and I hope someone can help me out or point me to
something that can. Here's the deal:

I have an application that will implement a 'plugin' archetecture of
sorts. The application requires the user to fill out various forms.
Each agency that we deploy the application to will have different
forms and those forms will change over time. If we build each form
into the application through hard code, changing, adding, or removing
forms requires that the entire application be recompiled and
reinstalled.

So what I'm doing is designing the forms as part of a class library.
So let's take filling out a log for example. I'll create a new class
library and then add three Windows forms to it. Let's call them
frmStep1, frmStep2, and frmStep3 (all which pass data amongst
themselves). I build my class library and let's say that is called
LogFormLib.dll. What I need to happen is that I can distribute this
dll to my users, have them drop it in a special directory and have my
application automatically pick it up and make it available via the
menu system. This way, new forms can be added by simply distributing
a new DLL that contains the code.

I know this sounds easy, and I'm sure it is somewhat, but I am totally
lost. How can I do this? Are there any tutorials?

Thanks!
Anthony
Sep 22 '08 #6

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

Similar topics

0
by: dale cyr | last post by:
nick: hope i'm not stating the obvious for you, but you *are* aware, i presume, that your loading app wants to find the loaded app in the loading app's runtime directory, or a sub directory of...
4
by: annoyingmouse2002 | last post by:
Hi there, sorry if this a long post but I'm really just starting out. I've been using MSXML to parse an OWL but would like to use a different solution. Basically it reads the OWL (Based on XML)...
2
by: Angelos Karantzalis | last post by:
Hi guys, I'm trying to load a class instance dynamically, and then cast it to it's base type so I can use it in my app. More specifically, I'm dynamically instantiating a...
2
by: Foehammer | last post by:
Hello, I'm trying to load an assembly dynamically using an app domain. This is a proof-of-concept for a larger project, so please excuse the lame class names. TestLib is the dll where all the...
8
by: Generic Usenet Account | last post by:
To settle the dispute regarding what happens when an "erase" method is invoked on an STL container (i.e. whether the element is merely removed from the container or whether it also gets deleted in...
8
by: Shaun C Farrugia | last post by:
I have a multi team solution being built where teams are segmented off into seperate projects. One project is an over all framework containing a Broker class responsible for instantiating...
9
by: Ender | last post by:
I have an application that I would like third party developers to be able to create Plug-ins that will be dynamically loaded into our application to extend functionality. I have utilized the...
2
by: Eric | last post by:
I'm trying to dynamically load a user control using on the .NET framework (not Visual Studio). The control was designed in Visual Studio and is named: Disable.ascx The first line is: <%@...
2
by: Andy | last post by:
I want to dynamically update a list of elements shown as a checkbox list. A file is used to store the elements, and elements can be added and deleted from the list. The trouble is that the window...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
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
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,...

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.