Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!news.sprintlink.net!mv!usenet
From: rapp@lmr.mv.com (L. M. Rappaport)
Subject: Re: Identifying objects during debug
Message-ID: <DCwHMp.1ru@mv.mv.com>
Nntp-Posting-Host: lmr.mv.com
Sender: usenet@mv.mv.com (System Administrator)
Organization: MV Communications, Inc.
Date: Sun, 6 Aug 1995 20:53:57 GMT
References: <3vvr18$o5r@noc.tor.hookup.net> <3vvvfe$a1a@ixnews6.ix.netcom.com>
X-Newsreader: Forte Free Agent 1.0.82
Lines: 22

kentb@ix.netcom.com (Kent Beck) wrote:

>Simple solution:
>1. In inspector on one instance do "Foo := self".
>2. In inspector on other instance print "Foo == self".

>Better solution (from my perspective):
>1. Buy a copy of the Object Explorer. Because all the objects live in
>the same (graphical) address space, when you get two pointers to the
>same object, it displays as (gasp) two pointers to the same object.

Kent,

  Assuming the guy _wants_ to create a class with only one instance,
wouldn't this be a good place to use a "Singleton" pattern as defined
in Gamma et al (pg 127)?  

 Thanks,

Larry
--

