Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » J2EE Pattern »

Re: XML as DTO

tetsuo

2003-07-21

Replies:

Rao,

I don't think so. Direct object serialization is much faster than XML
creation/serialization/parsing. XML is simple to humans (not really, but
better than binary). To computers, XML is complex, binary is simpler.

XML, in the end, serves best to integration. Using it to plug layers or
clients-servers may be the way if there is some reason to do so (clients
from different platforms, for example, which is a form of integration).
If not, it's just throwing away processor cycles.

Tetsuo


Narasimha Rao Ch. V. wrote:
> Hi Shivaji,
>
>
>
> Main interest is presentation layer should be pluggable. Will it improve
> the performance of the system since the communication reduces the
> complicated data structure with plain xml? (String)
>
>
>
> -Rao
>
>
>
>
>
> -----Original Message-----
> *From:* An interest list for Sun Java Center J2EE Pattern Catalog
> [mailto:J2EEPATTERNS-INTEREST@(protected)
> *Sent:* Sunday, July 20, 2003 5:50 AM
> *To:* J2EEPATTERNS-INTEREST@(protected)
> *Subject:* Re: XML as DTO
>
>
>
> Hi Rao,
>
> I think project Castor would give a good solution.
>
> It would be great if you could let us know why you would love to have
> XML as DTO. I have used XML DOM objects is large scale projects as
> Business objects and they have always been performance overheads. I
> would think using normal Java Objects or POJOs should be a good
> solution. In case you would want to integrate to other system and that
> is the reason why you may have chosen XML as DTO, I would think you
> might like to use a factory to and selectively use XML or POJO as your DTO.
>
> I think the reason for going for XML as DTO would be of good intrest to
> the group.
>
>
>
> Shivaji
>
> *"Moore, Gary" <gmoore@(protected)>*
> Sent by: An interest list for Sun Java Center J2EE Pattern Catalog
> <J2EEPATTERNS-INTEREST@(protected)>
> 07/18/2003 07:14 AM EST
> Please respond to An interest list for Sun Java Center J2EE Pattern Catalog
>
> To: J2EEPATTERNS-INTEREST@(protected)
> cc:
> bcc:
> 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)
>

====================================================================
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)


©2008 junlu.com - Jax Systems, LLC, U.S.A.