[Seaside] Seaside2: separation between content and presentation

Avi Bryant seaside@lists.squeakfoundation.org
Mon, 2 Dec 2002 15:13:11 -0800 (PST)


On Mon, 2 Dec 2002 tblanchard@mac.com wrote:

> WO is really good about letting you have reusable components.  Do you
> know how it works (ie have you used it?)  There isn't really an
> equivalent of what you just wrote exactly.  You'd write a header
> component, a footer component, and an entity edit view...

Earlier versions of Seaside used a fairly similar model to WebObjects, but
had what I called the "polymorphic subcomponent problem": how do you
change the class of a subcomponent at runtime, based on, for example, the
class of an entity object?  It was this problem that I was getting at.  In
Seaside 0.94 you had to specify the class of the subcomponent in the
bindings, just as you do below in WO.  This meant that setting up even a
simple tab control required tedious use of switch logic, and is IMO a
serious flaw in the WO subcomponent system (but if there's a clean way
around it I'd love to hear it).  Current versions of Seaside have much
looser coupling between parent and child components, and so avoid that
particular problem.

> file.wod
> HeaderComponent: HeaderComponentClass
> {
> 	pageTitle = class.name;
> 	cssPageName = "myCSSPage";
> }
>
> CurrentEntityView: EditViewComponentClass
> {
> 	entity = currentEntity;
> }
>
> FooterComponent: FooterComponentClass
> {
> 	bindings here
> }