[Newbies] System Browser: instance vs. class

Alex Schenkman alex at schenkman.info
Mon Feb 1 06:30:39 UTC 2010


On Mon, Feb 1, 2010 at 01:22, lanas <lanas at securenet.net> wrote:

>
> CarAssembler class>>using: aCarFactory
>  ^self new factory: aCarFactory
>
> I think this a pattern for instance creation.
The point is that you can clearly see what it takes to create a instance of
CarAssembler, namely, a CarFactory.

Notice that:
self new               "will create the instance"
factory: a CarFactory  "is storing aCarFactory in the instance, not the
class"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20100201/bb45dfec/attachment.htm


More information about the Beginners mailing list