One embodiment of the present invention provides a system that supports
cross-component references in an object-oriented programming system.
During operation, the system makes a first attempt to obtain a name for a
referenced object through a cross-component reference between a
referencing object and the referenced object. This first attempt involves
attempting to obtain the name for the referenced object from the
referenced object, which involves attempting access the referenced object
through an identifier for the referenced object within the
cross-component reference. If this first attempt fails, the system makes
a second attempt to obtain the name for the referenced object, which
involves obtaining a pathname for the referenced object from the
cross-component reference.