EJB with XML

Discussions

EJB programming & troubleshooting: EJB with XML

  1. EJB with XML (4 messages)

    I would like to use EJB with Xml...I have some idea about
    XML but Iam strong in EJB,I never used XML in any of my projects.....I know XML is kind of promising technology....I would like to use XML with EJB where can I use the XML with EJB...Please throw your ideas where I can integrate and their purposes of using XML with EJB.

    Threaded Messages (4)

  2. EJB with XML[ Go to top ]

    The "Mastering Enterprise Java Beans" book (offered on this site) has a good discussion about the use of XML in J2EE applications. To paraphrase, XML is useful for legacy interfaces, document persistence, and as a web services interface, but is not useful as a communication mechanism between EJB components. It is unnecessary and adds too much performance overhead.

    XML is one of the hot technologies of late along with web services and such. I think many of us have a desire to use the latest and greatest even when it is not appropriate.
  3. EJB with XML[ Go to top ]

    Hi.

    Totally agree. My current project is totally overun with XML (againts all my arguements). XML like any protocol belongs on the out-skirts of the system. Once XML is recieved in most cases by a Servlet some mechanism to do Java-XML binding should be used to create Java Objects that reflect the request.

    If you don't you end up with XML parsing all over the place and Garbage collection issues due to having to collect all those lovely DOM structures.

    David
  4. EJB with XML[ Go to top ]

    Agree, Because XML parsing is very expensive. But some situation , we may need to use XML, for example if you want to call a Web-service from your ejb, you need to use XML.
    -siva
  5. EJB with XML[ Go to top ]

    Hi,

    You may be missing my point. I am not against XML but I think you should keep it to the interface layer in the application if possible.

    In your example XML is used to talk to a external Web Service from an EJB. My prefered design for this is that EJB takes java objects as parameters and only deals with Java Objects in its code. The EJB uses a XML message framework (like APACHE SOAP) to create the XML request and send it to the external service. The XML response is then turned back into a JAVA object by your XML messaging framework and returned to your EJB.

    David

    David