Re: Non-ZCML config for ZCA. (Was: Anyone want to do Google Summer of code mentoring for PSF?)

Jim Fulton <[email protected]>
Newsgroups gmane.comp.web.zope.devel
Message-ID <[email protected]>
On Mon, Mar 21, 2011 at 7:47 AM, Lennart Regebro <[email protected]> wrote:
...
> 4. zope.interface already does, and zope.component will as well, once
> it's ported. That means we get things like:
>
> class IMyFace(Interface):
>    whatevah
>
> class IMyFeet(Interface):
>    something
>
> @implementer(IMyFace)
> class MyFace(object):
>   yeahyeah
>
> @adapter(IMyFace, IMyFeet)
> class FootInMouth(object):
>   def __init__(self, mouth, foot):
>       pass
>
> The @adapter decorator so far only handles functions, but will be
> extended to classes once we port zope.component. I think also adapter
> today will only mark the object as adapts(...) does, but you will
> still use zcml to register the adapter. So probably we still need
> @adapter (as it already exists) and also another decorator (say
> @adapt() maybe?) that will both mark the class and register it in the
> registry, and hence do the same as the <adapter ... /> directive does
> today.
>
> Then we have subscriber, utility, resource and view directives.
> There's no particular reason I know of that means they couldn't be
> class decorators as well.
>
> That takes care of most of the configuration needed for the ZCA
> itself. How to deal with the rest probably gets more obvious once
> we've done this.

I'm not going to comment any more on the broader thread unless/until I
have something specific to propose.  Having said that, I'd like to go
on record as wanting to review the zca port to Python 3 before it's
finalized.

Jim

-- 
Jim Fulton
http://www.linkedin.com/in/jimfulton
_______________________________________________
Zope-Dev maillist  -  [email protected]
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.