You may of course change a singleton, but changes to it are obviously global to your app. If that's not what you want, then you don't want a singleton.
But you might! The singleton class pattern isn't synonymous with static configuration. There are other uses for singletons.
Yeah sure, but in an OO-environment that means you're breaking encapsulation. Singletons don't.
Tell me how do singleton's break encapsulation any more/less than a set of package variables? If you're using them to return static configuration information (as you seem to be proposing) then they encapsulate exactly the same thing.
In reply to Re^12: what is a propper way to make a chunk of data accessible to all my packages for retrieval and modification ?
by adrianh
in thread what is a propper way to make a chunk of data accessible to all my packages for retrieval and modification ?
by leocharre
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |