[Twisted-web] fragments with child lookup

Manlio Perillo manlio_perillo at libero.it
Fri Oct 13 10:25:12 CDT 2006


L. Daniel Burr ha scritto:
> 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.
> 


Then I don't understand what do you mean by "template-per-segment" design...

In the URL http://myhost.com/foo/bar/baz, the resource living at baz
depends upon foo and bar because of the "tree of resurces" design.




Regards  Manlio Perillo



More information about the Twisted-web mailing list