[Seaside] Tutorial completed: cool

Avi Bryant avi@beta4.com
Mon, 25 Feb 2002 09:34:21 -0800 (PST)


On Mon, 25 Feb 2002, Marcel Weiher wrote:

> The requirement for special template syntax is still there, though
> somewhat eased.  For some DTP related work, I've implemented a different
> approach.  I use an unmodified source document and then separately
> describe the hooks into this source document.  These hooks are, of
> course, much more complex to describe/implement, but at least for
> DTP-related work, the effort is definitely worth it.

This could likely be implemented using Seaside's macro system.  Currently,
there is a macro (IAImplicitIDExpansion) that takes <a href="@foo"> and
transforms it into <a sea:id="foo">; a later expansion takes that and
transforms it into <a sea:id="foo" sea:class="IAAnchor">.  Only once all
the macros have run does IAElementBuilder walk the template and create
dynamic elements for each tag with a sea:id and sea:class, at which point
bindings are attached, etc.

It's easy to add new expansions to a particular component; for
example, overriding #template in the following way:

template
  |template|
  template _ super template.
  template expander
    replaceAll: [:node | node name = 'b']
    with: [:node | node name: 'i'].
  ^ template

should replace all <b> tags in the template with <i> tags.

It sounds like what you want is a macro that adds a sea:id to tags
specified in a non-trivial way; were you using an XPath-like
specification, or something different?

> Another issue with WO is that it defaults to the "stateful application"
> model, and stateless processing is really not integrated very well at
> all.  Statelessness is a really powerful and enabling aspect of the web,
> and can also simplify applications.  I have no idea yet how seaside
> deals with that, since I was quite busy over the week-end.

Seaside is equally guilty here.  I guess you could use methods on
IASession to pull something similar to WODirectAction, but I'm not sure I
see the point; yes, statelessness is useful, but how realistic is it to
mix stateful and stateless designs in a single application?  I imaginine
that Seaside, like WebObjects, will only be used when state is desired,
and other solutions will be used when statelessness is ok (I personally
use a mixture of Seaside and Ruby CGI scripts, for example).  But maybe
that's being too pessimistic.  What would you want in a stateless system?

> Incidentally, I also demoed Seaside to a whole bunch of WO/Cocoa
> developers as part of my impromptu Squeak presentation at the
> Wocoa-meeting this saturday.  It worked very nicely and I think they
> were impressed. ;-)

Cool.  It would be great to get some more WO folk involved.  I
remember you pushing Squeak on the MacOSX-dev list (I think that was the
first time I heard of it, in fact); have you ever had much success
bringing them over to the Squeak side?  (Oh, dear - flashes of Star Wars -
"do not underestimate the power of the Seaside...").

> With my new Cocoa VM that can read the image from the app-wrapper,
> 'deployment' is also a snap, or rather, a joke:  just copy
> CocoaSqueak.app to the appropriate machine and launch it.  When I think
> of the hassles of WO deployment, it just makes me weep.

Yes, and you were talking about saving each image as an app bundle, right?
I'd like to see that.