[Seaside] Nearing 2.3

Avi Bryant avi at beta4.com
Mon Mar 17 15:59:26 CET 2003


Hi all,

I'm putting up a 2.3a snapshot for evaluation at
http://beta4.com/seaside2/downloads/Seaside2-3a.st.  I made a number of
fairly large changes recently, and I've been feeling antsy that they're
only available to the (non-existant?) minority of users that track CVS.
This code isn't totally complete, but please do try it out.

The changes include:

- HtmlRenderer now builds a DOM tree rather than directly printing HTML to
a stream.  This provides a greater amount of flexibility in various
places, without (surprisingly) seeming to impact performance.  A more
minor change (stolen from Cees) is the ability to use either strings of
blocks pretty much anywhere, ie,

html bold: 'foo'.
html bold: [html text: 'foo'].

- The StateHolder mechanism has been generalized so that any object can be
registered to have the values of its instance variables backtracked.  For
example, in WABrowser>>model:, you'll see

  self session registerObjectForBacktracking: model.

This means that the state of the Browser instance will be snapshotted each
time it changes, and using the back button in the web-based browser will
have correct behavior.

Component classes that previously used StateHolders for all (or most) of
their instance variables can now simply register themselves for
backtracking at #initialize time.

Yes, this can eat memory quickly if abused.  A "profile memory" link has
been added to the toolbar to keep tabs on this.

- The fairly complex Container model has been replaced with a much simpler
notion of delegated components.  Each component has a 'delegate'
StateHolder.  When a component is asked to #call: another component, it
stores that component as its delegate.  When the #call: returns,
'delegate' will be cleared.  When asked to render itself, a
component with an active delegate will forward the render request to the
delegate.  This means that a component will appear to be replaced, in
place, by whichever component it calls.  This behavior is roughly
equivalent to having each child component created with #containerFor: in
2.2.

The "inspect" link now presents a view of the current component tree,
showing delegation, so that you can pick which component you want to
inspect.  This can be useful for understanding the new model.

- The codebase has been massively restructured and more cleanly layered.
Some semi-coherent notes:
The "Base" layer consists of Request, Response, and a completely new URL
handling mechanism, the WARegistry.  This knows nothing about Sessions,
but flexibly manages request handlers that map either to static urls or to
unique, generated keys.  If a unique key exists in the url but there is no
active handler for it, the registry will fall back to the closest static
handler.
The "Session" layer adds continuations and state backtracking.  It knows
nothing about Components.
The "Component" layer includes the delegation and embedding model.  For
now, it largely shields user code from the changes to the other layers
(#registerAsApplication: still works, for example).  It also includes all
the development and configuration tools.
The "Rendering" layer is mostly orthogonal to all of this; it provides the
callback scheme and HtmlRenderer.

Known issues:

- The Wiki example is currently broken.
- The new HtmlRenderer does not yet support pretty-printing.
- Usage patterns for Application, Session, and Registry have to be more
fully worked out (where does the current notion of preferences go?  Is it
still appropiate to subclass Session? etc).



More information about the Seaside mailing list