[Seaside] Getting more started

Brian Brown rbb at techgame.net
Fri Mar 28 13:17:06 CET 2003


On Tuesday 04 March 2003 01:36 am, Julian Fitzell wrote:
> Brian Brown wrote:
> > Thanks for your response before, Avi....
> >
> > Ok, I have created my own class for playing with and successfully
> > registered it. I've started playing with the various messages in the
> > Generator (lists, tables, etc.) and now understand how these work
> > together... very slick!  =)
> >
> > Now, let's pretend I want to build an app with 3 "pages" from the user
> > perspective, with a menu that is context sensitive (indicating which
> > page you are on). How would I go about architecting this? One component
> > per page and another one for the menu, rendering the menu component from
> > each page component? And assuming I wanted each page to have the same
> > layout, would I create a Class message that has the layout code in it,
> > or would that be another component? (Or am I missing the boat entirely?)
>
> You are right that each "page" should (probably) be its own component.
> And, yes, the menu should be in another.  My inclination would be to
> have a frame component that rendered the menu and then (based on the
> current choice) displayed one of your other "pages" as a subcomponent
> (at the appropriate place in the frame's render method, just tell one of
> the other components to render itself).
>
> When you say you want each page to have the same layout, I'm not sure
> what you mean.  If they have exactly the same layout with different
> data, they should be the same component.  Otherwise, you might want to
> look at sharing the common parts.  You could do (at least) this two
> ways.  First, by breaking out the unique part into a seperate method so
> you can subclass several times and change that method in each subclass.
>   Or, second, build a component for each unique part and embed it into a
> component (maybe even the main frame) that holds the common surrounding
> part.

Hi Julian - got sidetracked for a few weeks =)

Well, this is essentially a static site with dynamic menus, but as time goes 
by there will be pieces added for registration and other "applets" (in the 
NON-java sense of the word ;). Initially, what I meant by similar layouts, is 
that in the past I have tried to design an HTML table based page layout ( or 
more than one) that I can plug in dynamically generated content into specific 
cells. 
	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). I used this model based on the fact that 
I have always worked in some these page template languages like ASP, PHP, 
Albatross/python, Cold Fusion, etc...  
	Seaside seems to enable thinking about these apps like I might think about a 
non-web GUI app, which of course, while exciting, is also disconcerting =). 
I'm finding myself second guessing everything I *think* about implementing in 
seaside, so I haven't gotten a lot done yet, hehe.

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.

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. 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....

>
> I'm off to bed or I would actually provide examples.  But if you give
> more detail on what you're looking for we can provide more suggestions.
>   Take a look at the MultiCounter example to see how embedded components
> work.
>
> Cheers,
>
> Julian



More information about the Seaside mailing list