"be consistent" | |
PerlMonks |
Re: Re: sharing a complex set of objects between httpd processesby thpfft (Chaplain) |
on Mar 15, 2003 at 03:29 UTC ( [id://243244]=note: print w/replies, xml ) | Need Help?? |
Thank you (both): very clear and helpful. The short answer is that I may well not need the singleton at all: it came from a quite possibly misguided idea of what would be an elegant and economical way to manage the proliferation of Class::DBI subclasses. I'm beginning to see that it's a relic of old bad cgi thinking. The fifty or so require()s involved in loading all the cdbi subclasses made the construction of the factory object seem much heavier than it really is, since all that presumably gets compiled away at the beginning. If I make sure the Template object and DBI handles are being managed sensibly, the difference made by the singleton is probably negligible. The one thing that I do need to share out among all the processes - apart from the database classes, which can look after themselves - is a new tied-DB-based inverted index. But that will actually get easier, I think, if I don't try and hang on to the factory object after a request has been processed. pardon me thinking out loud: i always find that making a fool of myself in public is the best way to lend urgency to the tired brain :(
In Section
Seekers of Perl Wisdom
|
|