Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Quick'n'dirty persistence [closed]

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.

like image 504
Robert Munteanu Avatar asked Jun 10 '09 15:06

Robert Munteanu


2 Answers

I prefer XStream: Only one Jar needed, fast and very easy to use

like image 128
GHad Avatar answered Sep 27 '22 16:09

GHad


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.

like image 45
Mike Reedell Avatar answered Sep 27 '22 16:09

Mike Reedell