Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Process/work flow in Java

Tags:

java

I've got a specific project that I need to undertake and I would like some guidance from the masters before I take my first step.

We have a number of applications that receives input from some external sources (i.e. file, XML-RPC, web-service, etc), then processes it in some way, applying rules to it, communicating with other external systems (possibly), accessing a database (maybe) and then sending back a response. We are maintaining different versions of the same application to cater for all the small differences between our clients. (Yes, yes, I know. It's terrible, that's why I want to fix it...)

The idea I am playing with is to have a component based architecture where different components can be wired together through configuration and the flow of information is governed through business rules. It must, in essence, be possible to give each client a copy of the program with a different set of configuration. I am even dreaming of a GUI-based application where a system can be wired together in a VB-style drag and drop fashion.

Now, the above sounds definitely like something that has been done before... and I do not want to reinvent the wheel. The problem is that the above has to be able to handle high volumes of real-time transactions, so I am not sure whether something like BPEL will be the right choice.

Any recommendations before I go and make the wheel rounder?

like image 514
Jaco Van Niekerk Avatar asked Nov 13 '22 22:11

Jaco Van Niekerk


1 Answers

I would write a very simple XML dialect for your application. Keep element-types to a minimum, and use class="my.class.name' attributes to build the correct class-instances at run-time. This makes it easy to have, say, a element with 3 implementations (for instance <source class="my.package.XmlRpc">, <source class="my.package.LocalFile"> and <source class="my.package.WebService">). Each element-type, once instantiated, should read its XML contents to find any additional data it needs to configure itself correctly.

There are many easy-to-use XML parsing libraries (I recommend JDom), and there is a lot of tool support for XML viewing and editing. XML is easy to document, work with, and wrap into GUIs.

So: each component gets an element-type, and their specific implementation-dependent configurations are buried inside the elements. If you have simple wiring (specific component instances are only used in a single place), you can get away with inclusion. If you have complex wiring (you need to reuse component instances in several places; for instance, you want to re-use filters or compute intermediate results), first you define the component instances, and then you build the wiring out of references to these instances.

I am essentially advocating something like Ant build-files, and for keeping things as simple as possible.

like image 83
tucuxi Avatar answered Nov 15 '22 12:11

tucuxi