[Seaside] Setting instance variables

Jim Benson jb@speed.net
Thu, 6 Jun 2002 00:54:52 -0700


Do you think I should just step up to 9.4 then? After you've experimented
with axing the bindings, what is your opinion of the new approach?


----- Original Message -----
From: "Avi Bryant" <avi@beta4.com>
To: "Jim Benson" <jb@speed.net>
Cc: <seaside@lists.squeakfoundation.org>
Sent: Thursday, June 06, 2002 1:01 AM
Subject: Re: [Seaside] Setting instance variables

> On Thu, 6 Jun 2002, Jim Benson wrote:
> > Hmm,
> >
> > This approach doesn't seem very MVC to me.
> >
> > I view the top page as the model, I'm not sure in general that I want to
> > keep track of things in the main component in order to properly
> > subcomponents.
> I agree, it's not great (but actually it isn't/won't be a problem with
> 0.94, see below).  Honestly, I've never run into that particular issue
> before - generally, if the parent is providing data to the subcomponents,
> it wants to keep track of how that data's changing or be able to modify it
> later.
> In general, the management of state (shared and not shared) between
> parents and subcomponents is the trickiest issue, by far, of the
> framework.  This becomes particularly apparent when you do things like put
> subcomponents inside a repeat - there's only one instance, so any
> per-repetition state has to be external, etc.
> The issues of parent/child communication were one of the main reasons for
> the reworking of the bindings system into the events system used in the
> current snapshot.  In fact, come to think of it, the current snapshot
> doesn't have that problem.  You'd just do this:
> addHandlers
>   (template elementNamed: 'previousMonth')
>     month: ....
>   (template elementNamed: 'currentMonth')
>     month: ...
> However, this wouldn't work as well when you had subcomponents dynamically
> changing their class, (ie the earlier thread with tim on question types),
> since that implies subcomponents being created multiple times in the
> lifetime of a template.  So likely this will evolve into something like
> addHandlers
>   (template elementNamed: 'previousMonth')
>     onCreation: [:m | m month: ...]
> _______________________________________________
> Seaside mailing list
> Seaside@lists.squeakfoundation.org
> http://lists.squeakfoundation.org/listinfo/seaside