tcl-websh-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From (David N. Welton)
Subject Re: Fwd: Re: open bug list / bug filecontext
Date Fri, 30 Nov 2001 14:58:12 GMT
Simon Hefti <> writes:

> > Ensure -path option in web::filecontext, or
> >   make it the first argument (depends on parent class)

> > 1) if I'm understanding correctly, the -path argument must be passed
> >    to this command?  And one way of doing that might just be to say
> >    "ok, the first command has to be -path", or maybe by eliminating
> >    the -path command and just stating that the first argument to
> >    filecontext is the path?

> > 2) What exactly does the reference to the 'parent class' mean?  I've
> >    been reading the code, and understand the idea behind the 'factory'
> >    somewhat, but the 'parent class'?  Does the factory system create
> >    subclasses?

> web::filecontext should probably have a -path argument to be able to
> specify the location of the data files.

So is there anything wrong with making it a required option within
filecontext itself? 

        if {! [info exists [subst $${ctxmgrname}::_path]] } {
                error "web::filecontext requires a -path argument"

It does cause a number of tests to fail, but that happens when you
change an API.

> Now, why not make it a required argument instead of an option ?
> Because we could add an other data container, e.g. a DB, which would
> use excatly the same API (init, cset, commit etc). Here a path
> argument would not make sense, of course. This is what I meant with
> "parent class": whatever session container we use, it will be
> created using "web::sessioncontextfactory", which defines the
> methods _parseargs, init, new, commit, id, and _load and which
> creates the required, but not yet implemented methods load, save,
> and invalidate (in java we would use an "interface"). The "derived
> classes" then actually implement these methods, as you can see in:
> web::filecontext (also in sessctx.ws3) and in cookie.ws3.

David N. Welton
Free Software:
   Apache Tcl:

View raw message