Are there any ideas how an (M)VC framework could be constructed (VC
being more important than M)?
- a restful dispatcher to handle requests:
the dispatcher should get a specification list like
[{'GET', "/an_url", Handler},
{'POST', "/another_url", Handler2}, ...]
Handlers could be either {Module, Fun} or {Node, module, Fun} if the
handler should be called on a remote node. Or a list of Handlers to be
called in sequence.
- A template language for the view part.
I use sgte http://code.google.com/p/sgte/ , but I'm a little biased
since I'm the author :-)
ewgi should allow easy composition of the various parts. At least when
it will be more defined :-). At the moment I'm experimenting with the
interface I've defined to see if it works.
cheers,
filippo
Whatever dispatch system you finalize on, I suggest that you first
lookup by URL path, then lookup by HTTP method. If the first lookup
fails, return a 404 error; if the second lookup fails, return a 405
error and set the Allowed field in the response header.
In the past in python I had used 501 (Method Not Implemened) has a
status code when the method did not match, but rereading the rfc 405 is
the right response.
thanks,
filippo
I think you'll get more bang for your buck by porting ErlyWeb to
MochiWeb. Why duplicate all the work that went into ErlyWeb just to
support another web server?
Yariv