I often find myself needing a quick ( in terms of code ), lightweight ( in term of runtime, dependencies) persistence solution for simply a bunch of objects, mainly between application restarts.
Usually I resort to some Java serialisation hack, but I wonder if there's something better out there.
Have you used something similar?
To make it clear, a JPA-based solution is not lightweight in my book, and a JDBC-based one is not quick.
Update: I favour configuration-less frameworks over those which require configuration. For instance the Java serialisation solution requires a implements Serializable
and it works. A JPA solution, either with annotations or with mapping files would be too heavyweight.
Update 2: Just to make it clear, I don't think Serialisation is a hack. It's actually a very powerful mechanism, just that I'm using it in a hackish way when doing persistence.
I prefer XStream: Only one Jar needed, fast and very easy to use
Try iBatis. I've used it recently on a project where I wanted a JDBC abstraction w/o ORM/spring/container/etc.
Easy to setup, only a couple of small jars, and the config is very flexible. It won't give you the change-the-db-at-a-moments-notice flexibility of hibernate, et. al. but it is fairly lightweight.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With