|
Boost : |
From: Scott Woods (scottw_at_[hidden])
Date: 2005-01-13 20:00:17
From: "Jason Hise" <chaos_at_[hidden]>
To: <boost_at_[hidden]>
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.
:-)
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk