[Zope-CVS] CVS: Products/Ape/lib/apelib/zodb3 - connection.py:1.4

Shane Hathaway shane@zope.com
Mon, 26 May 2003 15:33:17 -0400


Update of /cvs-repository/Products/Ape/lib/apelib/zodb3
In directory cvs.zope.org:/tmp/cvs-serv13513/zodb3

Modified Files:
	connection.py 
Log Message:
Added some facades in a new module called apelib.core.io.  These are
designed to make it easier to:

  - reuse Ape in different frameworks

  - do simple operations like import / export objects

  - ignore classification and mapper_names details

In support of this:

  - Added tests for ape.core.io.

  - Renamed loadStub() to getObject().  The old name was silly. ;-)
    Left a deprecated alias.

  - Moved getExternalRefs() to ISDEvent so that IDeserializationEvent
    now implements it as well.  This mades it easier to implement object
    import.

  - Created IClassFactory.  IKeyedObjectSystem extends it.

  - Changed the signature of createEmptyInstance so that an
    IClassFactory is always expected.
			


=== Products/Ape/lib/apelib/zodb3/connection.py 1.3 => 1.4 ===
--- Products/Ape/lib/apelib/zodb3/connection.py:1.3	Mon Apr 21 13:27:50 2003
+++ Products/Ape/lib/apelib/zodb3/connection.py	Mon May 26 15:33:16 2003
@@ -91,7 +91,7 @@
         for mapper_name in mapper_names:
             mapper = mapper.getSubMapper(mapper_name)
         object = mapper.getSerializer().createEmptyInstance(
-            classification=classification, class_factory=self.classFactory)
+            self, classification=classification)
         assert object is not None
 
         object._p_oid=oid
@@ -120,8 +120,7 @@
                     mapper = mapper.getSubMapper(mapper_name)
                 ser = mapper.getSerializer()
 
-                object = ser.createEmptyInstance(
-                    class_factory=self.classFactory)
+                object = ser.createEmptyInstance(self)
                 if object is not None:
                     object._p_oid=oid
                     object._p_jar=self
@@ -416,7 +415,7 @@
 
     # IKeyedObjectSystem implementation
 
-    def loadStub(self, keychain, hints=None):
+    def getObject(self, keychain, hints=None):
         oid = self._db._oid_encoder.encode(keychain)
         return self._persistent_load(oid, hints)
 
@@ -435,8 +434,10 @@
         keychain = self._db._oid_encoder.decode(oid)
         return keychain[-1]
 
+    loadStub = getObject  # Deprecated
 
-    def classFactory(self, module, name):
+
+    def getClass(self, module, name):
         return self._db._classFactory(self, module, name)