Monday, 8 March 2010

Persistence layers in the Apache Aries Blog Sample

When we first added the Blog Sample to Apache Aries there was no support in Aries for JPA, so the sample was written with a JDBC persistence layer. Over the past month or so JPA support has been added to Aries, as a result I spent some time last week getting a new JPA version of the blog persistence layer to work on Aries components.

The samples in Aries are deigned so that they run on an OSGi platform which pulls in just enough components to run the application, for the blog sample we use Equinox as a base and build up from there.

Here are a couple of small statistics comparing the JPA and JDBC persistence implementations in the Aries blog sample:

The Java code is much more concise using JPA, the complexity has all moved into the platform. Which is, of course, the right way to go.