[Zope-CMF] Re: five.intid and DirectoryView
Tres Seaver
tseaver at palladion.com
Sat Jun 28 11:25:18 EDT 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Martijn Pieters wrote:
> On Fri, Jun 27, 2008 at 6:53 PM, Ross Patterson <me at rpatterson.net> wrote:
>> "Martijn Pieters" <mj at zopatista.com> writes:
>>> But the code never does that. When cloning a file-based FSObject, a
>>> new instance is created and that is added to the ZODB. Noone else
>>> should do this either.
>> zope.app.keyreference does. The persistence machinery doesn't add an
>> object to a connection until commit. As such, an IPersistent and
>> IObjectAdded event handler, such as the one in zope.app.intid, that
>> needs the object to have a connection needs to add the object to a
>> connection.
Sounds like a bug in zope.app.intid to me: it shouldn't be forcing
objects to have connections.
> Why is the IObjectAdded event fired at all? Perhaps that's the bug here.
>
>> Shouldn't anything that implements IPersistent be able to be added to a
>> connection? Wouldn't that be considered part of providing the
>> interface? Where else is an object that provides IPersistent stored in
>> global state?
>
> I assume it was easier at the time to use just one class. Perhaps this
> should be reconsidered now. However, just providing the IPersistence
> interface does not mean the object expects to be added to a connection
> arbitrarily.
Exactly. Nobody is supposed to add objects to a connection except their
already-persisted containers.
- --
===================================================================
Tres Seaver +1 540-429-0999 tseaver at palladion.com
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFIZlfe+gerLs4ltQ4RAoGOAJ954hDazoOKVj7TZKJQX84wB0LRUwCgox23
rjY5Q3Xjhu+eDcVnmmzXdjs=
=pF+8
-----END PGP SIGNATURE-----
More information about the Zope-CMF
mailing list