[Twisted-web] fragments with child lookup

L. Daniel Burr ldanielburr at mac.com
Thu Oct 12 12:35:05 CDT 2006

Hi Manlio,

On Thu, 12 Oct 2006 12:30:18 -0500, Manlio Perillo  
<manlio_perillo at libero.it> wrote:

> L. Daniel Burr ha scritto:
>> [...]
>> Ok, first things first.  The reason I hate "template per segment"  
>> designs
>> is the same reason that I hate Zope acquisition.  They both suffer from
>> the same illness, which is complexity. Take the following URL:
>> http://myhost.com/foo/bar/baz
>> This URL identifies a resource, and when some client requests this URL,
>> a representation of that resource will be sent to the client.  In order
>> to render this representation in "template-per-segment" design, I have
>> to first traverse the tree and render "foo", then "bar" then lastly,
>> "baz".  This enforces a needless dependency upon containment.  Why does
>> the resource living at "baz" have to depend upon "foo" and "bar" in
>> order to produce a representation of "baz"?
> Because it is a child of foo and bar.

That's closer to a tautology than an answer ;)

> It is thanks to "template per segment" design, that guard can do its  
> job...

No, it is thanks to "tree of resources" design, that guard can do its
job.  That is not the same thing as saying that every segment has a
template.  Some resources do *not* render anything; instead, via
locateChild, or other mechanisms, they return other resources.

> And, IMHO, guard is a great semplification for handling authentication.

I agree with this statement.  I think you've reached the right conclusion,
just for the wrong reasons ;)

> Regards  Manlio Perillo

L. Daniel Burr

More information about the Twisted-web mailing list