Anyone has Idea about EJB+XML combination for Data Generation?
EJB is an Object Oriented Enterprise Technology in Java. XML is a popular format of information which is not object oriented. XML is difficult to be treated as normal object for processing in Java. The way you deal with XML now is using SAX parser and DOM parser. SAX parser is event driven which is good when you only want to read information from XML. DOM parser is try to build an object tree in memory and is good for modify information in XML but use a lot of memory.
When you try to combine XML and EJB together, you will find yourself in a dilemma of using XML parsing or Object processing when your input and output are both XML. Although you can always using XML parser to deal with XML, you find yourself lost the advantage of Object processing which is easy to understand and write code. If you try to convert XML to object for processing and then convert object back to XML, you will find a lot of performance penalty. This is the situation we are currently at.
There is a tool on market now call XML-Broker which try to solve this problem by taking the advantage of object processing but still keep the performance. It convert XML schema into classes and processing the business logic in SessionBean. So you only deal with objects when you processing business logic. The XML-Broker will take the task of converting XML to object and object to XML. I haven't try it yet.
If your situation is objects as input and XML as output, then answer will be straight forward. Processing the business logic using objects and convert the objects into XML using DOM parser.
I'm looking forward to see more idea from people !
You might also take a look at the Quick project. Quick (http://jxquick.sourceforge.net/ is a java library that converts XML to Objects and Objects to XML.