tcl-websh-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From (David N. Welton)
Subject Re: web app commands
Date Mon, 09 Dec 2002 06:33:15 GMT
Ronnie Brunner <> writes:

> 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.)

The system I threw together differs slightly from websh, but only

I think that either one can do MVC without problems - the way I did
things was like so:

web dispatcher - this file receives the dispatches for different V

gui - a file that loads the specific gui requested:

webgui - web display code, which consists mostly of calling different
template files.

tkgui - this one holds the equivalent tk commands to get a similar
looking front end.

controlling logic - a seperate file with logic that is independant of
V and M.  These are called from the dispatcher.

model - in this case, a direct link to the backend, although it
wouldn't be hard to abstract it out for different backends as I did
with the web and tk interfaces.

The only thing that doesn't quite match the MVC described in my design
patterns book is the fact that the model doesn't have a good way of
pushing changes out to the V layer, because of the way web the web
works.  You only get to act when the user asks for it.

David N. Welton
Free Software:
   Apache Tcl:

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

View raw message