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
andrewmcdonagh - 02 Mar 2008 18:53 GMT
On Mar 2, 12:44 pm, Olivier Scalbert <olivier.scalb...@algosyn.com>
wrote:
> Hello,
>
[quoted text clipped - 15 lines]
>
> 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
Roedy Green - 03 Mar 2008 21:08 GMT
On Sun, 02 Mar 2008 13:44:22 +0100, Olivier Scalbert
<olivier.scalbert@algosyn.com> wrote, quoted or indirectly quoted
someone who said :
>Are there any design patterns that can help us for dynamically adding
>such logic into the application.
Try just reading a bit about each pattern and see if you can see how
it might solve part of your problem.
See http://mindprod.com/jgloss/designpatterns.html
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
Olivier Scalbert - 03 Mar 2008 21:33 GMT
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
> On Sun, 02 Mar 2008 13:44:22 +0100, Olivier Scalbert
> <olivier.scalbert@algosyn.com> wrote, quoted or indirectly quoted
[quoted text clipped - 12 lines]
> The Java Glossary
> http://mindprod.com
Roedy Green - 05 Mar 2008 08:12 GMT
On Mon, 03 Mar 2008 22:33:48 +0100, Olivier Scalbert
<olivier.scalbert@algosyn.com> wrote, quoted or indirectly quoted
someone who said :
> 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
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com