A method for providing stand-in objects, where relationships among objects are
automatically resolved in an object oriented relational database model without
the necessity of retrieving data from the database until it is needed. A "fault"
class is defined, as well as fault objects whose data haven't yet been fetched
from the database. An object that's created for the destination of a relationship
whenever an object that includes the relationship is fetched from the database.
When an object is fetched that has relationships, fault objects are created to
"stand-in" for the destination objects of those relationships. Fault objects transform
themselves into the actual enterprise objects—and fetch their data—the
first time they're accessed. Subsequently, messages sent to the target objects
are responded to by the objects themselves.
This delayed resolution of relationships occurs in two stages: the creation
of a placeholder object for the data to be fetched, and the fetching of that data
only when it's needed. By not fetching an object until the application actually
needs it, unnecessary interaction with the database server is therefore prevented.