[Zope-CMF] IndexableObjectWrapper

Tres Seaver tseaver at palladion.com
Wed Mar 18 10:06:22 EDT 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

yuppie wrote:
> Hi!
> 
> 
> Tres Seaver wrote:
>> Miles wrote:
>>>  >> Can I suggest the following logic:
>>>  >>
>>>  >>   1. if the object already implements the IIndexableObject marker
>>>  >> interface, no wrapping is required;
> 
> If we don't support 3., we can make 'no wrapping' the default.
> 
>>>  >>   2. otherwise, adapt to IIndexableObject to do the wrapping;
>>>  >>
>>>  >>   3. if no adapter is registered, fall back to the existing
>>>  >> IndexableObjectWrapper class for BBB.
>>>  >
>>>  > That sounds like what I had in mind, but not for BBB.  I think of the
>>>  > adapter scheme as a way to choose a non-default wrapper, rather than a
>>>  > quasi-mandatory replacement for it.
> 
> What's the win of providing a default that way? IndexableObjectWrapper 
> contains policy decisions, Plone e.g. doesn't use it. The current code 
> on the branch registers an adapter for IContentish, so CMFDefault will 
> never use that hardcoded default.

I think that registration should be in CMFDefault, anyway.  Applications
which haven't updated to this new model should continue to work
(including indexing 'allowedRolesAndUsers').

> The change is in a new feature release. People can't expect full BBB if 
> they use customized registrations or catalog content that doesn't 
> implement IContentish.
> 
>>> Ok, well this logic is checked in now on the branch, and tests adjusted 
>>> accordingly.  Without any warnings.
>> Thanks, looks good.
> 
> Looks unnecessarily complex to me. But I'm afraid I'm outvoted.

Falling back to the current behavior is cheap, both at runtime and in
maintenance costs.  Why break BBB gratuitously?


Tres.				
- --
===================================================================
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

iD8DBQFJwP/e+gerLs4ltQ4RAmr3AJ9vBrqTWDyDo/DSPGjY00p6XIJbvQCgpTW1
9puaqcux8hIdow0DLsFZ4i4=
=VeKx
-----END PGP SIGNATURE-----



More information about the Zope-CMF mailing list