[Seaside] StateHolder

Stephen Pair spair at acm.org
Tue Mar 4 14:18:43 UTC 2003


Actually, In Squeak, ValueHolder uses #contents, #contents:.  This is at
odds with other Smalltalk implementations.  I wonder how this situation
came about.

Actually, since there is ambiguity in the #value: message (blocks treat
the argument as a parameter, whereas value holders and associations
treat this message as a setter), I'd be open to changing these selectors
to something like:

#value: 
#value
#valueWith:
#valueWith:with:
...
#valueWithArguments:

In this way, different objects could choose which of these methods is
appropriate for them (i.e. ValueHolders and Associations would implement
#value: and #value; blocks would implement everything but #value:; etc).
Any objects that allow the answer to #value to be set directly would
implement #value: and valuables that accept a single argument would
implement #valueWith: (instead of #value:).  The messages #valueWith:
and #valueWith:with: even seem clearer to me than #value: and
#value:value: (which would seem to indicate that I'm evaluating the
receiver twice).

- Stephen

> -----Original Message-----
> From: seaside-bounces at lists.squeakfoundation.org 
> [mailto:seaside-bounces at lists.squeakfoundation.org] On Behalf 
> Of Masashi Umezawa
> Sent: Tuesday, March 04, 2003 8:12 AM
> To: The Squeak Enterprise Aubergines Server - general discussion.
> Subject: Re: [Seaside] StateHolder
> 
> 
> Hi,
> 
> Sorry for the late comment. But I have one simple question. 
> 
> > 2.  Seaside solves this by introducing a class for holding 
> state that 
> > needs to be backtrack-aware.  A StateHolder is just like a 
> > ValueHolder, but it detects use of the back button, and adjusts its 
> > state accordingly. To be more specific: whenever a link is 
> clicked on 
> > a page, all of the StateHolders for the current session take on the 
> > value that they had when that particular page was produced.
> 
> Why StateHolder does not have the same protocol 
> (value/value:) as ValueHolder? I am (or other Smalltalkers 
> would be) familiar with codes like this:
> 
> increment
>     self count value: self count value + 1.
> 
> count
>     count isNil ifTrue: [count := session newStateHolder].
>      ^count
> 
> I think this will shorten the learning curve. (at least for VWers)
> 
> Cheers,
> ---
> [:masashi | ^umezawa]
> 
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/listinfo/seaside
> 



More information about the Squeak-dev mailing list