[Zope3-dev] Decorators

sean.upton@uniontrib.com sean.upton@uniontrib.com
Wed, 21 May 2003 16:11:16 -0700


>From the draft:
>If the name is listed as one that should be decorated,
>the attribute access is made on the mixin object 
>instead of the inner object.

Could there be a use-case for having the wrapper's name resolution check the
inner object after checking the "attrdict" but before checking the decorator
class?  I think I can see cases where the wrapper might be designed to add
functionality to a bunch of objects from dumb classes, but it just might be
the case that one of those dumb objects implements part of the decorator's
purpose or interface (but not all).  

If the inner object has the attribute name, don't you want to favor that
attribute (except in the case where it needs to be overridden???).  I guess
this depends on whether the purpose of the decorator is as a supplement or
as an alteration.

Sean

-----Original Message-----
From: Steve Alexander [mailto:steve@cat-box.net]
Sent: Monday, May 19, 2003 5:42 AM
To: zope3-dev@zope.org
Subject: [Zope3-dev] Decorators


Hi folks,

Over the past few weeks, Marius and I have been working on adding 
Decorators to Zope 3.

The work has been taking place on the stevea-decorators-branch in CVS.

The main goal of the work is to allow you to keep context-dependent 
implementation separate from regular python implementation, at minimal 
inconvenience when your objects are adapted or are presented with views.

You can read the draft documentation here:

http://cvs.zope.org/*checkout*/Zope3/src/zope/proxy/context/Attic/decorators
.txt?rev=1.1.2.8&only_with_tag=stevea-decorators-branch


This work implements something similar in form to what Shane discussed 
in December:

   http://mail.zope.org/pipermail/zope3-dev/2002-December/004606.html

My reply is here:

   http://mail.zope.org/pipermail/zope3-dev/2002-December/004607.html

   This is pretty much how the work has turned out, except that
   there is no support (yet) for declaratively creating simple
   decorators.

And Jim's brief reply to Shane's message is here:

   http://mail.zope.org/pipermail/zope3-dev/2002-December/004612.html


I'm looking for some sort of peer review of the intent and ideas (and 
perhaps the code, if you want to dig in ;-) ) before merging this onto 
the HEAD.

--
Steve Alexander


_______________________________________________
Zope3-dev mailing list
Zope3-dev@zope.org
http://mail.zope.org/mailman/listinfo/zope3-dev