Finding instances of a given class

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Finding instances of a given class

Fernando Rodríguez
Hi,

I just found out SmalltalkSystem class and its singleton instance. How
can I find the name of that instance? I'd like to check out how the
system uses this model.

Thanks


Reply | Threaded
Open this post in threaded view
|

Re: Finding instances of a given class

Esteban A. Maringolo-2
Fernando escribió:
> Hi,
>
> I just found out SmalltalkSystem class and its singleton instance. How
> can I find the name of that instance? I'd like to check out how the
> system uses this model.

The variable is a class variable named "Current". You can access it
evaluating:

SmalltalkSystem current


Reading your questions, it seems you're missing some concepts or the
training to auto-explore the system (a characteristic of
smalltalks). I recommend you to read any of the free books available at:

http://www.iam.unibe.ch/~ducasse/FreeBooks.html


Or the Dolphin Education Centre:
http://www.object-arts.com/Lib/EducationCentre4/htm/helpcontents1.htm

Best regards.


--
Esteban A. Maringolo
[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: Finding instances of a given class

Ian Bartholomew-19
In reply to this post by Fernando Rodríguez
Fernando,

> I just found out SmalltalkSystem class and its singleton instance. How
> can I find the name of that instance?

It hasn't got a name.  It's held in the SmalltalkSystem 'Current" class
variable and other objects access it through the #current class method.

> I'd like to check out how the
> system uses this model.

One way is to look for all references to the class SmalltalkSystem
(Class/SystemBrowser, select the SystemBrowser class and then the menu
option Class/Browse/Class References).  You can then pick out the ones that
are sending #current.

You could also search for the text string "SmalltalkSystem current"
(Class/System Browser then Method/Browse/Containing Text)

If you do either of those you might think that the singleton is not used
much in the basic image.  This is because a number of the tools in the image
define their own shortcut accessor named #systemModel, so looking for
references to that selector (Class/System Browser then Workspace/References)
will find most of the times SmalltalkSystem is used.

--
Ian

Use the Reply-To address to contact me.
Mail sent to the From address is ignored.