chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] A call to arms


From: Alaric Snell-Pym
Subject: Re: [Chicken-users] A call to arms
Date: Thu, 22 Jan 2009 11:55:48 +0000


On 22 Jan 2009, at 11:40 am, Tobia Conforto wrote:

Ok, since you asked for it... here are some random thoughts on an
"ideal web application framework"


- No database/SQL (except where truly needed) just plain S-expr file
storage

Using Git as a filesystem is clearly the best solution.  I would use
it with s-expr files though, not XML (ugh!) as XML and HTML data can
always be represented with sxml if need be.

Databases can be left to their true purpose (dealing with a million
customer records, orders, products, invoices, forum posts...) while
everything else is stored in plain, versioned, s-expr files.


IMHO, the web app framework shouldn't depend on how data is stored at
all...

Don't forget my earlier work on Wings:

https://galinha.ucpel.tche.br/svn/chicken-eggs/release/3/wings/trunk
(anyonymous / blank)

The plan there is to create a loose framework for modules to be
composed. I'm not interested in databases vs. filesystems.

I was working towards a storage abstraction when my house flooded and
my career took a shift away from Web apps, but my provisional plan was
to go with the getter/setter system we already have.

A "data store" is a function that takes some arguments to identify a
thing, and returns the value of that thing, or #f if that thing
doesn't exist. And if it's writable you can call `set!` to set a new
value back.

That way you can provide an object-relational mapper that just returns
a function per table, that takes a row ID and returns the row object.

Or you can provide a function that looks at sexprs in git. Or XML. Or
JSON. Or YAML. Or...

That doesn't just support single-record reads and writes - an SQL
query like "SELECT * FROM employees WHERE salary >= ? AND salary <= ?"
can be wrapped into a function that takes two arguments and returns a
list of employees, and doesn't provide a setter.

Anyway, having established that convention, the Wings type-aware-URL-
parser would be extended with a declaration that a given parameter (or
group of parameters) were actually identifiers of a database object,
and nominating the getter-function. When parsing the URL, it would
then assemble them and call the getter function. If it returned #f
(not found), then the whole request would automatically 404;
otherwise, your code would see a single parameter name bound to the
returned value (yet still have access to the identifier parameters, so
it could set! changes back).


- Multi-tiered, component-based architecture


Yes. I'm sick of web app frameworks that make me do everything THEIR
WAY.

If anybody wants to pick Wings up and develop it further - PLEASE DO!

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]