
From: "Jason Hise" <chaos@ezequal.com> To: <boost@lists.boost.org> Sent: Friday, January 14, 2005 11:59 AM Subject: Re: [boost] Singleton (with Singleton Registry: Clarification)
The "typical problem" is that objects in any substantial application want to be destroyed in a runtime-dependent order. The exact order is driven by what activity occurs during execution. Trying to dictate an order (i.e. longevity-int) onto something that is dynamic is... misdirected.
For this "typical problem", wouldn't it make sense to simply use a dependency oriented lifetime? This way there is no need to keep track of the ints across the application, and singletons are created exactly when they are needed and destroyed as soon as they are no longer required.
Exactly. That is the only "real" solution to the underlying problem. I was conceding something in my recent response to Mithun, i.e. in the absence of a "real" solution the longevity-int-ordering may still offer some value. Personally I remain uncomfortable that it "takes everyones eye off the ball". Maybe its worse. Maybe its more like "playing a beautiful forehand with a ball from a neighbouring court"? Oh dear. Sporting analogies. :-)