ValueHolders and State in seaBreeze

The application models in seaBreeze expect ValueModels in their aspects. The simplest ValueModel is probably the ValueHolder. Like in VisualWorks, these ValueModels make sure that changes to their values are reflected in the user interface. In seaBreeze the value models are also used to capture and restore the state of a website. The state of a website is stored every time a callback is performed. The state is restored every time a callback is sent back to the server, right before it is executed. If the user clicks on the back button and then performs an action on the website, the state that was used to register the callback is restored and the action is performed.

An example of that is a Counter application. It only has a ++ button that increments a number. Every time the user clicks on the ++ button, a new website is sent to the browser with the current value of the counter. When the user clicks on the browser's back button several times and then clicks on the ++ button again, the server will not increment the very latest value of the counter but instead use the value that was visible on the website when the ++ was clicked.

Attention

The way that seaBreeze stores and restores the data makes it impossible to change the values of a value holder in the background. If in the counter example, a background timer would also increment the number, it would not appear to the user, because every time the user clicks the increment button, the value of the counter would be set to whatever was captured when the user's website was rendered. This does not only apply to value holders that are stored in the application model, but it applies to all objects that are shown on the website.

 

 

Copyright 2013 by Georg Heeg eK, released under MIT License