Persistent Objects for Java

Basic Concept

Three basic concepts summarize the operation of the persistent object abstraction layer:

  1. Every table corresponds to a class.
  2. Every table row corresponds to an instance of the table's class.
  3. Every attribute in a table row corresponds to a member of the table's class.

As far as the application is concerned, the database is a container of objects

The authoritative source of persistent data is always the database. In general, it must be assumed that multiple processes are reading and writing to the same database at the same time. This means, that all objects and their state held locally be the application are only copies of the original data, and may become out of date immediately after they were taken from the database. (This is another aspect of a shared database that is not abstracted away by PObjects, although some features of its implementation try to lessen the impact of this fact.)

As far as possible, data items from the database are presented to the application in a format suitable for easy access by the programming language. For example, a table attribute like VARCHAR(n) is mapped onto String objects, while a foreign key constraint is translated into a object reference (aka pointer) representing the row of the key's target table.

Basic Assumptions

A number of basic assumptions guide the design and implementation of the persistence layer: