Perrin Harkins writes:
> Can't all of that be expressed in an HTML template?

Sort of.  Let's say, though, that you want the same template to render
in a WAP, Opera, Konqueror, IE, NS, etc.  The implementation of Grid
handles this for you.  For example, our code automatically renders
style sheets for IE5+, but no other browsers.  (This isn't in Grid,
but you get what I mean, I hope.)

> It seems like the 
> template should know enough about what kind of data it's displaying to 
> know how to arrange the tables.  After all, it's not a template for a 
> generic table; it's a template for a table that displays specific data 
> with a structure that is pre-determined.

Absolutely, along with field labels, icon alts, etc.  You want this
switchable depending on the "skin" you are using.

However, sometimes you have dense tables where you allow wrapping and
other sparse tables where you don't.  We have a really wide table for
admins which allows them to see all EC info at a glance.  It has to
wrap all cells or it wouldn't fit on some screens.  When the customer
sees the payment reason, on their subscription page, it doesn't wrap.
Two views of the same data.

> Usually when I see people doing this kind of thing it's because they 
> haven't expressed all the necessary information in their model.

Models can only express meta info about the data, not the context in
which the data is rendered.  Some info, like placement, is conditional
on the grouping which is chosen by the view.  A layout manager
abstracts placement using meta data supplied by the model and context
supplied by the view.

Rob


Reply via email to