java-design-patterns icon indicating copy to clipboard operation
java-design-patterns copied to clipboard

Identity Field pattern

Open iluwatar opened this issue 4 years ago • 14 comments

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:

  1. Unique Identifier: Each object is assigned a unique identifier, typically a primary key in the database.
  2. Field Mapping: The identifier field in the object corresponds to a unique column in the database table.
  3. Object Persistence: Ensures that the unique identifier is consistently used when saving and retrieving objects from the database.

References

Acceptance Criteria

  1. Unique Identifier Implementation: Each domain object must have a unique identifier field that maps to the primary key in the database.
  2. Persistence Mechanism: Implement a mechanism to ensure that objects are saved and retrieved using their unique identifiers, maintaining consistent identity across sessions.
  3. Unit Tests: Provide comprehensive unit tests to validate the correct assignment, persistence, and retrieval of the unique identifiers for domain objects.

iluwatar avatar Jul 07 '20 17:07 iluwatar

I would like to work on it

lanxiang1234 avatar Apr 25 '21 02:04 lanxiang1234

Ok @lanxiang1234, go ahead!

iluwatar avatar May 01 '21 06:05 iluwatar

Please indicate if you are still working on this issue @lanxiang1234

iluwatar avatar Oct 24 '21 15:10 iluwatar

This issue is free for taking again.

iluwatar avatar Nov 28 '21 07:11 iluwatar

hi, can I work on this issue?

lkpengcs avatar Mar 19 '22 02:03 lkpengcs

Sure @lkpengcs, I'll assign it to you

iluwatar avatar Jul 01 '22 15:07 iluwatar

@lkpengcs are you working on it?

iluwatar avatar Sep 21 '22 17:09 iluwatar

Hi, can I work on it?

YuechenL-Kristy avatar Oct 12 '22 03:10 YuechenL-Kristy

Assigned to @YuechenL-Kristy

iluwatar avatar Oct 13 '22 17:10 iluwatar

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 28 '22 12:11 stale[bot]

@YuechenL-Kristy, hopefully you find time to address the review comments and we can complete this issue?

iluwatar avatar Dec 03 '22 17:12 iluwatar

I would like to work on this issue and finally complete it after so many inactive attempts (: Can this be assigned to me under hacktoberfest label?

ASHUdev05 avatar Oct 04 '23 15:10 ASHUdev05

Can the PR be reviewed if possible? I am actually speed running hacktoberfest so if this gets on time I will be on target count (:

ASHUdev05 avatar Oct 11 '23 04:10 ASHUdev05

This issue has been automatically marked as stale because it has not had recent activity. The issue will be unassigned if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Dec 10 '23 04:12 stale[bot]