[Seaside] 2.5 sushi store shopping cart & back button

Avi Bryant avi.bryant at gmail.com
Tue Nov 15 01:18:46 CET 2005

On Nov 14, 2005, at 3:53 PM, Brent Vukmer wrote:

> I'm using an image downloaded from seaside.st; I was playing with  
> the sushi store demo, specifically the shopping cart.
> I went to the Anago page and added 3 pieces of Anago in the  
> shopping cart, then hit the back button (so that the total went  
> down to 2), then clicked done.  The main page said I had 3 pieces  
> of Anago. Shouldn't the total have changed to 2 pieces of Anago?

No.  Ignoring your sense of what the framework does: is that what you  
would want a shopping cart to do?  When I put something in my cart, I  
expect it to stay there until I explicitly remove it, regardless of  
what navigation I do.  This is a choice that needs to be made  
(consciously or not) for every piece of state in a Seaside  
application - is this state basically navigational, or temporal?   
Should it backtrack or shouldn't it?  That's why you have to  
explicitly register each object for backtracking with the session;  
it's just not a choice the framework can make for you.  The shopping  
cart is actually the classic example I use of state that *shouldn't*  
backtrack, but in general, I tend to say that UI state should be  
backtracked and model state shouldn't.


More information about the Seaside mailing list