- Motivation
- Saves a database ID field in an object to maintain
identity between an in-memory object and a database row.
- Summary
- Business object only store ID filed of data row and use the ID key to operates on data row in data table directly.
- Challenging part is to select correct key property and primary key is most preferred choice.
- I would mark this pattern obsolete for custom implementation because frameworks like EF provides similar logic but still can be used for very simple Domain Model.
- When to Use
- Business object are simple and making frequent database calls are acceptable.
- Related Patterns
- This pattern generally used with Domain Model or Row Data Gateway.
- Identity Map is an alternative pattern that can be used in replacement this pattern.
|
|