At 05:57 PM 09/05/2002, you wrote:
> > What I use is a class thatdisplays a tabular list of items. It's an
> > abstract base class -- so on it's own, it does nothing.
>Excellent suggestion, I'll investigate further. Do you wrap this with a
>template page, or is the page itself an object?
It's wrapped in a template (regular PHP page). The table itself uses a
template (again, another PHP page) to render the table itself (basically,
>Also, I've seen several posts mention the use of a superclass to handle db
>connections. Is this a common practice? For my app I created a smallish db
>class and, instead of inheriting, I make it global in my other class
>methods. It seems to work fine for me, but I'm not doing super-sophisticated
>db stuff. Anyone care to share pros or cons for either approach?
I have a database connection class which I stuff in a global variable to
make it available to all the class (and regular code) in the script. The
connection class contains methods for connecting to the database and
executing queries. However, objects which use the database generally
inherit from a more generic base class which handles database tasks common
to all objects (namely inserting new objects, updating objects, deleting
>I *do* have a global application class for tracking application state (which
>user is logged in, what task he is manipulating), but I'm beginning to this
>think this is a mistake. The main reason is because PHP sessions timeout
>and I lose the (registered) global object if there is no activity for a
>while. So I'm thinking I'll just go back to URLs and hidden fields for these
>kinds of things. Any ideas?
A hybrid design is the best course of action. Sessions timeout because you
never know if someone has closed their browser. It's the period of
inactivity, which is probably good for login information. URLs and hidden
fields are "insecure" so you probably don't want to use that to store which
user is logged in. But you probably do want to use URLs and hidden fields
for tracking which task he is manipulating. If the user opens two browser
windows on your app, storing it globally will make that application behave
more erratically. (For example, I wouldn't be able to have two different
tasks open in different windows, because you store that globally).
WebMotif Net Services, Inc.