[squeak-dev] Question about class and instance

Chris Cunnington smalltalktelevision at gmail.com
Fri Oct 12 19:11:01 UTC 2012


On Fri, Oct 12, 2012 at 2:23 PM, Joseph J Alotta <joseph.alotta at gmail.com>wrote:

> Is there a general rule for class and instance?
>
> For example, if there should be only one instance of an object, should it
> be a class object?
>

> Or if I expect it to stay in memory and be available all the time, should
> it be a class object?
>
> Thank you.
>
>
There are answers to these questions, but the depend on the context. That's
not an answer you want to hear. But here's a question you should ask: when
do I need an instance and when do I need a class? Try this:

aClassOfYourChoice allInstances explore

highlight and do that. Take a class like:

Point allInstances explore

See what's going on in those instances. That'll start to show you the jobs
of instances.
I don't know if that helps, but it came to mind. :)

Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20121012/bc05859b/attachment.htm


More information about the Squeak-dev mailing list