Image-based persistence or something else?

Markus Gaelli gaelli at emergent.de
Fri Mar 17 09:55:11 UTC 2006


On Mar 17, 2006, at 6:14 AM, Diego Fernandez wrote:

> Why not using a global to save the instance, instead of a  
> "Singleton" with class variables?
> This is unnecessary in St.

I don't agree because
- Singletons make the usage of global variables more cumbersome, thus  
hopefully more rare.
- Singletons are a - still too - widespread pattern now, developers  
expect them more than pure globals. Don't surprise your readers...

In my opinion a well designed system only has one root but lot of  
context.
Each context should be as big as necessary but as narrow as possible.
As soon as you need to introduce a second singleton into your  
application - think twice.

Cheers,

Markus



More information about the Squeak-dev mailing list