Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.c++.moderated    |    Moderated discussion of C++ superhackery    |    33,346 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 32,740 of 33,346    |
|    Balog Pal to Gene Bushuyev    |
|    Re: Singletons    |
|    16 Dec 12 19:34:32    |
      From: pasa@lib.hu              On 11/26/2012 4:50 PM, Gene Bushuyev wrote:              > Yes, a global state creates serious problems, they are well known, but       > the solutions, like the link above trivialize the issues involved.       > It's not just a matter of more verbose syntax to pass the state or       > part thereof to every function or class that needs it, and it's not       > just a matter of memory overhead storing the references, it's also (a       > lot) more complicated logic. If the functions and classes have to work       > as if there were no global state, but rather many states, they have to       > take into account interactions between those states, which functions       > working with a single global state don't need to care of. And if at       > the end there is never a need for eliminating the global state then       > all the extra work was done in vain. OTOH, if only “dependency       > injection” has been done and code still assumes that all references       > are pointing to the same global state then those changes haven't       > solved a single singleton problem.              Best summary of this subthread this far.              I'd really be glad if DI proponents would react something as possibly I       mislooked some point in the tech.                     --        [ See http://www.gotw.ca/resources/clcm.htm for info about ]        [ comp.lang.c++.moderated. First time posters: Do this! ]              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca