[Seaside] Seaside2: separation between content and presentation

tblanchard@mac.com seaside@lists.squeakfoundation.org
Mon, 2 Dec 2002 23:48:12 +0100


On Monday, December 2, 2002, at 07:37  PM, Avi Bryant wrote:

> Yes, I've often wondered how far you could go by formalizing this: 
> Julian
> and I have talked about a convention where each entity would respond 
> to,
> say, #listView, #detailView, #editView, #createView, with a generalized
> navigation framework for finding/creating/moving between entities.  In
> some simple contexts, this might be all you need.  Hmm, NakedObjects 
> for
> the web?

Yeah, but invariably I end up with some weird views that aren't one of 
these.  It does sound good though.

> Yeah, but switch components are ugly.  Is there any equivalent in WO of
>
>   ... header ...
>   html render: (currentEntity editView)
>   ... footer ...
> ?
>

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 and it would 
look like:

file.html
<html>
<WEBOBJECT NAME="HeaderComponent"></WEBOBJECT>
<body>
<table width="100%"><tr>
<td>
<WEBOBJECT NAME="CurrentEntityView"></WEBOBJECT>
</td><td>
<WEBOBJECT NAME="FooterComponent"></WEBOBJECT>
</td></th></table>
</body></html>

file.wod
HeaderComponent: HeaderComponentClass
{
	pageTitle = class.name;
	cssPageName = "myCSSPage";
}

CurrentEntityView: EditViewComponentClass
{
	entity = currentEntity;
}

FooterComponent: FooterComponentClass
{
	bindings here
}

Then your class which would have to implement a method named class that 
returned an object that implemented a method named name and a method 
named currentEntity that returned the entity to view.