[Seaside] Getting more started

Avi Bryant avi at beta4.com
Fri Mar 28 12:43:21 CET 2003


On Fri, 28 Mar 2003, Brian Brown wrote:

> 	Normally the template would be beginning html, meta tags, a placeholder for
> Javascript in the head tags, body tags, and a top level table that would have
> placeholders within specific cells for dynamically generated content, images,
> menus, etc.
> 	Being a Smalltalk/Squeak/Comanche/Seaside newbie, I'm not even sure that this
> model works (or rather that I should try to use this thought process; I'm
> sure it could work in some fashion).

Well, what you most likely want is one component that draws the header and
the toplevel table, and has an instance variable for each "placeholder"
(or if there's a variable number of placeholders, some kind of
collection).  These instance variables would contain other components that
created your dynamic content, that you could replace at will.

> I think I understand creating the components to be rendered, but am a little
> fuzzy on where I would put the parts that I used to put in my "PageTemplates"
> like head, meta, Javascript, etc.

So you have a number of pages that all have the same format but have
different meta tags, JS, etc?  A few possibilities:

- have more inst vars in your pluggable toplevel component that contain
these snippets, or
- use the "template method" approach, ie, have individual methods for
#renderJavascript, etc, and then a subclass for each page that overrides
these, or
- if the JS and so forth are dependent on which bits of dynamic content
are plugged into the placeholders the table, have methods on those dynamic
components that specify, eg, what kind of meta tags they need, and have
the toplevel component query them when it's rendering; or better, remember
that the HTML doesn't need to be generated in the order it appears, eg,
those subcomponents can add stuff to the head themselves (see
HtmlBuilder>>title: for an example).

Any of those make sense for what you're doing?

> As a side note, I have officially introduced Squeak into our (small 7 person)
> company, and will be implementing several commercial offerings with it, one
> of which is slated to be in Seaside.

Hey, that's great!  Welcome to the small but growing club ;).

> I'm completely sold on the platform and
> the way seaside approaches web development; I just need to get over the hump
> of coding it and thinking about things more correctly....

<plug>
Since you're using it commercially, or planning to, I feel obliged to
point out that a lot of what I do is provide
training/coaching/development for companies using Seaside (or even
just Squeak - that's why, eg, DVS exists).  If you think your company
might find that useful, let me know privately...
</plug>

Of course you can also get a fair amount of free advice on this mailing
list, as you've hopefully seen ;).

Avi



More information about the Seaside mailing list