tcl-websh-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ronnie Brunner <>
Subject Re: web app commands
Date Fri, 06 Dec 2002 13:11:16 GMT
> I'm looking at implementing something for Rivet that might end up
> looking like what Websh has, for more "web application" style
> programming.  I'm curious if you guys have any thoughts, after having
> used it for a while, on how you might do the 'dispatch' part of your
> code better?  Anything you're not happy with?

A brief history: in Websh1 and Websh2, the dispatching was
automatic. The script was sourced and after that, an internal command
was called that did the dispatching. The user (developer) had no
control over how a command was dispatched. (The only thing he could do
was to [exit] in the script, so there would not be any dispatching at
In Websh3 we ask the developer to explicitly use that mechanism. This
has the advantage that the design is much celarer and there is no need
for Websh to use any "magic" to do things after a script has been
eval'd. (Before that, we couldn't make it a proper TEA extension
Usage right now is ok I think.
Regarding the MVC pattern, it certainly has nothing todo with the V,
but it does not cleary distinguish between its M anc C components:
On the one hand it's clearly the M: it controlles the model of what
commands we have and it reacts to C (the user input). But it's also
part of the C, because the query parameter and form vars are only set
up from within web::dispatch. (I.e. now you can only read query string
params using [web::param] after [web::dispatch] is called, because by
how you (the developer) call web::dispatch you decide what data to use
as source for the params and form vars.)
Maybe these two parts should be separated somehow. From what I know of
Rivet, you have the input (C) processed separately anyway, so the
question would just be how to add the dispatch. But the dispatching
alone is pretty simple: basically its just a switch that evals a
command specified by a parameter.

> I would really like to seperate out the M, V, and C components
> completely, though, something that, at least in the Websh examples
> I've seen isn't really prevalent.

See above and: the examples are certainly not great in that area. Much
of it has not really to do with Websh itself but more with how it is
used. (Specifically separating the V from the rest.)

> I think I may have something interesting - I rewrote my TclChat app in
> such a way as to completely seperate the display, control and data
> model.  More later...

Ronnie Brunner                     
Netcetera AG, 8040 Zuerich     phone +41 1 247 79 79 fax +41 1 247 70 75

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message