Consequences of Identity
Identity of objects allows objects to be treated as black boxes. 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.
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's clear that the two objects pointed by the references are the same object. If the references do not compare equal, then it'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.
Read more about this topic: Identity (object-oriented Programming)
Famous quotes containing the words consequences of, consequences and/or identity:
“Without being forgiven, released from the consequences of what we have done, our capacity to act would ... be confined to one single deed from which we could never recover; we would remain the victims of its consequences forever, not unlike the sorcerers apprentice who lacked the magic formula to break the spell.”
—Hannah Arendt (19061975)
“There is not much that even the most socially responsible scientists can do as individuals, or even as a group, about the social consequences of their activities.”
—Eric J. Hobsbawm (b. 1917)
“Unlike Boswell, whose Journals record a long and unrewarded search for a self, Johnson possessed a formidable one. His life in Londonhe arrived twenty-five years earlier than Boswellturned out to be a long defense of the values of Augustan humanism against the pressures of other possibilities. In contrast to Boswell, Johnson possesses an identity not because he has gone in search of one, but because of his allegiance to a set of assumptions that he regards as objectively true.”
—Jeffrey Hart (b. 1930)