G
goo
Guest
For us that is not that familiar with oo, I am still a bit confused. Singelton: I need to use i.e. class:instance:method()/properties to use it. To be honest, it is just for that I find it a bit fussy. Static Is loaded into session, is a pain when in development since I need to restart session when testing. Other than that, it works more than swell. Nice to read and it does what I need it to do. I haven’t taken the step into interface/abstract/ etc… that’s another ballgame. I believe I need to crawl before I can walk What Mike/Peter talks about is a bit unclear for me: A singleton combines implementation and registry. If I understand that correct, it is because it is NEW’ed in the class first time it is refered? A caller needs to know the implementing class” What do you mean? Singletons are not mockable when unit-testing etc.. This is for next level oo Are there examples regarding other, better ways of doing this? “….There may be more elegant solutions than a singleton.” //Geir Otto
Continue reading...
Continue reading...