[Zope-CVS] CVS: Products/AdaptableStorage/serial/interfaces - IConfigurableObjectMapper.py:1.1 IKeyedObjectSystem.py:1.6 public.py:1.4

Shane Hathaway shane@zope.com
Mon, 23 Dec 2002 23:30:04 -0500


Update of /cvs-repository/Products/AdaptableStorage/serial/interfaces
In directory cvs.zope.org:/tmp/cvs-serv30532/serial/interfaces

Modified Files:
	IKeyedObjectSystem.py public.py 
Added Files:
	IConfigurableObjectMapper.py 
Log Message:
Provided a way to configure ObjectMappers, with the intent of making
AdaptableStorage easier to explain.  Added IConfigurableObjectMapper
and converted all the mapper setup code to use it.  Included a
checkConfiguration() method which validates the entire object mapper
tree.  Then converted the DBTab-based configuration to use a mapper
factory, which can point to any mapper factory function installed
anywhere.  Tangents to this:

- Refactored Zope2FS and Zope2SQL to use the same code for setting up
mappers, leaving "holes" for the gateways.

- Added connect() and close() methods to ITPCConnection (which doesn't
technically exist yet since I need to choose a name for it. ;-) )

- Factored out common parts of the SQL gateways.

- Implemented the newKey() method of IKeyedObjectSystem, which will
help ZEO environments, in theory.



=== Added File Products/AdaptableStorage/serial/interfaces/IConfigurableObjectMapper.py ===
##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Object mapper configuration interface

$Id: IConfigurableObjectMapper.py,v 1.1 2002/12/24 04:29:33 shane Exp $
"""

from IObjectMapper import IObjectMapper


class IConfigurableObjectMapper (IObjectMapper):
    """Adds operations to IObjectMapper for configuration.
    """

    def setSerializer(s):
        """Sets the IObjectSerializer for this mapper."""

    def setGateway(g):
        """Returns the IGateway for this mapper."""

    def setClassifier(c):
        """Sets the IClassifier for this mapper."""

    def setKeychainGenerator(k):
        """Sets the IKeychainGenerator for subobjects."""

    def setVolatile(v):
        """Sets the volatile flag for this mapper."""

    def addSubMapper(name, m=None, replace=0):
        """Adds a named sub-IObjectMapper, returning the mapper added.

        If m is None, a default IConfigurableObjectMapper
        implementation is created.  If replace is not set,
        the implemenation prevents overriding an existing mapper.
        """

    def checkConfiguration(names=(), recursive=1):
        """Verifies the mapper configuration is sane.

        Raises an exception if there are errors.

        'names' gives the path to the mapper, for debugging purposes.
        'recursive' can be turned off to not descend into sub-mappers.
        """



=== Products/AdaptableStorage/serial/interfaces/IKeyedObjectSystem.py 1.5 => 1.6 ===
--- Products/AdaptableStorage/serial/interfaces/IKeyedObjectSystem.py:1.5	Mon Dec 16 18:26:41 2002
+++ Products/AdaptableStorage/serial/interfaces/IKeyedObjectSystem.py	Mon Dec 23 23:29:33 2002
@@ -41,3 +41,5 @@
         Returns None if the object is not in the keyed object system.
         """
 
+    def newKey():
+        """Returns a new, unique key (which might be used in a keychain)."""


=== Products/AdaptableStorage/serial/interfaces/public.py 1.3 => 1.4 ===
--- Products/AdaptableStorage/serial/interfaces/public.py:1.3	Mon Dec  9 13:25:28 2002
+++ Products/AdaptableStorage/serial/interfaces/public.py	Mon Dec 23 23:29:33 2002
@@ -19,6 +19,7 @@
 from IAspectEvent import IAspectEvent
 from IAspectSerializer import IAspectSerializer
 from IClassifier import IClassifier
+from IConfigurableObjectMapper import IConfigurableObjectMapper
 from IDeserializationEvent import IDeserializationEvent
 from IFullDeserializationEvent import IFullDeserializationEvent
 from IFullSerializationEvent import IFullSerializationEvent