Template mechanisms...

Eric Scharff Eric.Scharff at Colorado.EDU
Thu Dec 12 05:48:41 UTC 2002


On Wed, 11 Dec 2002, Stephen Pair wrote:

> Having used SSP extensively in Swiki.net and having looked at Seaside, I
> think I can offer some insight:
>
> My sense is that both approaches are equivalent if you raise your level
> of abstraction such that you are thinking in terms of "widgets" and not
> HTML or an HTML DOM.

I think the "widget" approach is certainly right, and as Avi mentioned,
most text should come out of a database.

I do a lot of HTML form work, which illustrates both aspects of the
problem.  Every form tends to start with some introductory text, like "The
following survey is about... Our purpose for collecting this information
is... No personally identifiable information will be stored with this
information..."  Then, for each form entry, you might have a set of
options, say, a radio button group (strongly agree .. neutral .. strongly
disagree)

The end result is inevitably a lot of text mixed in with other HTML
elements.

The "right" way to do this is probably to think in terms of widgets,
creating entries (using Swiki syntax) like <?IntroBlurb?>
<?Question17Text?>, <?RadioButtonStronglyAgree?>, and so on.

An even better approach would probably be to use SeaSide, create a
GenericSurvey class, factor stuff into it, and then to make custom survey
classes.

In practice, these things tend to evolve rapidly and substantially.  It
has simply felt easier to use a decent text editor.  By the time the sites
get done, there is rarely time to re-factor something (especially when it
is working).

My big Web sites are database driven.  My small sites are hand created.
It is that intermediate stage that seems particularly tricky.

Later in this thread, the idea of Morphic-like composition rules would be
the way to go.  I might argue for something different.  One might be a
Morphic-like composition system, inspired by the "tiles"

You create a bit of text in a workspace, and can turn that text into a
tile.  You then compose a web site by dragging tiles into the workspace.
You could next tiles within each other, have tiles that have input
parameters (so that they can be templated).  Dragging and dropping would
manipulate the tiles.  In the end, this representation would be turned
automatically into something appropriate, probably an XML template, or
perhaps HtmlView code, or even live objects, whatever your preference.

I'm making this up as I go along, and I don't know if this would be useful
to anyone.  The real key for me is that I'd like the act of factoring
something well not to be antithetical to rapidly slapping together a Web
site and then changing it a lot.  And as I said, spell checking is a must.
:)

-Eric




More information about the Squeak-dev mailing list