All Packages Class Hierarchy This Package Previous Next Index
The reason for this is that no object is truly "self identified", but rather, it is always identified with respect to some context. In the MOFW, the BaseCollection provides this context (within which an ORB can be considered a BC).
We could relax this restriction if: a) there can always be thought to be a single root per address space ("named" the server name if the identity needs to go beyond the address space boundary), and b) Identifable includes a getIdentifier() method that provides a key with respect to this well known root (with a well known method of accessing it). The former would require a change to the CORBA standard, while the latter is simply a convention that AA's may choose to adhere to. For this reason, we feel that "self identified" objects should be subclasses of Managed (note that Managed extends Manageable, Identifiable and Lifecycle).
All this aside, Identifiable allows an object's client to test whether two references refer to the same object using isIdentical().
It also allows efficient testing of whether an object is a member of a large group of objects using getRandomConstantID(). This returns a standard hash of the objects Identifier relative to a specified BaseCollection onto a long, which has the property that, if two of these are not equal, then they do not refer to the same object. However, if two of these are equal, then the objects may be different. Thus, membership in a large group of objects can can be done with a minimum of isIdentical() tests.
The idIdentical() method should be contrasted with the
Java Object equals() method, which tests whether two
references refer to object of equal or equivalent value.
Identity implies equality, but equality does not imply identity.
Assuming the following:
public abstract boolean isIdentical(Identifiable otherObject)
Identifiable
object to check.
boolean
indicating whether the two objects
are identical.
public abstract int getConstantRandomId()
Good implementations of isIdentical() will use this value exactly as specified above for performance, so most clients should use it instead.
int
representing a value that can be used
to quickly determine non identity.
All Packages Class Hierarchy This Package Previous Next Index