[ Team LiB ] Previous Section Next Section

Structure

Figure 3.4 illustrates the static structure of one variety of an Object/Relational Map implementation. The PersistenceManager interface defines database operations in terms of generic domain objects. It normally defines operations for reading, writing, and deleting domain objects. This interface does not expose any database details. As an alternative, you can spread the set of persistence operations across multiple interfaces that together form a conceptual PersistenceManager abstraction.

Figure 3.4. The static structure of the Object/Relational Map pattern.

graphics/03fig04.gif

ConcretePersistenceManager provides the implementation of these operations in terms of physical database operations. It references some form of MapMetadata, which describes the domain object mapping. It also uses a PhysicalDatabaseDriver to interact with the relational database.

ConcretePersistenceManager encapsulates the data model, data access, and domain object mapping for an application.

Several variations on this structure exist in object/relational mapping standards and commerical object/relational mapping systems. One common variation decouples application code from the PersistenceManager by way of implicit framework or environment calls. Others generate mapping code that is invoked on an application's behalf.

    [ Team LiB ] Previous Section Next Section