On Wed, 2 Oct 2002, william ross wrote: > I did have it set up that way at one point. it worked quite nicely as > long as I made the singleton in a subclass of the main Factory (which > might be shared by several applications with different configurations). > i gave up on it in the end because it seemed a bit overheated, but if > you approve, i shall reconsider.
I'm not quite following you. Overheated? > so, rehearsing: all it should take is a Factory::Subclass->new(config > blah) in the startup script and a Factory::Subclass->instance() in the > handler? it does sound good if you put it like that. > > incidentally I made the singleton like this (yes, more poop): > > use base qw (Class::DBI::Factory Class::Singleton); > ... > sub _new_instance { shift->new(@_) } > > but it felt rather naughty to subclass the private _new_instance. if > anyone knows a better way, I'd be very glad to hear it. Check out Class::Singleton. -dave /*================== www.urth.org we await the New Sun ==================*/