[Seaside] Lazy initialized

Dalarna Ors dalarna1907 at gmail.com
Sun Feb 23 16:11:39 UTC 2014


Hi,

Thank you and have a nice sunday

//Dal.


On Sun, Feb 23, 2014 at 4:23 PM, Michael Perscheid <
michaelperscheid at googlemail.com> wrote:

> Hi Dal,
>
> lazy initializing means to create the instance first in the getter
> accessor.
> This looks in Smalltalk like follows:
>
> #taskEditor
>         ^ taskEditor ifNil: [taskEditor := StTaskEditor new]
>
> Best regards,
> Michael
>
> On 23.02.2014, at 14:18, Dalarna Ors <dalarna1907 at gmail.com> wrote:
>
> > Hi,
> >
> > As I'm not smalltalk king yet I have some "struggle" with some stuffs
> from the tutorial.
> >
> > In this text author write about  lazy initialized .
> >
> > "
> > To connect the listed tasks to our newly created task editor we have to
> add an instance variable taskEditor to ourStRootComponent and create the
> accessors for it. In addition, it should be lazy initialized with an empty
> instance ofStTaskEditor. Of course, we could create a new instance for
> every edit request and thus get rid of the variable, but this would be an
> unnecessary overhead of object creation.
> > "
> >
> > How should I write the code ?
> >
> > //Dal.
> > _______________________________________________
> > seaside mailing list
> > seaside at lists.squeakfoundation.org
> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
> ---
> Dr.-Ing. Michael Perscheid
> michaelperscheid at googlemail.com
>
> http://www.michaelperscheid.de/
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20140223/76a40ea4/attachment.htm


More information about the seaside mailing list