JEPLA - Java Easy Persistent Layer



Project files here

Who should read this ?
Java Programmers that want’s another mechanism to persist data.

Why another mechanism to persist data ?
Because RDBMS is not OO. Its very ugly ! And the OODBMS are very difficult to learn.

The idea:
When we create a new object that we wanna to persist, why does not have a interface to implements (like Serializable, could have an Persistable) that tells to JVM to persist this object for us ? And could have a keyword to identify the fields to persist too.
The JVM dos not have this system, so we need create something to persist objects transparently to us. Java Collections have all we need to manipulate objects so, why not create Persistent Collections ? Thats what i think when create this system. Create PersistentObjects and manipulate them with Persistent Collections.

How the system works:
In Java, all you have is references for objects. In this case, you will work with references to Serialized Objects (files). So, when you serialize an Object that have another object you will serialize not the object, but a reference to a file (usually an String). So, the system use this String to restore the object.

Example:
Suppose an Garage Object that have a List of Cars.

If you serialize Garage Object, all cars will be serialized with him. That’s a problem because if you have another garage pointing to the same car, when you serialize and deserialize this two garages , you will have two diferent object cars (see last page).
Using JEPLA, this problem not happens because you will serialize not a List Of Cars, but a List of CarsIds that “points” to the Serialized Object (An File).


Examples:
In the package exists examples showing how to use the system. Its very easy, all objects that you want persist have to extends PObject (PersistentObject) and you use the Persistent Collections to manipulate them exactly like you use normal Java Collections. PersistentLayer will serialize and deserialize the objects transparently to you. All you have to do is (in methods that changes fields of your object) calls “save()” method in the end of the method body.

Get the files here




Problem of serialize without Jepla System.


SourceForge.net Logo