AW: AW: [Zope3-dev] Propose interface change (well not really)

Roger ineichen dev at projekt01.ch
Thu Jul 8 18:57:39 EDT 2004


Jim Fulton wrote:
> Gesendet: Freitag, 9. Juli 2004 00:38
> An: srichter at cosmos.phy.tufts.edu
> Cc: dev at projekt01.ch; zope3-dev at zope.org
> Betreff: Re: AW: [Zope3-dev] Propose interface change (well 
> not really)
> 
> 
> Stephan Richter wrote:
> > On Thursday 08 July 2004 17:27, Roger ineichen wrote:
> > 
> >>Why does the IPrincipalSource not inherit from IContained?
> > 
> > 
> > It was just not done yet. Just do it.
> 
> Well, because it has nothing to do with being contained.
> 
> But, given that IPluggableAuthService extends IContainer,
> I see no harm in having IPrincipalSource extend IContained.
> 
> BTW,  IContainerPrincipalSource has a silly name and doc 
> string. Fortunately, this change will make it go away. :)
> 
> > 
> >>Is it possible to have IPrincipalSource outside a 
> >>IPluggableAuthenticationService, because we don't have a
> > 
> > 
> > No.
> > 
> > 
> >>ContainerTypesConstraint for IPluggableAuthenticationService
> >>like:
> >>    __parent__= Field(
> >>        constraint =
> >>ContainerTypesConstraint(IPluggableAuthenticationService))
> 
> > Add it. This code is much older than the constraint code.
> 
> No, this code was added to work with the constraint code.
> Maybe for X3.1, we can improve the spelling.
> 
> > 
> >>And why we don't have read methods of the container in this 
> interface? 
> >>Or at least the methods __len__(), keys(), values()
> > 
> > 
> > Don't we use IContainer as a base class for 
> IPrincipalSource? If not, 
> > you can
> > do this as well.
> 
> Are we talking about IPrincipalSource or 
> IPluggableAuthenticationService? 
> IPluggableAuthenticationService extends ICOntainer already.
> 
> IPrincipalSource should not extend IContainer because 
> principal sources need not be containers.
> 
> > 
> >>This way we can't get the size of the source or useable 
> infos out of 
> >>the principal source. Just authenticate.
> 
> Roger, I'm confused. Are you talking about the principal 
> source? Or the auth service?

About the IPrincipalSource. I was lookig at the implementation of
BTreePrincipalSource which is a sample of read/write principal source.
Because it implements a IContainer. Then I was thinking of a
read only principal source should at least provide IReadContainer.
But this isn't the case. I was wrong because that's just one implementation.
with a BTree container. What do you think about to have a Interface for to
add principals like setPrincipal(self, login, ob) instead of 
__setitem__(self, login, ob)?

Do we have to provide everywhere IContainer where we add object in Zope
or can we use the method setPrincipal() instead if we have to add new
interfaces?

> 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
> 



More information about the Zope3-dev mailing list