Table of Contents
Object-relational mapping systems have come into popularity in the last few years. These systems allow the developers to do their job and the data store specialists (typically DBAs) to do theirs. Rows of data pulled from the data store are translated into objects with which developers can work easily. They can make modifications to these objects and save them back to the data store without any knowledge of exactly how to save them there.
Xyster makes use of an ORM system that employs the Data Mapper design pattern, as opposed to the Active Record pattern of some renown. Under this pattern, objects that represent rows in the data store have no knowledge of how to store themselves. Mapper objects exist to facilitate any reads or writes to or from the data’s source. Records in a persistent store are represented as objects called data entities. Groups of these entities are gathered in strongly-typed Sets.
Each type of entity must have three classes to work with the ORM system.
The entity class (which extends Xyster_Orm_Entity
)
Just a container for each record's data. It has no knowledge of how to store itself.
The entity set class (which extends Xyster_Orm_Set
)
A container for multiple entities
The entity mapper class (which implements Xyster_Orm_Mapper_Interface
)
Responsible for CRUD operations (create, retrieve, update, delete) against entities.