Home | Trees | Index | Help |
|
---|
Package Modeling :: Module ObjectStoreCoordinator :: Class ObjectStoreCoordinator |
|
ObjectStore
--+
|
ObjectStoreCoordinator
ObjectStoreCoordinator API
Design Pattern: Chain of repsonsability
__TBD
By default only one 'ObjectStoreCoordinator' is created for an entire application ; however multiple coordinators might exist in an application (reasons will be details ine the future __TBD)
Implementation of interface 'ObjectStore'
With respect to implemented interface 'ObjectStoreInterface', the following methods make sense and are consequently overriden:
- arrayFaultWithSourceGlobalID
- faultForGlobalID
- invalidateAllObjects
- invalidateObjectsWithGlobalIDs
- objectsForSourceGlobalID
- objectsWithFetchSpecification
- refaultObject
- savesChangesInEditingContext
These methods' implementations simply forwards to the dedicated coordinator(s) the message ; determination of the coordinator(s) involved is done using either 'objectStoreForFetchSpecification', 'objectStoreForGlobalID' or 'objectStoreForObject'.
Implementation notes:
Remember that you should NOT access directly to instance variables, they are considered private (MT-safety)
Method Summary | |
---|---|
__init__(self)
| |
Adds a cooperating object store | |
See ObjectStore for details | |
Returns a copy of the list of registered cooperatingObjectStores | |
Forwards the message to the adequate CooperatingObjectStore, usually a DatabaseContext, and returns the result. | |
Forwards the message to the adequate CooperatingObjectStore, usually a DatabaseContext, and returns the result. | |
Called by a CooperatingObjectStore (usually a DatabaseContext) when it needs to notify that some changes were noticed that are not necessarily already noticed --this is the case, for example, when a toMany relationship, with no inverseRelationship declared in the model, has been changed. | |
See ObjectStore for details | |
See ObjectStore for details | |
See ObjectStore | |
Acquire the lock for the ObjectStoreCoordinator. | |
Forwards the message to the appropriate CooperatingObjectStore, usually a DatabaseContext. | |
See ObjectStore for details | |
Iterates on objectStores and returns the first one who answers positively to message 'ownsEntityName' | |
Iterates on objectStores and returns the first one who answers positively to message 'handlesFetchSpecification'. | |
Iterates on objectStores and returns the first one who answers positively to message 'ownsGlobalID' | |
Iterates on objectStores and returns the first one who answers positively to message 'ownsObject' | |
See ObjectStore for details | |
Tells whether the ObjectStore can handle the supplied object. | |
See ObjectStore for details | |
Removes a cooperating object store | |
Returns 'self', since an 'ObjectStoreCoordinator' object is designed to be the root of an ObjectStore hierarchy. | |
See ObjectStore for details | |
Releases the lock for the ObjectStoreCoordinator. | |
Private method returning the 1st cooperating store answering positively to message ownsEntityName . | |
Private method returning the 1st cooperating store answering positively to message 'handlesFetchSpecification'. | |
Private method returning the 1st cooperating store answering positively to message 'ownsGlobalID'. | |
Private method returning the 1st cooperating store answering positively to message 'ownsObject'. | |
Inherited from ObjectStore | |
See interfaces.ObjectStore for details | |
An alias for ownsObject(). | |
See interfaces.ObjectStore for details | |
See interfaces.ObjectStore for details | |
See interfaces.ObjectStore for details |
Class Variable Summary | |
---|---|
Inherited from ObjectStore | |
tuple |
__implements__ = (<class Modeling.interfaces.ObjectStore...
|
Method Details |
---|
addCooperatingObjectStore(self, aStore)Adds a cooperating object store Posts CooperatingObjectStoreWasAdded See also: removeCooperatingObjectStore |
arrayFaultWithSourceGlobalID(self, aGlobalID, aRelationshipName, anEditingContext)See ObjectStore for details |
cooperatingObjectStores(self)Returns a copy of the list of registered cooperatingObjectStores |
faultForGlobalID(self, aGlobalID, anEditingContext)Forwards the message to the adequate CooperatingObjectStore, usually a DatabaseContext, and returns the result. |
faultForRawRow(self, row, entityName, anEditingContext)Forwards the message to the adequate CooperatingObjectStore, usually a DatabaseContext, and returns the result. |
forwardUpdateForObject(self, anObject, aDictionaryOfChanges)Called by a CooperatingObjectStore (usually a DatabaseContext) when it needs to notify that some changes were noticed that are not necessarily already noticed --this is the case, for example, when a toMany relationship, with no inverseRelationship declared in the model, has been changed. The ObjectStoreCoordinator simply locates the appropriate CooperatingObjectStore for 'anObject' then forwards the notification of changes to it. Refer to DatabaseContext.recordUpdateForObject() and DatabaseOperation for a more complete discussion on this topic. Paremeters:
|
initializeObject(self, anObject, aGlobalID, anEditingContext)See ObjectStore for details |
invalidateAllObjects(self)See ObjectStore for details |
invalidateObjectsWithGlobalIDs(self, globalIDs)See ObjectStore |
lock(self)Acquire the lock for the ObjectStoreCoordinator. Calls to 'lock()' should be balanced with the same number of 'unlock()' for the lock to be released. You normally do not need to call this method directly. See also: unlock() |
objectsCountWithFetchSpecification(self, aFetchSpecification, anEditingContext)Forwards the message to the appropriate CooperatingObjectStore, usually a DatabaseContext. Returns the approximate number of objects that would be returned by objectsWithFetchSpecification() if called with the very same parameters. About ``approximate'': the number returned is in fact the upper bound ; as the objects are not actually fetched against the database, it is not possible to determine whether some have already been deleted within anEditingContext (in which case objectsWithFetchSpecification() would not return them --see its documentation as well). Parameters:
|
objectsForSourceGlobalID(self, aGlobalID, aRelationshipName, anEditingContext)See ObjectStore for details |
objectStoreForEntityName(self, entityName)Iterates on objectStores and returns the first one who answers positively to message 'ownsEntityName' Posts 'CooperatingObjectStoreNeeded' in case no store can be found at first glance, so that listeners get a chance to register an adequate 'CooperatingObjectStore' ; then the requested 'ObjectStore' is returned, or 'None' if it still cannot be found. |
objectStoreForFetchSpecification(self, aFetchSpecification)Iterates on objectStores and returns the first one who answers positively to message 'handlesFetchSpecification'. Posts 'CooperatingObjectStoreNeeded' in case no store can be found at first glance, so that listeners get a chance to register an adequate 'CooperatingObjectStore' ; then the requested 'ObjectStore' is returned, or 'None' if it still cannot be found. |
objectStoreForGlobalID(self, aGlobalID)Iterates on objectStores and returns the first one who answers positively to message 'ownsGlobalID' Posts 'CooperatingObjectStoreNeeded' in case no store can be found at first glance, so that listeners get a chance to register an adequate 'CooperatingObjectStore' ; then the requested 'ObjectStore' is returned, or 'None' if it still cannot be found. |
objectStoreForObject(self, anObject)Iterates on objectStores and returns the first one who answers positively to message 'ownsObject' Posts 'CooperatingObjectStoreNeeded' in case no store can be found at first glance, so that listeners get a chance to register an adequate 'CooperatingObjectStore' ; then the requested 'ObjectStore' is returned, or 'None' if it still cannot be found. |
objectsWithFetchSpecification(self, aFetchSpecification, anEditingContext)See ObjectStore for details |
ownsObject(self, anObject)Tells whether the ObjectStore can handle the supplied object. ObjectStoreCoordinator determines this by searching a matching CooperatingObjectStore for that object. If such a CooperatingObjectStore is found, returns true (1), else return false (0). Note: this method directly triggers objectStoreForObject() --refer to its doc. for more info. on its side-effect. See also: objectStoreForObject()
|
refaultObject(self, anObject, aGlobalID, anEditingContext)See ObjectStore for details |
removeCooperatingObjectStore(self, aStore)Removes a cooperating object store Posts CooperatingObjectStoreWasRemoved See also: addCooperatingObjectStore |
rootObjectStore(self)Returns 'self', since an 'ObjectStoreCoordinator' object is designed to be the root of an ObjectStore hierarchy. See also: interface 'ObjectStore' for details |
saveChangesInEditingContext(self, anEditingContext)See ObjectStore for details |
unlock(self)Releases the lock for the ObjectStoreCoordinator. See also: lock() |
_objectStoreForEntityName(self, entityName)Private method returning the 1st cooperating store answering positively
to message Note: This method does not lock self. Do not call this by hand in a multi-threaded env. |
_objectStoreForFetchSpecification(self, aFetchSpecification)Private method returning the 1st cooperating store answering positively to message 'handlesFetchSpecification'. Called by 'objectStoreForFetchSpecification'. |
_objectStoreForGlobalID(self, aGlobalID)Private method returning the 1st cooperating store answering positively to message 'ownsGlobalID'. Called by 'objectStoreForGlobalID'. Note: This method does not lock self. Do not call tyis by hand in a mutli-threaded env. |
_objectStoreForObject(self, anObject)Private method returning the 1st cooperating store answering positively to message 'ownsObject'. Called by 'objectStoreForObject'. |
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Sat Mar 4 13:36:26 2006 | http://epydoc.sf.net |