CooperatingObjectStoreInterface.py :  » Database » Modeling-Framework » Modeling-0.9 » Modeling » interfaces » Python Open Source

Home
Python Open Source
1.3.1.2 Python
2.Ajax
3.Aspect Oriented
4.Blog
5.Build
6.Business Application
7.Chart Report
8.Content Management Systems
9.Cryptographic
10.Database
11.Development
12.Editor
13.Email
14.ERP
15.Game 2D 3D
16.GIS
17.GUI
18.IDE
19.Installer
20.IRC
21.Issue Tracker
22.Language Interface
23.Log
24.Math
25.Media Sound Audio
26.Mobile
27.Network
28.Parser
29.PDF
30.Project Management
31.RSS
32.Search
33.Security
34.Template Engines
35.Test
36.UML
37.USB Serial
38.Web Frameworks
39.Web Server
40.Web Services
41.Web Unit
42.Wiki
43.Windows
44.XML
Python Open Source » Database » Modeling Framework 
Modeling Framework » Modeling 0.9 » Modeling » interfaces » CooperatingObjectStoreInterface.py
# -*- coding: iso-8859-1 -*-
#-----------------------------------------------------------------------------
# Modeling Framework: an Object-Relational Bridge for python
#
# Copyright (c) 2001-2004 Sbastien Bigaret <sbigaret@users.sourceforge.net>
# All rights reserved.
#
# This file is part of the Modeling Framework.
#
# This code is distributed under a "3-clause BSD"-style license;
# see the LICENSE file for details.
#-----------------------------------------------------------------------------


"""
CooperatingObjectStore

  __TBD

  CVS information

    $Id: CooperatingObjectStoreInterface.py 932 2004-07-20 06:21:57Z sbigaret $
  
"""

__version__='$Revision: 932 $'[11:-2]

from Modeling.interfaces.ObjectStoreInterface import ObjectStoreInterface

class CooperatingObjectStoreInterface(ObjectStoreInterface):
  """
  CooperatingObjectStore

    This interface defines the API that any coordinators should implement
    so that they can be properly handled by the aplication's
    'ObjectStoreCoordinator'

    Any class implementing this interface *must* include the following
    statement after the class declaration/specification::

      # Now enforce interface' specifications
      from Interface import verify_class_implementation
      verify_class_implementation(CooperatingObjectStoreInterface,
                                  <theClassImplementingTheInterface>)

    Known class implementing this interface: DatabaseContext
  """
  def commitChanges(self):
    """
    Commit the changes made in the previous step (cf. performAdaptorOperations)

    This should raise if some problems occur. This method should not clean any
    internal state used during the process of saving changes, nor take any
    other action than the one described above: this is the responsability of
    method finalizeCommitChanges().
    """

  def handlesFetchSpecification(self, aFetchSpecification):
    """
    Indicates whether the CooperatingObjectStore can handle the supplied
    FetchSpecification.
    """

  def ownsGlobalID(self, aGlobalID):
    """
    Indicates whether the CooperatingObjectStore is responsible for the
    object which has this GlobalID.
    """

  def ownsObject(self, anObject):
    """
    Indicates whether the CooperatingObjectStore is responsible for the changes
    made to 'anObject'
    """

  def performChanges(self):
    """
    Third step in the process of saving changes, where concrete subclasses
    uses the DatabaseOperations built at the previous step to make the changes
    persistent. DatabaseContext's implementation builds AdaptorOperation
    from these DatabaseOperations, and then sends them to the underlying
    concret AdaptorChannel using the 'performAdaptorOperations()' message.
    
    """

  def prepareForSaveWithCoordinator(self, aCoordinator, anEditingContext):
    """
    This is the first step being triggered by the ObjectStoreCoordinator
    when the latter was instructed to do save the changes made in an
    EditingContext.

    See also: recordChangesInEditingContext(), performChanges(),
              commitChanges(), rollbackChanges(),
              EditingContext.saveChanges()
    """

  def recordChangesInEditingContext(self):
    """
    Second step being triggered by the ObjectStoreCoordinator when the latter
    was instructed to do save the changes made in an EditingContext.
    The 'EditingContext' instance this method works with is the one supplied
    when 'prepareForSaveWithCoordinator()' was called.

    You should never need to call this method by hand.

    See also: prepareForSaveWithCoordinator(), performChanges(),
              commitChanges(), rollbackChanges(),
              EditingContext.saveChanges()
    """

  def recordUpdateForObject(self, anObject, aDictionaryOfChanges):
    """
    """

  def rollbackChanges(self):
    """
    """

  def valuesForKey(self, keys, anObject):
    """
    """

  def finalizeCommitChanges(self):
    """
    Last step in the process of saving changes. The ObjectStoreCoordinator
    calls it one each of its CooperatingObjectStores when all commitChanges()
    did succeed. Concrete classes should transmit the changes made in the
    local snapshots (including deletion) to their Database, then they should
    take all appropriate actions to clean up the internal state.
    
    """
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.