heh,
1. Are you worried about runtime memory (that is you don't actually
want to load all the data into your program at once)?
2. Are you worried about the size of the persistane storage?
3. Do you need search abilities that aren't part of your data objects?
If you answer yes to 1, then a database is probably your only choice.
I'd really only worry about this, if your data starts running into the
10s/100s of megabytes.
How about the standard java XMLEncoder class (I think its in the beans
package) as an option even though you don't want XLM or flat file. Why
XMLEncoder/decoder? ...because its really easy to use, even though you
don't actually want to use it
As long as all the object you want to store:
1. have default constructors
2. have get/set in standard form for all members
you should be okay. You can perform custom delegates and stuff, but
for the most part, the two rules above are plenty.
The big advantage of XMLEncoder is that you can add/delete members
without dropping file support. I've had to use this 'feature' many
many many times.
Suppose in version1 of class ABC, there are 3 member variables m1, m2,
m3. I save several XMLencoder files in under version1. In version2, I
add member variable m4, and remove m2. A version2 program can still
read a version1 file.
The downside is of course a larger file size. If you really wanted to
be cool, you could zip the file as well, and unzip on load
(java.util.zip). This way, you get the ease of XML encoder, with
little persistance storage.