• Post Reply Bookmark Topic Watch Topic
  • New Topic

Plugin architecture, design help please  RSS feed

 
Joe Areeda
Ranch Hand
Posts: 334
2
Java Netbeans IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's the situation, oversimplified of course.

We have a large distributed database of scientific data streams. Actually it's huge, total archive is on the order of 5 Petabytes, but that's irrelevant to this question.

I'm working on a Java/Tomcat/Apache app that accesses remote data servers (using a proprietary protocol) and displays charts and graphs and various analytical results of this stuff.

Since I am no where near smart enough to anticipate what kinds of analysis the scientists and engineers on the project will want to see I'd like to use plugins for all the display generation. And to make life more complicated there is a large set of existing software that does some very sophisticated analysis with pretty pictures as the output (that means I don't understand how most of them work).

I'd like to discuss with the Ranchers the general design issues of plug in architectures. It's still early in the development. The prototype is taking shape but haven't started the data display part yet.

What I have in mind:

  • All plugins will be derived from an abstract base class that supplies data, arguments and has methods to return text, tables and images
  • There will be a descriptor document that contains info for the user (help), description of input needed and output produced
  • Plugins will exist in a subdirectory of their own with jars, executables, and ancilary files. The only restriction is that it have a descriptor and a jar that implements the abstract base class.
  • So plugins can generate the results themselves or be conduits to pass input data to external programs and return the results
  • The plugins will not be compiled into the application war but will be dynamically loaded jar files.


  • I would just like to hear your opinion on what I'm missing and where you think I'll run into trouble.

    I'm not worried about malicious plugins, but I do make a lot of stupid mistakes in development so plugins will have no direct access to database tables or the output stream.

    Please let me know what you think, I know this idea is only half-baked.

    Joe
     
    Jelle Klap
    Bartender
    Posts: 1952
    7
    Eclipse IDE Java
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    This might be an interesting topic for you to read and take part in: http://www.coderanch.com/t/578942/patterns/OSGI-big-data
     
    Joe Areeda
    Ranch Hand
    Posts: 334
    2
    Java Netbeans IDE Tomcat Server
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thanks Jelle,

    That gives me something to read.
     
    William Brogden
    Author and all-around good cowpoke
    Rancher
    Posts: 13078
    6
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    What a lovely problem!

    When I have done this sort of thing (much simpler than your problem), I have used Interfaces rather than an abstract base class - other things that worked:

    XML for flexible configuration.

    Collections are very flexible for passing arbitrary data to and from your plugins.

    Bill
     
    Joe Areeda
    Ranch Hand
    Posts: 334
    2
    Java Netbeans IDE Tomcat Server
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thanks Bill.

    It is a fun project and I've gotten my feet wet with Shibboleth and Kerberos.

    I like your suggestion for interfaces instead of base classes, it doesn't restrict me at all and allows more flexibility in the plugin.

    I was planning on xml under the covers to define with the base class/interface doing all the encoding and decoding and the plugin doing a getParameter type call.

    Collections also were going to be hidden in the base class/interface. I see the plugin making calls like add text to header or footer. Here's an image with a title and a legend. Here's a table. The the base class/interface would then create html or a pdf to present the results. One request can have multiple datasets and multiple analyses per dataset. I'm still not sure how to handle analyses that require more than one dataset (like correlations, and transfer functions) but I'm still scheming.

    Yours is exactly the kind of discussion I was hoping for.

    Joe
     
    Don't get me started about those stupid light bulbs.
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!