-
-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Open
Description
Description
The Identity Field design pattern ensures that each object in a system has a unique identifier, which can be used to track the object independently of its database representation. This pattern is particularly useful in systems where objects need to be reconstituted from a persistent storage medium, ensuring that each object retains its unique identity across different sessions and operations.
Main Elements of the Pattern:
- Unique Identifier: Each object is assigned a unique identifier, typically a primary key in the database.
- Field Mapping: The identifier field in the object corresponds to a unique column in the database table.
- Object Persistence: Ensures that the unique identifier is consistently used when saving and retrieving objects from the database.
References
- Martin Fowler's Identity Field
- Source Code Examples - Identity Field Pattern
- Project Contribution Guidelines
Acceptance Criteria
- Unique Identifier Implementation: Each domain object must have a unique identifier field that maps to the primary key in the database.
- Persistence Mechanism: Implement a mechanism to ensure that objects are saved and retrieved using their unique identifiers, maintaining consistent identity across sessions.
- Unit Tests: Provide comprehensive unit tests to validate the correct assignment, persistence, and retrieval of the unique identifiers for domain objects.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Projects
Status
Todo