
24 Aug
2011
24 Aug
'11
1:29 p.m.
On 24-Aug-2011, at 9:18 PM, Mathias Gaunard wrote:
On 24/08/2011 04:28, Ben Robinson wrote:
Mathias,
I think this discussion is getting a little off track. There is a lot of literature on creating a thread-safe Singleton that manages the lifetime of your object according to your needs. However, there is no silver bullet for the pattern. Different variants make different tradeoffs depending on the user's needs. The three issues that are inherent to Singleton are:
1) You have little control over when the Singleton is destroyed. Should you have multiple Singleton which depend on each-other, very often you need a very specific teardown order.
It should be the inverse order of the construction order.
Consider dependency between singletons