[Seaside] StateHolders and complex objects -djb

Derek Brans brans at nerdonawire.com
Sat Feb 8 12:31:24 CET 2003


I get it.  Thanks.
On Saturday, February 8, 2003, at 11:35 AM, Avi Bryant wrote:

>
> On Sat, 8 Feb 2003, Derek Brans wrote:
>
>> Avi, Julian,
>>
>> Are stateholders able to manage collections?  Do attributes on objects
>> in the collection get rolled back?
>> In general, if a stateholder maintains some complex object, what 
>> aspects
>> of that object get rolled back?
>
> Derek,
>
> The point of StateHolder (as opposed to the various other state rollback
> schemes I've used) is that the semantics are very clear and very simple.
> There is only one value that changes automatically, and that is the
> #contents of the StateHolder: which object it is holding on to.  No 
> state
> in the object its pointing to is changed at all.
>
> If you want to maintain a Collection in a StateHolder, I recommend you 
> do
> it functionally - with no mutation.  For example,
>
> initialize
>   foo := session stateHolder contents: #().
>
> addToFoo: anObject
>   foo contents: (foo contents copyWith: anObject)
>
> removeFromFoo: anObject
>   foo contents: (foo contents copyWithout: anObject)
>
>
>
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/listinfo/seaside
>
>
Nerd on a Wire: Web and Information Solutions
Website Design - Database Systems - Site Hosting
604.874.6463
mailto:info at nerdonawire.com
For more information, visit http://nerdonawire.com



More information about the Seaside mailing list