You want to separate persistence from your object model.
- You want to avoid putting persistence details in your Business Objects.
- You do not want to use entity beans.
- Your application might be running in a web container.
- Your object model uses inheritance and complex relationships.
Use a Domain Store to transparently persist an object
model. Unlike J2EE’s container-managed persistence and bean-managed
persistence, which include persistence support code in the object model,
Domain Store's persistence mechanism is separate from the object
- Custom Persistence Strategy
- JDO Strategy
- Creating a custom persistence framework is a complex task
- Multi-layer object tree loading and storing requires optimization
- Improves understanding of persistence frameworks
- A full-blown persistence framework might be overkill for a small object
- Improves testability of your persistent object model
- Separates business object model from persistence logic
- Unit of Work [PEAA]
Maintains a list objects affected by a business transaction. Unit of
Work closely relates to PersistenceManager.
- Query Object [PEAA]
An object that represents a database query. Relates to the Query role
described in Domain Store.
- Data Mapper [PEAA]
A layer of Mappers that moves data between objects and database. Relates
- Table Data Gateway [PEAA]
An object that acts as gateway to a database table. Relates to StoreManager.
- Dependent Mapping [PEAA]
Has one class perform the database mapping for a child class. Relates
to parent dependent object and PersistMap.
- Domain Model [PEAA]
An object model that has behavior and data. Relates to BusinessObject.
- Data Transfer Object [PEAA]
Same as Transfer Object.
- Identity Map [PEAA]
Ensures each object only gets loaded once. Relates to StateManager.
- Lazy Load [PEAA]
An object which contains partial data and knows how to get complete
data. Relates to StateManager and StoreManager interaction for lazy