Design pattern question

Discussion in 'Java' started by Olivier Scalbert, Mar 2, 2008.

  1. 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
     
    Olivier Scalbert, Mar 2, 2008
    #1
    1. Advertising

  2. On Mar 2, 12:44 pm, Olivier Scalbert <>
    wrote:
    > 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
     
    andrewmcdonagh, Mar 2, 2008
    #2
    1. Advertising

  3. Olivier Scalbert

    Roedy Green Guest

    On Sun, 02 Mar 2008 13:44:22 +0100, Olivier Scalbert
    <> 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
     
    Roedy Green, Mar 3, 2008
    #3
  4. 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



    Roedy Green wrote:
    > On Sun, 02 Mar 2008 13:44:22 +0100, Olivier Scalbert
    > <> 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, Mar 3, 2008
    #4
  5. Olivier Scalbert

    Roedy Green Guest

    On Mon, 03 Mar 2008 22:33:48 +0100, Olivier Scalbert
    <> 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
     
    Roedy Green, Mar 5, 2008
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. sunny
    Replies:
    1
    Views:
    480
    Salt_Peter
    Dec 7, 2006
  2. Bartholomew Simpson

    class design/ design pattern question

    Bartholomew Simpson, Jun 12, 2007, in forum: C++
    Replies:
    2
    Views:
    462
    Daniel T.
    Jun 12, 2007
  3. Pallav singh
    Replies:
    0
    Views:
    412
    Pallav singh
    Jan 22, 2012
  4. Pallav singh
    Replies:
    0
    Views:
    434
    Pallav singh
    Jan 22, 2012
  5. Pallav singh
    Replies:
    1
    Views:
    471
    Peter Remmers
    Jan 22, 2012
Loading...

Share This Page