[Twisted-Python] Re: Questions about the Perspective Broker login mechanism

glyph at divmod.com glyph at divmod.com
Sun Aug 19 19:08:39 EDT 2007

On 09:16 pm, db3l.net at gmail.com wrote:
>David Bolen <db3l.net at gmail.com> writes:
>>Hmm, not that I've actually ever needed to yet myself, but is there
>>something specifically about Portal that prefers composition to
>>subclassing, or is it just a general design preference?
>Just to respond to my own post - finally noticed the comment in the
>Portal class about not being designed for subclassing, so certainly
>based on the expressed intent that's enough of a reason not too.
>Although I'm probably still curious as to why.

The portal is simply a utility class for composing an IRealm provider 
with some ICredentialsChecker providers.  The behavior in Portal itself 
is designed to be static, and decidable (in an ideal situation) by the 

In other words, realms and credentials checkers should be arbitrarily 
"remixable"; you should not implement one to depend on the other.

If you start messing with the behavior of Portal, just about the only 
thing you *can* do is introduce an unnecessary dependency that makes 
either your checker or your realm unusable by someone else in their own 

More information about the Twisted-Python mailing list