[Seaside] session reference

Avi Bryant seaside@lists.squeakfoundation.org
Mon, 9 Dec 2002 14:01:43 -0800 (PST)


On Mon, 9 Dec 2002, Jeffrey Odell wrote:

> I don't yet have any practical experience that indicates how much state
> I want tracked, vs. how much is transient.  If you find yourself marking
> half of the state as transient anyway, it would be as easy to just us a
> specialized accessor to mark the state that needs to be tracked.

There are actually three categories - variables that get overwritten on
every request (usually those tied to form inputs where the entire
component is a form), variables that are set on initialization and never
change (frequently subcomponents, or model objects), and those that only
change every once in a while.  It's only this last category that needs to
be tracked.  So half is probably about right.

One option I'm currently thinking about is moving to a state dictionary
and then adding a custom class definition form that would generate the
necessary accessors - something like

WAComponent subclass: #Foo
  instanceVariableNames: 'x y'
  stateVariableNames: 'z'
  ...

Which would then create

x
 ^ state at: #x

x: anObject
  ^ state at: #x put: anObject


Jeff, how feasible would that be in Dolphin?