No subject


Fri Aug 6 17:04:17 PDT 2004


Default serialization is very versatile but not space or time efficient, which is why
data structures need to implement their own form (with Externalizable, or
readObject/writeObject) if they're going to be used in high-performance
serialization/RMI applications.

  - Dennis

Dennis M. Sosnoski
Sosnoski Software Solutions, Inc.
http://www.sosnoski.com

Sven Behrens wrote:

> Hallo,
>
> I am very new to JDom and just had the following idea:
>
> "Use the JDOM-Document to store a complex database-entity composed of
> entries from many tables in the database scheme, because I can benefit
> from an XML-presentation."
>
> This will be a part of a result I have to communicate via RMI. So this
> needs to be compact for performance-reasons.
>
> Currently (and since several years, no collection-classes where
> available) I am using a very simple generic selfmade AttributeContainer.
>
> It is clear, that XML is not a compact format, but I hoped a
> JDOM-Document in a serialized form could be more compact. However, the
> result of a very short test was, that a serialized JDOM-Document is
> about twice as large as the original XML-Document:
>
> -rw-r--r--   1 behrens  users      585762 Mai  4 11:58 T02_address.ser
> -rw-r--r--   1 behrens  users      338496 Mai  3 17:58 T02_address.xml
> -rw-r--r--   1 behrens  users        6520 Mai  4 11:58 T03_catalogue.ser
> -rw-r--r--   1 behrens  users        3023 Mai  3 17:59 T03_catalogue.xml
> -rw-r--r--   1 behrens  users     8487727 Mai  4 12:00 T04_search.ser
> -rw-r--r--   1 behrens  users     4450154 Mai  3 17:59 T04_search.xml
>
> (I have not yet compared the size of my AttributeComposition to that of
> an JDOM-Dokument containing the same information)
>
> My Questions:
> - Will this improve in feature versions of JDOM?
> - Does anybody use JDOM in a similar manner?
> - Is there a better solution. (I could use my AttributeComposition for
> communication and convert it to jdom at the right place, but i want to
> get rid of them.)
> - Did I miss something?:
>
> <code>
>     DOMBuilder domBuilder = new DOMBuilder(domParserAdapter, validate);
>     doc = domBuilder.build(new File(filename));
>
>     FileOutputStream file = new FileOutputStream(getFileName(filename));
>     BufferedOutputStream bos = new BufferedOutputStream(file);
>     ObjectOutputStream oostream = new ObjectOutputStream(bos);
>     oostream.writeObject(doc);
> </code>
>
> Thanks in advance,
>     Sven Behrens.
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com




More information about the jdom-interest mailing list