Re:Introducing Bing Code Search for C#
by d0 on Tuesday February 18, 2014 @07:09AM
(#7257654)
Yes exactly that.
The difference is that your Objective-C/iOS application doesn't consist of thousands of threads which require synchronised access to these objects. It's a pretty static thing with an event loop. Possible a couple of background worker threads.
For a desktop application or even mobile application it's fine but for a massively scalable back-end enterprise system it's a pain in the butt.
Singletons are not for managing lifetime as well. They are a container for an object -- nothing else. Lifetime should be managed separately i.e using a container/service locator or something. Everything I've seen Cocoa-wise is pretty decoupled so far. There are some crimes but only inexperience seems to require them.
Re:Introducing Bing Code Search for C#
by UK-AL on Tuesday February 18, 2014 @07:13AM
(#7257672)
"Singletons are not for managing lifetime as well" - No, but you can replace it with something that does. I.E Single Object with application lifetime vs singleton.
The difference is that your Objective-C/iOS application doesn't consist of thousands of threads which require synchronised access to these objects. It's a pretty static thing with an event loop. Possible a couple of background worker threads.
For a desktop application or even mobile application it's fine but for a massively scalable back-end enterprise system it's a pain in the butt.
Singletons are not for managing lifetime as well. They are a container for an object -- nothing else. Lifetime should be managed separately i.e using a container/service locator or something. Everything I've seen Cocoa-wise is pretty decoupled so far. There are some crimes but only inexperience seems to require them.