Documentation Archive Developer
Search
PATH Documentation > WebObjects

Table of Contents

EODeferredFaulting


(informal interface)
Implemented by:
EOEnterpriseObject
EOCustomObject
EOGenericRecord
Implements:
EOFaulting
Package:
com.webobjects.eocontrol

Interface Description


The EODeferredFaulting interface defines the method enterprise objects use to manage deferred faulting.

EOF uses faults as stand-ins for objects whose data has not yet been fetched. Although fault creation is much faster than fetching, fault instantiation still takes time. To further improve performance, enterprise objects can use deferred faults (which are more efficient).

In an object whose class enables deferred faulting, the object's relationships are initially set to deferred faults. For a particular relationship, a single deferred fault is shared between all instances of an enterprise object class. This sharing of deferred faults can significantly reduce the number of faults that need to be created, and usually reduces the overhead of fault creation during a fetch.

For example, consider a Movie class with a studio relationship. Without deferred faulting, during a fetch of twenty Movie objects, twenty faults are created for the studio relationship-one fault for each movie. With deferred faulting, only one fault is created-a deferred fault that is shared by all the movies.



Instance Methods



willReadRelationship

public abstract Object willReadRelationship(Object object)

Enterprise object instances that use deferred faulting invoke this method before accessing a relationship to ensure that the relationship isn't a deferred fault. EOCustomObject and EOGenericRecord's implementations check if object is a deferred fault, and create and return a regular fault if it is.

For example, suppose a Movie enterprise object uses deferred faulting. Then the accessors for its relationships-studio, for example-should invoke willReadRelationship before returning the object:


public Studio studio() {
    return this.willReadRelationship(studio);
}

See Also: createFaultForDeferredFault (EOFaultHandler)



© 2001 Apple Computer, Inc. (Last Published April 19, 2001)


Table of Contents