chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Suggestion for new egg: Wings!


From: Alaric Snell-Pym
Subject: Re: [Chicken-users] Suggestion for new egg: Wings!
Date: Fri, 6 Jul 2007 18:31:37 +0100


On 6 Jul 2007, at 3:18 am, Ivan Raikov wrote:



Hello,

    The design you are describing still sounds very much based on
imperative programming, not to mention that having one global
environment with all your web variables is not particularly scalable
or secure.

Ah, but the environment is accessed via a parameter that's bound to a
closure that accesses the environment - that's the
"public" interface to the environment. The reason for this being
precisely what you start to suggest below:

I think it might be better to go for a Zope-like approach,
where the resources are organized in a tree (or some other type of
hierarchical structure), which has to be traversed by the client from
the top down, in order to access the different resources.

With a little mild extension to spiffy's access file system, I
imagined that one could put files in directories that contain
functions that 'wrap' the execution of a handler (eg, are passed a
thunk that will actually handle the page) for all files in that
directory or beneath. With the wings environment in a parameter like
so, they can surround it in a dynamic environment that alters the
environment for just those files, by substituting in a closure that
checks a list of local overrides, then falls back to the previous
environment (which may itself have been modified further up).

on. I think that this kind of tree traversal approach would give you
so much more flexibility, because the subtrees in the resource tree
don't have to be all loaded in memory at once, so they can be
dynamically generated, distributed across servers, etc, etc.  So
perhaps a good first step would be to write a generic resource tree
library.

I was hoping to use the filesystem for that, albeit perhaps with some
caching so you're not having to read and parse the directory metadata
files all the time.

FYI, my inspiration for the directory metadata system comes from an
app framework I produced in Java back in 2000 or so, which used the
java.util.Properties class; this can load a "properties" file from
the filesystem, containing key&value pairs, while also optionally
referencing an existing Properties instance of 'defaults'. We chained
them together from properties files inside each directory to set up
resources. This included a navigation generator widget that inherited
extra menus as you went down each level of the site hierarchy, which
was kind of cool!


   -Ivan


ABS

--
Alaric Snell-Pym
Work: http://www.snell-systems.co.uk/
Play: http://www.snell-pym.org.uk/alaric/
Blog: http://www.snell-pym.org.uk/?author=4






reply via email to

[Prev in Thread] Current Thread [Next in Thread]