Newsgroups: comp.object,comp.lang.smalltalk,comp.lang.c++,comp.client-server
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!fas-news.harvard.edu!newspump.wustl.edu!news.ecn.bgu.edu!vixen.cso.uiuc.edu!newsfeed.internetmci.com!tank.news.pipex.net!pipex!sunsite.doc.ic.ac.uk!susx.ac.uk!news.bton.ac.uk!Simon.Shurville
From: sjs16@bton.ac (Simon John Shurville)
Subject: Newcomer's question on norms of implementing singletons in 
 smalltalk 
X-Nntp-Posting-Host: tomcat.itri.bton.ac.uk
Message-ID: <DJ2Iq3.CIw@bton.ac.uk>
X-Posted-From: InterNews 1.0@diamond.bton.ac.uk.
Lines: 17
Sender: -Not-Authenticated-[3206]
Organization: The Composer Project
References: <48spd4$s30@ixnews4.ix.netcom.com> <30B34179.66AF@oma.com> 
 <NEWTNews.817067535.430.steve@sallys.projtech.com> 
 <RMARTIN.95Nov23092939@rcm.oma.com> 
 <NEWTNews.817235169.4117.steve@sallys.projtech.com> <RM> 
 <NEWTNews.817931223.5934.steve@sallys.r
Date: Mon, 4 Dec 1995 15:22:50 GMT
Xdisclaimer: No attempt was made to authenticate the sender's name.
Xref: glinda.oz.cs.cmu.edu comp.object:41970 comp.lang.smalltalk:31506 comp.lang.c++:163257 comp.client-server:14240

I am writing an application that will contain several sets which need
to communicate with one another. Instead of using a global variable to
contain the model I would like to use a singleton (as described by
Gamma et al), i.e., a one-off object that is easy for other objects to
find. This seems to lower the amount of hard coding that would link
sets together  via a global variable name (although I imagine that the
class name would need to be hard wired).

I can see that this should be easy to do in smalltalk; but I wonder
what your collective standards and norms are? If, for example, I create
some sets as class variables and then set up relationships between them
that are mediated via the singleton would other programmers swear under
their breath during maintenance? Is there a more standard way to do
this that I have not yet come across? Your opinions would be very
welcome.





