This might be better suited for the DBI list, but primarily I'm
interested in learning more about the things necessary to enable me to
take an existing module's object and make its data persistent (via a
mysql database)
I've been giving thought to inheriting from the main module. Or not. in
no way am I sure what to do here, other than I know how I could do these
things in a more linear-programming fashion.
With Objects, though, I'm having a really tough time wrapping my brain
around the problem space. I mean, I grasp the concept of turning my
normally used functions, into the methods for the object... What I'm not
sure of is how to approach the problem.
The original object itself is at
http://www.webdragon.net/miscel/Subscriber.pm
One of the things I'm unclear on is that for the Subscriber::DB module,
should I be cloning the Subscriber object? Setting up multiple _init
methods to initialize their individual data-sets ?
(the Subscriber::DB object will need $database, $username, $password, a
DBI $dbh handle, and possibly a $hostname as well, in addition to the
data stored in the Subscriber object, that I wish to make persistent by
storing and retrieving it from the mysql database. )
I'm hoping to Module/object these functions so that I can re-use them
more efficiently in writing multiple programs for a client, towards a
particular goal. I've had other bits to work on while I studied this
portion of the problem, but now I'm at the point where I need to start
tackling it and am no closer to visualizing how it should work than I
was earlier. Can anyone offer some insight/examples from their own
experience with similar things? :)
I've read Damian Conway's "OOP" and while very good, it really
glosses-over the persistence thing with examples more suitable for
DB_File .. *sigh* .. And I still don't know whether I should be
inheriting from Subscriber or not..
Your insights would be greatly appreciated.