Jump to content

Identity map pattern

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Jammycakes (talk | contribs) at 16:11, 10 August 2007 (Added see also section). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
This article is about the Identity Map software design pattern. For the mathematical concept, see Identity function.

An identity map is a database access design pattern used to improve performance by providing a context-specific cache to prevent duplicate retrieval of the same object data from the database.[1]

If the requested data has already been loaded from the database, the identity map returns the same instance of the already instantiated object, but if it has not been loaded yet, it loads it and stores the new object in the map. In this way, it follows a similar principle to lazy loading.

See also

References

  1. ^ Fowler, Martin (2003). Patterns of Enterprise Application Architecture. Addison-Wesley. pp. 195–199. ISBN 0321127420.