[Seaside] Am doing things properly? -djb

Avi Bryant avi at beta4.com
Wed Jan 29 22:31:07 CET 2003



On Wed, 29 Jan 2003, Derek Brans wrote:

> This simple application gives me an error when I try to increment the
> counter.  The count somehow has becomes nil.  Have a look at the code,
> though.

I've got it.

You use a lazy initialization pattern for the 'container' instance
variable, which means it ends up getting created during the
#renderContentOn: method.

One of the inherent assumptions Seaside makes is that the render methods
are functional - they have no side effects, or no important ones.  This
violates that assumption (which I should clearly make more formal), and
that causes some wierd problems.

If you create the container in the #initialize method instead, everything
works.

Avi



More information about the Seaside mailing list