Re: [Pas-dev] more on generic DB session obj
Status: Beta
Brought to you by:
mortis
|
From: Kyle R . B. <mo...@vo...> - 2002-05-17 19:48:52
|
> Poking around the directory some more:
>
> - Org::Bgw::Pas::Session::MySQL becomes Org::Bgw::Pas::Session::DB. _factory()
> method gets re-written to look up the driver from the config file and
> instantiate the appropriate DB factory driver for the session.
>
> - Then we create a new Org::Bgw::Pas::Session::Factory. Stuff that can be moved
> from Org::Bgw::Pas::Session::MySQL::Factory will be moved into this new class.
>
> - The MySQL directory gets moved to a new name Factory.
>
> - Org::Bgw::Pas::Session::MySQL::Factory becomes
> Org::Bgw::Pas::Session::Factory::MySQL. All generic stuff is striped so it's
> MySQL specific and it's parent becomes Org::Bgw::Pas::Session::Factory.
I like the idea of using a factory...but I don't want it to do a config lookup
every time it creates a session object...perhaps we can cache it somewhere?
Or am I just being paranoid? Are the config lookups just as fast? In fact,
that might be what it's doing now...
I'm not yet set on what I think the cleanest/best design should be. This
looks good at first glance. I'm not necessarily convinced that what I wrote
for the MySQL/Factory objets was a good appraoch to start with :)
> - In the conf file we should add the driver to make it easy for the person to
> tell the app what DB they want to run for the session. So you'll now have up to
> 7 session variables for the config file:
>
> pas.session.dbname
> pas.session.driver
> pas.session.dsn
> pas.session.hostname
> pas.session.password
> pas.session.table
> pas.session.username
Maybe prefix these with pas.session.db.* to follow the convention? We
currently have pas.session.file.*, pas.session.apache.*, and
pas.session.mysql.*, so perhaps it should be pas.session.db.*?
> Of course, if you specify the dsn, you can skip the dbname & hostname. The
> driver parameter will be a requirement!
The reason dsn is in there as a parameter is because it's actualy hard to
dynamicly build a dsn depending on the driver and the options the user
wants to pass. Maybe we should just forget the dbname, and hostname and
expect the user to specify them in the dsn?
> Any questions? Does this sound good? Can I take a chain saw to it? I'll at
> least get this working for MySQL in the near future. Other implementations
> shouldn't be hard.
It sounds good so far, I just want to talk about it some more until I feel
comfortable about it.
Kyle
--
------------------------------------------------------------------------------
Wisdom and Compassion are inseparable.
-- Christmas Humphreys
mo...@vo... http://www.voicenet.com/~mortis
------------------------------------------------------------------------------
|