[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Ozone object identity...



> Also, David, what do you want to return from a 
> getObjectIdentity() method? The
> internal object ID? This would make client code depend on 
> the internal
> implementation! (the current 64bit number is one solution 
> maybe we have to
> change this for some reasons in the future)

How about returning Object? And the contract should only state that its this.equals( anotherId) method should return true iff the anotherId is an ID to the same underlying object as "this"?

Then it would be implementation independent. I have used that pattern for the identity of permissions in a system of mine. I don't specify what a permission is, only that equals() should work in this manner (as well as hashCode() ).

One could also abstract it a bit, by inserting an OzoneObjectId class. This would be somewhat clearer maybe, although I prefer the method stated above.

/O