project structure

  • Thread starter Thread starter nondos
  • Start date Start date
N

nondos

Hello,



I need to build a project that have menu and two sub programs I thought
doing it by creating two controls and one main form which will be the menu
and will link to the controls.

Is this the best way of doing it or there's another way? Maybe create each
sub program as project and link to it?

How do I load/unload control from form or load/unload project into the main
form



Thanks
 
nondos said:
I need to build a project that have menu and two sub programs I thought
doing it by creating two controls and one main form which will be the
menu and will link to the controls.

The classic "Plug-In" model.
Is this the best way of doing it or there's another way? Maybe create
each sub program as project and link to it?

You'll need several assemblies to make this work:

Your first assembly defines a couple of interfaces:
(a) The properties/methods that each and every plugin must support, e.g.
, say, Load(), Save(), Refresh()
(b) Any methods that the host application will make available to the
plugins, say, Display( something As IPlugIn ).

Your second assembly is the hosting application.
/Only/ reference the Interfaces assembly, never any of the individual
PlugIns. This prevents you from writing "non-standard" plugins that
/will/ cause you problems later on :-(

Last, you need the individual PlugIn assemblies. Again, /only/
reference the Interfaces assembly, never the hosting application.
You could have one plug-in per assembly, or lots; its up to you.

The Hosting application needs a way of loading the PlugIns - scanning
the host's program directory for dll's, loading each and using those
Classes that implement the "IPlugIn" Interface is probably easiest.

HTH,
Phill W.
 
Back
Top