Go AVDN
Lesson: Design A Persistent Class Schema
Design A Persistent Class Schema
You design table schemata with tradition relational databases, but you focus on persistent class schemata when work with TheObjectBase. Refer to the Object-Relation-Kin Model to see why and how the relational model can be natively implemented in a general purpose object oriented programming language, like Java. But you don't have to be a database theorist to start working with TOB. You'll find things rather intuitive in pratices.

Persistent Field

All non-transient instance fields of a persistent class are persistent fields.

TheObject - Root of All Persistent Classes

Like all Java objects derive from java.lang.Object , all persistent objects in TOB derive from av.tob.TheObject .

TheRelation - Whose Subclasses Can Define Ties

Imagine you have a rope with a knot at one end, another object can be tied by this knot, and you just poll the rope to get that object, as you hold the rope. You must be a relation object to be able to hold ties.

Kins are Relatives of an Object

When more than one related objects prone, it probably falls to define a Kin or KinSet field, regarding relevant Tie fields.

Loose Associations via Object ID Values

Ties and Kins produce physical object graphs loaded as wholes, so seldom used objects should be loosely associated not to hold up memory unnecessarily.

Persistence Notifications

Persistence notifications function like triggers in traditional relational databases. They are triggered behaviors at certain persistence points, and implemented as overridable instance methods of persistent objects. This chapter covers common notifications persistence applications are normally interested to override.

Inheritance

Persistent classes have an inheritance hierarchy, all things are inherited by subclasses from their super class.