Results 1 to 7 of 7

Thread: OXM solutions

  1. #1
    Join Date
    Oct 2006
    Location
    New Jersey
    Posts
    6

    Default OXM solutions

    I'm building JMS communication layer in my spring application, which will directly send/receive or pub/sub to Tibco EMS. This part works fine. My next step is to convert my ArrayList of POJOs to XML and send it out...

    I'm wondering so many different ways we can do the work, but which is the best way to do it?
    - pure Java XML solution: DOM, SAX
    - j2ee XML solution: JAXP, JAXB
    - open source solution: castor, XMLBean, XStream...
    - spring solution: oxm packages which wrapped the above things

    Welcome any recommendations and advice.

  2. #2
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    Quote Originally Posted by henry View Post
    I'm building JMS communication layer in my spring application, which will directly send/receive or pub/sub to Tibco EMS. This part works fine. My next step is to convert my ArrayList of POJOs to XML and send it out...

    I'm wondering so many different ways we can do the work, but which is the best way to do it?
    - pure Java XML solution: DOM, SAX
    - j2ee XML solution: JAXP, JAXB
    - open source solution: castor, XMLBean, XStream...
    - spring solution: oxm packages which wrapped the above things

    Welcome any recommendations and advice.
    Without any requirements, it is hard to give good advice. For instance, if speed is of importance, it is always a good idea not to use any XML marshalling technique, since they are always slower then manual XML handling (especially if using StaX or SAX).

    The only advice I can give you is to localize your choice of technology. Whatever technology you choose, make sure it is only used in only place, hidden behind an generic interface (i.e. without throwing framework specific checked exceptions). Using this design, you can always change the implementation used.
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  3. #3
    Join Date
    Dec 2005
    Posts
    269

    Default

    One can make use of OGNL in such a marshalling tool. I just wrote such an unmarshaller, which weighs only 250 lines of code, but offers functionalities and simplicity that the Castor can only dream of

  4. #4
    Join Date
    Oct 2006
    Location
    New Jersey
    Posts
    6

    Default

    Arjen,

    Thanks for your advice.

    The speed is one of concern along with flexibility, extensibility, and scalability like any enterprise application requirements. Considering those facts, I think I will use both mechanisms - XML marshalling and MessageConverter from spring jms package - to do the conversion work depending the specific requirement. But the spring's SimpleMessageConverter only supports conversion of TextMessage, BytesMessage, and MapMessage. I didn't find anything to support ArrayList, Set, or other complex data types. I think probably we need to develop our own customized MessageConverter. Any advice?

    As you suggested in design, I have already written a common jms layer to handle all messaging implemention to/from various destinations - tibco ems, MQ, and other jms providers.

  5. #5
    Join Date
    Oct 2006
    Location
    New Jersey
    Posts
    6

    Default

    Quote Originally Posted by Injecteer View Post
    One can make use of OGNL in such a marshalling tool. I just wrote such an unmarshaller, which weighs only 250 lines of code, but offers functionalities and simplicity that the Castor can only dream of
    This sounds good. If it's possible, can you have a sample which do the complex type conversion using OGNL?

  6. #6
    Join Date
    Oct 2006
    Posts
    2

    Default

    Quote Originally Posted by henry View Post
    As you suggested in design, I have already written a common jms layer to handle all messaging implemention to/from various destinations - tibco ems, MQ, and other jms providers.
    Henry,
    Did you completely write a jms layer, or did you use Springs JMS abstraction framework?
    Greetings,
    Hans Beemsterboer

  7. #7
    Join Date
    Oct 2006
    Location
    New Jersey
    Posts
    6

    Default

    Quote Originally Posted by beemsoft View Post
    Henry,
    Did you completely write a jms layer, or did you use Springs JMS abstraction framework?
    Greetings,
    Hans Beemsterboer
    I use Spring way to write whole jms layer, which includes JmsTemplate, JndiTemplate, MDP... Also, I combine StAX to marshal/unmarshal java collection to/from XML. It's great experience.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •