Skip to content

Identity map pattern

A unit-of-work cache that guarantees one in-memory object instance per persistent database identity within a declared context.

Version
v1 · 2026-09-08 · History
Domain-specific #
4957
Origin domain
enterprise software
Subdomain
enterprise software

Core Idea

An identity map keys loaded objects by persistent identifier and returns the existing instance on repeat retrieval, preventing duplicate representations and inconsistent updates during one session or transaction. A repository consults the map before loading, registers newly materialized objects under their identity and clears or scopes the map at a defined lifecycle boundary. The abstraction is therefore identified by a declared carrier, a transformation or constraint over that carrier, and an invariant that tells an analyst whether the named structure is genuinely present.

Scope of Application

Identity map pattern belongs to enterprise software and is useful where the analyst can specify the typed enterprise software carrier, including its objects, relations, parameters, conventions, evidence, boundary cases, and comparison targets, then evaluate the persistence identity and object type, map key, session or unit-of-work scope, lookup-before-load rule, registration timing, concurrency and invalidation policy and same-instance guarantee are explicit. The scope is broad within that domain but bounded by the need for the persistence identity and object type, map key, session or unit-of-work scope, lookup-before-load rule, registration timing, concurrency and invalidation policy and same-instance guarantee are explicit. The entry records a descriptive analytical identity; practical use requires the governing domain's evidence, standards, and safety obligations.

Clarity

The abstraction clarifies a crowded vocabulary by making the persistence identity and object type, map key, session or unit-of-work scope, lookup-before-load rule, registration timing, concurrency and invalidation policy and same-instance guarantee are explicit the center of the account. A claim should name the carrier, the governing operation or relation, the applicable assumptions, and the recognition test. A bare label is insufficient because the name Identity map pattern can be used for a formal identity, an implementation, or a neighboring result unless carrier and convention are stated.

Manages Complexity

Without the abstraction, an analyst must reason directly over many local details: the carrier roles, admissibility assumptions, competing conventions, derived invariants, boundary cases, and proof or validation obligations specific to Identity map pattern. Identity map pattern compresses them into the roles in the structural signature. That compression permits comparison across instances without erasing the variables that determine validity. It also exposes which details may be varied safely and which are constitutive.

Abstract Reasoning

  1. Identify the carrier. State what the elements, states, objects, or observations are: the typed enterprise software carrier, including its objects, relations, parameters, conventions, evidence, boundary cases, and comparison targets. Reject examples whose alleged carrier belongs to a different problem. 2. Lock the constitutive rule. Express the persistence identity and object type, map key, session or unit-of-work scope, lookup-before-load rule, registration timing, concurrency and invalidation policy and same-instance guarantee are explicit independently of one notation or implementation.

Knowledge Transfer

Knowledge transfers strongly among subfields of enterprise software because they reuse the typed enterprise software carrier, including its objects, relations, parameters, conventions, evidence, boundary cases, and comparison targets, A repository consults the map before loading, registers newly materialized objects under their identity and clears or scopes the map at a defined lifecycle boundary., and type the carrier, state every parameter and convention in the definition, test that the persistence identity and object type, map key, session or unit-of-work scope, lookup-before-load rule, registration timing, concurrency and invalidation policy and same-instance guarantee are explicit, compare the nearest accepted identity, and report counterexamples, uncertainty, and limiting cases.

Relationships to Other Abstractions

Local relationship map for Identity map patternParents appear above the current abstraction, mutual partners to the right, and children below. Node labels state whether each abstraction is prime or domain-specific; colors identify relation types.Identity map patternDOMAINPrime abstraction: Caching — is a kind ofCachingPRIME

Current abstraction Identity map pattern Domain-specific

Parents (1) — more general patterns this builds on

  • Identity map pattern is a kind of Caching Prime

    The proposed strict upward parent is prime:caching.

Hierarchy paths (9) — routes to 7 parentless roots

Neighborhood in Abstraction Space

Identity map pattern sits in a crowded region of the domain-specific corpus (33rd percentile for distinctiveness): several abstractions share nearly its structure, so a description that fits it tends to fit its neighbors too.

Family — Software Modeling & Program Architecture (45 abstractions)

Nearest neighbors

Computed from structural-signature embeddings · 2026-09-08