You might also want to look at the BEA XMLBeans which recently went open
source as this also offers the ability to directly interact with XML.
Philip
-----Original Message-----
From: An interest list for Sun Java Center J2EE Pattern Catalog
[mailto:J2EEPATTERNS-INTEREST@(protected)
Sent: 18 July 2003 13:14
To: J2EEPATTERNS-INTEREST@(protected)
Subject: Re: XML as DTO
Rao,
I have always preferred the value object via EJB remote (or business
delegate) J2EE patterns as a preferred way to cross the layers. I prefer
this to XML as I prefer to have the benefits of a compile time type checked
environment which is lessened with XML object representations. While XML is
a powerful addition to the computing environment, it is up to the
implementation (as well as the parser) to perform runtime type conversions
and type checking.
If you want a simplified approach (as for development coding effort)
you may want to look into JAXB (Part of Web Services) which is a SUN
extension to bind java object to XML and visa versa. A good intro can be
found in the Web Services tutorial (Chapter 9) at:
http://java.sun.com/webservices/docs/1.1/tutorial/doc/
It simplifies the task by creating java objects based on XML schema.
This is defined as a pre-compile step, so it would be something you would
want to incorporate into your build process (ant ot whatever). I currently
did something very similar to this, as I passed XML from remote JVM to
remote JVM. I used a java object and then made that object responsible for
serializing itself (not via java.io.Serialization, but same term) to and
from XML. This way the remaining clients of the object remained unaware of
the XML nature of the protocol and transfer.
Hope this helps you out.
Thanks,
Gary
-----Original Message-----
From: Narasimha Rao Ch. V. [mailto:narasimharao@(protected)]
Sent: Friday, July 18, 2003 1:48 AM
To: J2EEPATTERNS-INTEREST@(protected)
Subject: XML as DTO
We were thinking of implementing XML as DTO between Presentation and
Business Layer. Database won't support record sets from XML but it retrieves
record sets as XML. In this scenario is it a viable solution to use XML as
DTO or Plain Objects are better to use as DTOs?
In the earlier scenario system has to extract and build the domain object
from the XML. Any body has any idea of a solution to build domain object
from the XML?
-Rao
====================================================================
Community Web Site (Core J2EE Patterns Catalog - Online Version):
http://java.sun.com/blueprints/corej2eepatterns
Getting Started (Beta Version):
http://developer.java.sun.com/developer/technicalArticles/J2EE/patterns/
Get the book:
http://www.amazon.com/exec/obidos/ASIN/0130648841/corej2eepatte-20
List Archive:
http://archives.java.sun.com/archives/j2eepatterns-interest.html
Unsubscribing:
email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)
====================================================================
Community Web Site (Core J2EE Patterns Catalog - Online Version):
http://java.sun.com/blueprints/corej2eepatterns
Getting Started (Beta Version):
http://developer.java.sun.com/developer/technicalArticles/J2EE/patterns/
Get the book:
http://www.amazon.com/exec/obidos/ASIN/0130648841/corej2eepatte-20
List Archive:
http://archives.java.sun.com/archives/j2eepatterns-interest.html
Unsubscribing:
email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)
====================================================================
Community Web Site (Core J2EE Patterns Catalog - Online Version):
http://java.sun.com/blueprints/corej2eepatterns
Getting Started (Beta Version):
http://developer.java.sun.com/developer/technicalArticles/J2EE/patterns/
Get the book:
http://www.amazon.com/exec/obidos/ASIN/0130648841/corej2eepatte-20
List Archive:
http://archives.java.sun.com/archives/j2eepatterns-interest.html
Unsubscribing:
email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)