[jdom-interest] JDom-Dokument: Serialized oversized
Sven Behrens
behrens at disy.net
Fri May 4 11:41:55 PDT 2001
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.
More information about the jdom-interest
mailing list