home *** CD-ROM | disk | FTP | other *** search
- // EODataSources.h
- // Copyright (c) 1994, NeXT Software, Inc. All rights reserved.
- //
- // The EODataSource abstract class defines a simple interface for accessing
- // a variety of object sources in a uniform way. It exists primarily as
- // an interface for EOControllers to talk to the outside world.
- //
- // Subclasses should implement at least the fetchObjects method. If the
- // subclass supports insertion of new objects, then createObject and insertObject:
- // should also be implemented.
- //
- #import <Foundation/Foundation.h>
-
- @class EOEditingContext;
- @class EOClassDescription;
-
-
- @interface EODataSource : NSObject
-
- - (id)createObject;
- // Returns a new data bearing object with no values set, or nil if the
- // data source won't allow object insertion. Returned object is autoreleased.
- // The DataSource will register the newly created object with the
- // editingContext automatically.
- // Default implementation does:
- // [[self classDescriptionForInstances] createInstanceWithEditingContext:globalID:zone:];
- // [editingContext insertObject:eo];
-
- - (void)insertObject:object;
- // Inserts object into the data source. Raises exception on failure.
- // Default raises.
- // If the dataSource registers undos for the insertion it should be prepared to
- // also receive a possibly redundant deleteObject: call from higher levels.
-
- - (void)deleteObject:object;
- // Deletes object from the data source. Raises exception on failure.
- // Default raises.
- // If the dataSource registers undos for the deletion it should be prepared to
- // also receive a possibly redundant insertObject: call from higher levels.
-
- - (NSArray *)fetchObjects;
- // Returns an array of the data-bearing objects in the data source.
- // Default returns nil.
-
- - (EOEditingContext *)editingContext;
- // specifies the context in which this dataSource records its objects
- // Default returns nil.
-
- - (void)qualifyWithRelationshipKey:(NSString *)key ofObject:sourceObject;
- // qualify ourselves according to the relationship from
- // the given source object
- // A nil object will set up a qualifier that returns no records.
- // Default raises an exception.
-
- - (EODataSource *)dataSourceQualifiedByKey:(NSString *)key;
- // Returns a data source that can be set with
- // qualifyWithRelationshipKey:ofObject to supply objects associated
- // with a another objects key. This is a useful way to get an appropriate
- // detail data source for a given master data source.
- // Default raises an exception.
-
- - (EOClassDescription *)classDescriptionForObjects;
- // Should return a class description describing objects returned
- // by this dataSource. Default returns nil.
- @end
-
-