[Zope3-dev] IGroupFolder instead of isinstance?

Roger Ineichen dev at projekt01.ch
Tue Feb 22 18:01:30 EST 2005


Hi Jim, 
Behalf Of Jim Fulton
> Sent: Tuesday, February 22, 2005 11:37 PM
> To: dev at projekt01.ch
> Cc: zope3-dev at zope.org
> Subject: Re: [Zope3-dev] IGroupFolder instead of isinstance?
> 
> Roger Ineichen wrote:
> > Is there a reason why we don't use a IGroupFolder interface?
> > 
> > I see some problems for future implementations like described
> > in the groupfolder.txt in zope.app.authentication.browser
> > 
> > ----
> > [...] groups need to be defined in it's group folder. 
> > Other groups folders or group-defining plugins could 
> > define groups for a group.
> > ----
> > 
> > because:
> > 
> > In the class zope.app.authentication.groupfolder.py
> > 
> > There is a check against a instance instead asking for 
> > providing a interface?
> > 
> > for name, groupfolder in groupfolders:
> >         # It's annoying that we have to filter here, but there isn't
> >         # a good reason for people to register group folder 
> utilities.
> >         if not isinstance(groupfolder, GroupFolder):
> >                ^^^^^^^^^^
> >             continue
> >         principal.groups.extend(
> >             groupfolder.getGroupsForPrincipal(principal.id),
> >             )
> > 
> > or are events more private and we have to implement own
> > events for custom implementations? This looks like the event
> > was added specialy for one implementation.
> 
> *This* subscriber depends specifically on this group folder
> implementation, which is why it tests for the implementation.
> 
> A more general subscriber could use a more general test.

Good to know,
this means we really have to know the implementation of each event.

Ok I see, 
this means we have something like public events and privat events?

Regards
Roger

> Jim
> 
> -- 
> Jim Fulton           mailto:jim at zope.com       Python Powered!
> CTO                  (540) 361-1714            http://www.python.org
> Zope Corporation     http://www.zope.com       http://www.zope.org
> _______________________________________________
> Zope3-dev mailing list
> Zope3-dev at zope.org
> Unsub: 
> http://mail.zope.org/mailman/options/zope3-dev/dev%40projekt01.ch
> 
> 



More information about the Zope3-dev mailing list