[jdom-interest] Re: EJB Mapper (was Newbie: JDom-Test)

philip.nelson at omniresources.com philip.nelson at omniresources.com
Sun Oct 8 07:22:23 PDT 2000


> 
> > know that object serialization had to use such a slow, inefficient 
> > format; but it did.
> 
> I agree it's not great - but it beats the process of parsing 
> XML itself.
> Also, there was one tangent about passing around a JDOM document - now
> you're paying both prices (XML and Java) ;-)
> 

How are you paying both prices?  If the document was constructed in memory
and sent over as a serialized JDOM document, there is no parse.  If the
document was constructed originally from and XML document for legitimate
reasons (like an use with an external system), you only have the one parse.
The value pattern you prefer may have higher efficiency but nowhere near the
flexibility of the JDOM document used as a value object.  What if your data
is more than a simple one dimensional entity?  At one extreme you could have
lists of lists of fine grained value objects  which if accessed individually
would put you closer to the getter/setter problem the value pattern is
supposed to eliminate.  A JDOM document could handle this with one network
transfer.

> > More importantly, however, is that RMI is Java-to-Java 
> only, and even 
> > if you're only doing Java-to-Java today, it's hard to predict what 
> > you'll be using tomorrow. Using XMl for the serialization syntax 
> > makes your whole system a lot more flexible, debuggable, and 
> > upgradeable than using RMI.
> 

Absolutely.  My current project deals with thousands of electronic forms.
These forms vary from year to year.  Forms are added and dropped constantly.
The validation rules change constantly.  Adding a hand coded value object
for each of these would be a tremendous burden on my most scarce resource,
programmers.  I am constantly looking for ways to eliminate code that varies
by form.  In the past, database tables were used but because of the
hierarchal nature of XML, XML has been much easier to use.  And yet I need
the use of EJB because of the load balancing it offers.  So here is this new
XML api called JDOM which just might fit in both EJB and my forms world...

> I don't know that I buy this - I mean, you're saying don't bet on the
> entire programming language that you have chosen! RMI isn't even an
> extension, it's the core platform. While it's nice to be flexible,
> you're saying, essentially, "don't bet on Java." I can't advocate to
> anyone to choose a language for an application, but then don't bet on
> the language; it makes all the choices you make virtually 
> lose-lose. So
> I agree with you in concept, but in practice, if you choose 
> Java, you've
> chosen RMI, for better or worse. I say use it.

Shouldn't the discussion be about how to use RMI effectively since that's
the mechanism for EJB?



More information about the jdom-interest mailing list