[perlWebSite-devel] steps for OO
Status: Alpha
Brought to you by:
oubiwann-dep
|
From: McGreggor, D. <DMc...@gp...> - 2002-02-28 23:00:46
|
This is a repeat, since David hadn't joined yet: So, I was wondering - what would it take to make this oo? As an expample, I've got a global variable for the connection to the =3D database. if I make a wrapper perl mod for all the mods I am using, I = =3D could do something like this: $mySite =3D3D new perlWebSite(); This should read the config file and do the following according to what = =3D is setup in there: 1) establish a connection to the db 2) start caching 3) start sessions 4) etc. Now, I would assume that this need only be called once during a session, = =3D right? So if 5 .cgi's later I want to do this: $sql =3D3D "SELECT * from users"; @users =3D3D $mySite->SQLResultAsArray($sql); I can, and it's going to know all about the $dbh connection that I made = =3D in new perlWebSite(); But, what are the mechanics behind this? I have to = =3D store the object in the session somehow (serialize it? I have to find = =3D out if that is done automatically with the module I am thinking about = =3D using).=3D20 Any ideas or input? |