Thanks for the helpful response Scott.

> Tiles and Sitemesh are both page decoration tools, but they go about
> things very differently.

I would consider Tiles more of a page composition tool and Sitemesh a page
decoration tool.

>  From my (limited) understanding, Tiles you have to 'push' everything
> into it.  If you want a title - you need to specify it in tiles-def.xml.
>   I'm not sure what Tiles gives you that you couldn't achieve with a big
> velocity template & a properties file to pull the value in from.

Generally in your tiles definition file you specify not only text properties
to place in the template (eg title) but what *tiles components* should be
used (eg 'news' tile, 'advertisement tile and 'log in' tile should appear on
the right side in that order).

In a velocity template + properties file the template specifies what
properties should be used where.  The template also defines what other
templates to include (as does jsp include).  With the Tiles approach this
'controller' functionality is removed from the template making the template
more reusable.

> However, the distinction is that you can only have one decorator per
> page, rather than lots of 'tiles'.  Mostly this fits with web design, as
> usually there is one rather large 'content' area, with some other
> navigation around it.

Yeah, this is the key difference.  Tiles provides a mechanism to arrange
*many* self contained  tiles components on a page.  This is essential for
complex pages (think portal site).  For example I can specify a list of
tiles to appear in any area of the page in a particular order by using a
simple iterator tile.  The iterator tile will add each tile in order, one on
top of the other.

This is incredibly powerful for page composition.

All Tiles does is provide a simple way to define what reusable tiles you
want on a particular page (tiles-def.xml) making composing pages from
components easy.

> You could even use Tiles inside your decorator (decorators as just JSP
> files) to do this logic.

Great idea. Or use it to compose the 'content' area from many tiles and then
decorate that with Sitemesh.

> That's it - the whole page.  The 'jiraform' decorator decorates the form
> box, and the normal decorator decorates the whole page.

In your example the form box (a page component) defines what decorator to
use.  This limits its reusability because it is *not* decoupled from its
decorator.  However, I understand that this does not have to be defined
here.

> Anyhow - I'd suggest that you look at Sitemesh.  It doesn't do what you
> are asking - but I think that Sitemesh and other tools means that you
> don't actually want to do that ;)

I certainly will look at using it for the task it was designed for.  The two
tools have some overlap but the problem they solve is different.  Sitemesh
can easily enforce a consistent look to a web site by decorating the content
pages.  Tiles can help compose complex pages by arranging simple components.

John


-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps1
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to