Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / April 2005

Tip: Looking for answers? Try searching our database.

Architecture advice

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John - 29 Apr 2005 23:40 GMT
Hi

I am designing a brand new vb.net application. My aim is to have the main
app as a shell only and all real functionality is provided by plug-in
modules. Modules are to be loaded at runtime depending on which modules are
present. Modules also need to communicate to the main app to display such
and such toolbar and menu options. Main app needs to pass on toolbar & menu
selection to the current module. Some modules have UI elements (form). Its
ideal to have the modules as executables so they can be tested while under
development on their own too. What sort of infrastructure I am looking at?
Ideally I would like to do this in vs 2005 beta2.

Thanks

Regards
Nick Malik [Microsoft] - 30 Apr 2005 18:26 GMT
Ultimately, this isn't all that difficult.  Your main app will need to
define the interface that all of your plug ins will use.  The main app will
look to either a config file, or perhaps a local directory or registry entry
where mutiple config files can be referenced.  That will provide the app
with the name of the plug-in that you need to call.

I'd suggest setting it up so that the main app opens, looks for a list of
plug-ins (registry perhaps), and then calls each one, passing in an object
that contains a representation of the menu structure.  The plug in will add
items to the object representing changes to the menu structure that each
plug-in wants to see.

You could use delegates, or more simply, you could use a command pattern,
whereby the menu item would produce a "command" event that the main app
would send to the plug-in that registered the menu entry.

Your main app should probably create an abstract base class for any windows
that the plug-ins will need to open.  That way, the plug in apps will
inherit from that base class instead of inheriting directly from
windows.forms.form.  That way, you can have some control over the list of
windows that are open, and your main app will have a mechanism for doing
things like sending a "close" event to all windows when the system shuts
down or the user indicates "Exit" from the File menu.

Signature

--- Nick Malik [Microsoft]
   MCSD, CFPS, Certified Scrummaster
   http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
  I do not answer questions on behalf of my employer.  I'm just a
programmer helping programmers.
--

> Hi
>
[quoted text clipped - 11 lines]
>
> Regards
John - 30 Apr 2005 20:12 GMT
Hi Nick

Many thanks for the detaild reply.

What sort of mechanism should the main app use to load the plug-in modules?

Thanks again.

Regards

> Ultimately, this isn't all that difficult.  Your main app will need to
> define the interface that all of your plug ins will use.  The main app
[quoted text clipped - 36 lines]
>>
>> Regards
Nick Malik [Microsoft] - 30 Apr 2005 20:46 GMT
The string in the registry would contain the name of the plug in, and the
main app would use reflection to load it up.  Look up LoadLibrary

Signature

--- Nick Malik [Microsoft]
   MCSD, CFPS, Certified Scrummaster
   http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
  I do not answer questions on behalf of my employer.  I'm just a
programmer helping programmers.
--

> Hi Nick
>
[quoted text clipped - 47 lines]
>>>
>>> Regards

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.