Design pattern question

  • Thread starter Olivier Scalbert
  • Start date
O

Olivier Scalbert

Hello,

We are going to develop an application that will process incoming JMS
messages.
The application will receive JMS messages, process them based on their
types, and reply by sending a new JMS message with usefull info (at
least I hope.

This application will run in a EJB container (parhaps GlassFish).
Some messages processing need db access.

In the future, new message types (and new processing) will be added.

Are there any design patterns that can help us for dynamically adding
such logic into the application.

Thanks very much,

Olivier
 
A

andrewmcdonagh

Hello,

We are going to develop an application that will process incoming JMS
messages.
The application will receive JMS messages, process them based on their
types, and reply by sending a new JMS message with usefull info (at
least I hope.

This application will run in a EJB container (parhaps GlassFish).
Some messages processing need db access.

In the future, new message types (and new processing) will be added.

Are there any design patterns that can help us for dynamically adding
such logic into the application.

Thanks very much,

Olivier

Hi Olivier,

There isn't a single pattern to do all that you require...as such a
beast wouldn't be a good pattern. You will need to use several
patterns together...

You will probably be automatically using a publish/subscribe pattern
when handling the JMS new message event.


The processing of this event would naturally fit any of the
Behavioural Patterns, but I would look at the Strategy and Command
Patterns.

HTH

Andrew
 
O

Olivier Scalbert

Thanks for the help.
I definitively need to read Core J2EE Design Patterns ...

The J2EE application will contain different message transformations. The
mapping between messages types and transformations will be configured
via a table. The main problem is that user wants to be able to add
dynamically new transformations (java code or jar files) into to EJB
container. No idea of how to do that ...

Olivier
 
R

Roedy Green

The main problem is that user wants to be able to add
dynamically new transformations (java code or jar files) into to EJB
container. No idea of how to do that ...

The usual technique is to use a delegate that implements some
interface.

The Visitor pattern uses a delegate which might be a way to get your
head around the way they work in a simple case.

Think about how Sun handles JDBC drivers or JCE implementations. The
implementations implement a standard interface. Then you can
dynamically load an implementation by name, register it, and select
it.

You can put your loadedl/available implementations into a HashMap
looked up by name (class name).

see http://mindprod.com/jgloss/delegate.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top