<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.sarg.dev/index.php?action=history&amp;feed=atom&amp;title=Identity_%28object-oriented_programming%29</id>
	<title>Identity (object-oriented programming) - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.sarg.dev/index.php?action=history&amp;feed=atom&amp;title=Identity_%28object-oriented_programming%29"/>
	<link rel="alternate" type="text/html" href="https://wiki.sarg.dev/index.php?title=Identity_(object-oriented_programming)&amp;action=history"/>
	<updated>2026-06-22T09:28:18Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://wiki.sarg.dev/index.php?title=Identity_(object-oriented_programming)&amp;diff=733448&amp;oldid=prev</id>
		<title>imported&gt;Boleyn: has ref</title>
		<link rel="alternate" type="text/html" href="https://wiki.sarg.dev/index.php?title=Identity_(object-oriented_programming)&amp;diff=733448&amp;oldid=prev"/>
		<updated>2025-10-03T20:33:19Z</updated>

		<summary type="html">&lt;p&gt;has ref&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{multiple issues|&lt;br /&gt;
{{onesource|date=March 2016}}&lt;br /&gt;
{{original research|date=March 2016}}&lt;br /&gt;
}}&lt;br /&gt;
In [[object-oriented programming]], [[object-oriented analysis and design|analysis and design]], [[object (computer science)|object]] &amp;#039;&amp;#039;&amp;#039;identity&amp;#039;&amp;#039;&amp;#039; is the fundamental property of every object that it is distinct from other objects.&amp;lt;ref name=&amp;quot;Why Natural Scientists Should Care About Object-Oriented Technology&amp;quot;&amp;gt;http://www.literateprogramming.com/quantumoo.pdf&amp;lt;/ref&amp;gt;{{rp|6}} Objects have identity {{endash}} are distinct {{endash}} even when they are otherwise indistinguishable, i.e. [[Equality (mathematics)|equal]]. In this way, object identity is closely related to the [[identity (philosophy)|philosophical meaning]].&lt;br /&gt;
&lt;br /&gt;
== Identity and references ==&lt;br /&gt;
A [[reference (computer science)|reference]] can be used to refer to an object with a specific identity. A reference contains the information that is necessary for the identity property to be realized in the [[programming language]], and allows access to the object with the identity. A type of a target of a reference is a role. Typically, references are isomorphic to memory addresses. However, multiple such references can refer to the same object, if some form of address mapping is present ([[Virtual memory|virtual addresses]] / [[page tables]] / [[Memory segmentation|memory segments]]).&lt;br /&gt;
&lt;br /&gt;
Object identity is less useful as a semantic concept in environments or situations in which the structure of objects is not encapsulated, and two objects are considered to be the same object based on having identical properties, even if they are not actually the same physical instance (structural equivalence). However, object identity can nevertheless provide optimization.  A function which tests whether two arguments are the same object can quickly short circuit to an affirmative answer if the two arguments have the same identity (are references to the same instance).  Only if the argument are distinct objects do the individual properties need to be considered to determine equality, which is a more expensive operation.  For instance, [[bignum]] integers may be heap-allocated objects such that two bignums are considered to be the same if they represent the same number.  It might be a waste of machine cycles in the equality function not to take advantage of the discovery that the two arguments being compared are references to the same bignum.&lt;br /&gt;
&lt;br /&gt;
== Consequences of identity ==&lt;br /&gt;
Identity of objects allows objects to be treated as [[Black box (systems)|black box]]es. The object need not expose its internal structure. It can still be referred to, and its other properties can be accessed via its external behaviour associated with the identity. The identity provides a mechanism for referring to such parts of the object that are not exposed in the interface. Thus, identity is the basis for [[polymorphism in object-oriented programming]].&lt;br /&gt;
&lt;br /&gt;
Identity allows comparison of references. Two references can be compared whether they are equal or not. Due to the identity property, this comparison has special properties. If the comparison of references indicates that the references are equal, then it&amp;#039;s clear that the two objects pointed by the references are the same object. If the references do not compare equal, then it&amp;#039;s not necessarily guaranteed that the identity of the objects behind those references is different. The object identity of two objects of the same type is the same, if every change to either object is also a change to the other object.&lt;br /&gt;
&lt;br /&gt;
== Identity and object-oriented conceptual model ==&lt;br /&gt;
Identity allows the construction of a platonic ideal world,[https://plato.stanford.edu/entries/object/] [[ontology (information science)|ontology]] or conceptual model,  that is often used as basis of object-oriented thinking. The conceptual model describes the [[client (computing)|client]] side view to a [[application domain|domain]], terminology or an [[application programming interface|API]]. This world contains point-like objects as [[instance (computer science)|instances]], properties of the objects and links between those objects. The objects in the world can be grouped to form [[class (computer science)|class]]es. The properties of the objects can be grouped to form [[Role-oriented programming |role]]s. The links can be grouped to form [[association (object-oriented programming)|association]]s. All locations in the world together with the links between the locations form the structure of the world. These groups are [[datatype|type]]s of the corresponding instances of the world.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* {{Annotated link|Domain-driven design}}&lt;br /&gt;
* {{Annotated link|Object-Oriented Software Construction}}&lt;br /&gt;
* {{webarchive |url=https://web.archive.org/web/20080515223645/http://www.cs.cmu.edu/People/clamen/OODBMS/Manifesto/htManifesto/node4.html |date=15 May 2008 |title=Object identity}}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
{{Reflist}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Object-oriented programming]]&lt;/div&gt;</summary>
		<author><name>imported&gt;Boleyn</name></author>
	</entry>
</feed>