[Seaside] Getting more started

Julian Fitzell julian at beta4.com
Tue Mar 4 00:36:54 CET 2003


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.

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



-- 
julian at beta4.com
Beta4 Productions (http://www.beta4.com)



More information about the Seaside mailing list