| muhuk | asks | don't you (KDE users) feel all vulnerable and exposed without a good trash management system? |
| shaf |
| shaf | Have you worked than one out yet ? |
| muhuk | says | But it still works on my box |
| shaf | asks if it's that simple to implement the singleton pattern in python |
| muhuk | says | shaf: stackoverflow.com/questions/31875/is-there-a-simple-elegant-way-to-define-singletons-in-python |
| shaf | yeah but what's to stop you from executing the script using another python intepreter ? Singleton breaks. |
| shaf | It's just that singleton is the simplest pattern to understand but can be tricky to implement if you don't understand your compiler/interptr |
| shaf | exactly |
| shaf | this is why in any good production environment. Singleton is frowned upon |
| shaf | especially read the last few paragraphs of this ... en.wikipedia.org/wiki/Singleton_pattern#Implementation |
| timka.org | says | Yeah, in our production environment at work two instances of our app can fuck up the DB just because nobody cared about proper locking |
| timka.org | says | It's about thread-safety inside single process, but you were talking about multiple processes |
| shaf | hence the reason for me to have mixed feelings about it. If used - use it carefully |
| shaf | well some idiot programmers assume singletons to work across processes too |
| timka.org | says | Agree. And punish those who break the conventions! |
| timka.org | says | I think you can only fire or train them. Hard choice... |
| muhuk | says | on the other hand, most of the time singleton is not really needed in practice. Surely there is one trash (per user) but I have come to... |
| muhuk | says | ...realize I don't need a singleton trash wrapper class at all. It is even making things harder to unittest. |
| muhuk | says | Btw, a singleton shouldn't be confused as a concurrency mechanism (especially in multi-process systems). |
| timka.org | says | Anyway, Singleton is just an object creation pattern, conceptually it has nothing to do with concurrency. |
| timka.org | says | However, correct implementations must be aware of the used concurrency model |
© copyright 2007-2012 Plurk Search People Search Verified Account APIFAQ
Contact Us About Blog Jobs Terms Privacy
