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:
“The middle years are ones in which children increasingly face conflicts on their own,... One of the truths to be faced by parents during this period is that they cannot do the work of living and relating for their children. They can be sounding boards and they can probe with the children the consequences of alternative actions.”
—Dorothy H. Cohen (20th century)
“There is a delicate balance of putting yourself last and not being a doormat and thinking of yourself first and not coming off as selfish, arrogant, or bossy. We spend the majority of our lives attempting to perfect this balance. When we are successful, we have many close, healthy relationships. When we are unsuccessful, we suffer the natural consequences of damaged and sometimes broken relationships. Children are just beginning their journey on this important life lesson.”
—Cindy L. Teachey. Building Lifelong RelationshipsSchool Age Programs at Work, Child Care Exchange (January 1994)
“Adultery is the vice of equivocation.
It is not marriage but a mockery of it, a merging that mixes love and dread together like jackstraws. There is no understanding of contentment in adultery.... You belong to each other in what together youve made of a third identity that almost immediately cancels your own. There is a law in art that proves it. Two colors are proven complimentary only when forming that most desolate of all colorsneutral gray.”
—Alexander Theroux (b. 1940)