Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Container or Framework to launch classes

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am looking for a framework like application, which I can plug in selected classes to. These classes will have different jobs.

E.g. MyMainApp will run all the time (controlling the plug-ins??). Plug-in A, B or C or a combination of the three can be configured to start up with MyMainApp.

All my searching has turned up nothing yet, I fear it is because I am not using the correct terminology. Please could some-one help me with the correct words to use in my search.

Many Thanks
Sean
 
Sean Riley
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As it always happens while I was gathering my thoughts about how to post this request, I came up with more terms to use in my search.

I have stumbled upon Java Plugin Framework. I will continue down this road for a while.

Has any-one any experience with this framework? Are there any others like it?

Many Thanks
Sean
 
author and iconoclast
Posts: 24203
44
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Depending on the type of application, you might consider using the Eclipse platform (www.eclipse.org) which is designed for doing this kind of thing in a desktop app, or an "application server" (Tomcat, JBoss, etc.) Servlets and EJBs are really just another way to look at plug-ins.
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For me the breakthrough to plugins was the "Dependency Inversion Principle". It means that the engine is calling the plugins, but the compile-time dependency is inverted - the plugins must reference the engine to compile.

So the engine package might have the Engine class and the IPlugin interface. You can compile this, bundle it up in a jar and sell it on EBay.

You build the plugin package later. Maybe folks who bought your jar on EBay build their own plugins to work with your Engine, kind of like people write plugins for Eclipse. Plugin packages have classes that implement the Plugin interface.

We glue them together with configuration and some form "Dependency Injection". The Engine winds up with code like:

The factory can return new plugins that the Engine authors never heard of. The factory might say

Does that sound fun? If so, Google for more good stuff on Dependency Inversion and Dependency Injection.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic