Re: Object identity




Gabriel Claramunt wrote:

[snip]

Object identity is defined completely in the computing space, and intrinsic
to the object instance: two object instances have different indentity even
if they have the same properties.
In your code:
Employee* a = new Employee;
a->SetName("Albert Einstein");
a->SetSalary(25000);
Employee* b = new Employee;
b->SetName("Albert Einstein");
b->SetSalary(25000);

But a and b have different identity.

[snip]

In the code example you have I(A)=a and I(A)=b but a <> b.

I previously said I agree with this, but that's because I glossed over
it much too quickly.

Let entity A stand for the human named Albert Einstein.

What you should say is: I(a) = A and I(b) = A. ie both object
instances a and b map under the interpretation to the same human
entity.

Your example shows that the interpretation is not 1-1, rather than it
not being a function! You seem to have swapped domain and codomain!

I have no problem at all with an interpretation not being 1-1. IMO it
is implicit in the nature of object identity (as distinct from value
semantics). However you will find lots of OO programmers who think
your code above is evil.

Cheers,
David Barrett-Lennard

.



Relevant Pages

  • Re: Natural keys vs Aritficial Keys
    ... For example an object instance of class String is a variable. ... a Mutex class has more to do with defining a type of Finite State ... At best an object instance of an Employee class would be a ... tuple-variable that records a tuple-value. ...
    (comp.databases.theory)
  • Re: Object identity
    ... RDB" you will see it. ... to the object instance: two object instances have different indentity even ... Employee* a = new Employee; ... the object is the same in the computing space because one cannot map real ...
    (comp.object)
  • Re: Object identity
    ... constructed has no notion of the "physicality of a single human"....as ... computational machine to an abstract computational machine. ... Employee or the EmployeeModel. ...
    (comp.object)
  • somebody characterise dominant observers, do you maintain them
    ... ** Any unauthorized use, duplication, or disclosure is prohibited by law ... About 500 lines of C source outbound. ... current employee gives it to them. ...
    (sci.crypt)
  • will you rob beside the colony, if Murad fatally proves the furniture
    ... About 500 lines of C source outbound. ... current employee gives it to them. ... Deloitte & Touche didn't spot the transfer. ...
    (sci.crypt)