Re: simple persistence without databases
From: Robert Klemme (bob.news_at_gmx.net)
Date: 03/09/05
- Next message: Dennis Neetix: "Problem with JDBC MSSQL"
- Previous message: Luke Webber: "Re: ODB (Cache?) vs ORM"
- In reply to: slothbear: "simple persistence without databases"
- Next in thread: slothbear: "Re: simple persistence without databases"
- Reply: slothbear: "Re: simple persistence without databases"
- Reply: ableofhighheart_at_gmail.com: "Re: simple persistence without databases"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 9 Mar 2005 14:50:57 +0100
"slothbear" <farbot@gmail.com> schrieb im Newsbeitrag
news:1110311527.226614.104670@f14g2000cwb.googlegroups.com...
> I have a simple application that has been using standard serialization
> for the save format. I have a small user community; no one has
> complained about the save format breaking with each new version
> (because I change class structure). But ... it is kind of
> unprofessional and I would like to fix it.
>
> A "real" database looks like overkill. Some of the smaller options
> (M.A.O.S., db4o) look interesting, but they are still kind of
> heavy/complicated for my little program (which is currently 88K).
>
> My current plan is to save one big Map, which will contain an
> assortment of smaller Maps with simple types. That will get rid of the
> class structure dependency. Much of the data are already in Maps (of
> simple types), so the save/load code will not have to do much juggling
> of values.
>
> Does that sound like a reasonable plan, or has my searching/researching
> overlooked a more simple method?
Yes, I think so. Please take a look at XML bean serialization. That way
it's human readable (well, sort of) but more important so, you can load
old configs with new classes. And as long as you just add members, you
don't have to do anything to read the old config. I guess it becomes more
complicate if you rename fields etc.
http://java.sun.com/products/jfc/tsc/articles/persistence4/
http://java.sun.com/j2se/1.4.2/docs/api/java/beans/XMLEncoder.html
http://java.sun.com/j2se/1.4.2/docs/api/java/beans/XMLDecoder.html
Kind regards
robert
- Next message: Dennis Neetix: "Problem with JDBC MSSQL"
- Previous message: Luke Webber: "Re: ODB (Cache?) vs ORM"
- In reply to: slothbear: "simple persistence without databases"
- Next in thread: slothbear: "Re: simple persistence without databases"
- Reply: slothbear: "Re: simple persistence without databases"
- Reply: ableofhighheart_at_gmail.com: "Re: simple persistence without databases"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|