in reply to Re: OOP design related question.
in thread OOP design related question.
The thing that I dont understand about singleton's. I know that you can create only one at any given time - but is that sort to say system wide - or just in that process?
I believe it's just for that process of course - but then again it raises questions what happens when you work under mod_perl or similar (threads?)
Anyway the code that you wrote (just checking if I understood everything right) allows me to create more instances of DBIx::Handy, but only one DB connection?
Problem is that I will need two DB connections as at one point of time, I need to read data from another DB ... One idea would be to use Memoize and since call to connect would have different parameters it would create different DBH. Then it gets even more complicated :) As to do so I need to store several DBH and somehow tell to DBIx::Handy which one to use for particular query...
I like your idea as it's simple...
|
---|