[Seaside] Lazy initialized
dalarna1907 at gmail.com
Sun Feb 23 16:11:39 UTC 2014
Thank you and have a nice sunday
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
> This looks in Smalltalk like follows:
> ^ taskEditor ifNil: [taskEditor := StTaskEditor new]
> Best regards,
> 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
> seaside mailing list
> seaside at lists.squeakfoundation.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the seaside