Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Please critique my EJB/XML design.

Please critique my EJB/XML design.

From: Don Chamebrs <dchambe_at_mindspring.com>
Date: Tue, 27 Feb 2001 20:21:19 -0500
Message-ID: <3kko9t8ks7nedle8nmdvtplsdm1hojcc7o@4ax.com>

I am currently designing an application that will use XML to move data between the middle tier and a browser front-end. My development environment is as follows:
Browser: IE 5.5
Web Server/App Sever: WebLogic 5.1
Database: Oracle 8i

For revision 1 of the design I have a controller class that builds the XML and returns it to the browser. Input comes to the controller class as XML but is converted to non-XML data before it moves through the system.

This is my plan for rev. 2 and I would like any input: The controller classes will always take XML documents as input and return XML documents as output.
This XML doc will then be sent to the appropriate methods in the session bean. Any business logic is then applied to the XML and the resulting XML is sent to an Entity Bean.

The entity bean will send the XML to the database for an insert or update. The entity bean will also get data from the database as XML and send to back through the system as XML.

I always plan to use a Session Bean. No database operations should be applied without going through the business logic layer (Session) (even if no business logic is needed).
The Session Bean (or any other component) will not directly access the database. All database I/O will be through an entity bean.

Data moving between the browser and the controller class will be sent as a String datatype which always represents a well formed XML document. Data moving through the middle tier (controller class, session beans, entity beans) will most likely be as a DOM object.

I have done some reading on the ability of Oracle to send a receive XML and it seems able to do it. A query can be executed will the result being returned as an XML document. I can then apply an XSLT stylesheet to convert the XML resultset to the proper XML document. I am not sure if it will work from an entity bean because of the way the PrimaryKey class must be used. I am also not sure if I can perform an update or insert in this way. Perhaps I should create a class for this database I/O and not use Entity Beans.

Another possibility it that the Entity Bean can parse the XML document and perform the insert/update as normal. Any select can be issued as normal and the XML document create by the entity bean before being returned.

Please comment on the design. Has anyone tried such a design? Does anyone see any problems with this approach?

Thanks,

   Don
   dchamber_at_mindspring.com Received on Tue Feb 27 2001 - 19:21:19 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US