[Seaside] What's the difference and why??

Rick Flower rickf at ca-flower.com
Mon Feb 27 21:18:26 UTC 2006

Philippe Marschall wrote:
> [ ... ]
Good samples snipped.. I'll play around with them further.. Thanks!
> Now I'm not sure I follow completely ;)
> With links you don't mean links outside of your seaside application,
> do you? Can you somehow implement the behavior in a superclass of all
> your components that do these "tasks"? Or put it into a real WATask
> and call it from your components? Or put it into an a component that
> is around the inner components?
In my case, I've got an existing PHP application that I'll have to admit 
isn' very OO like and I'm
trying to re-write it from scratch using Seaside and am having to 
rethink things completely mostly
due to the totally different approach that Seaside takes compared to 
more traditional (old school)
web development setups.  To that end, what I am trying to get going is 
to have a site that has some
general links for people who are not logged in, so that they can find 
out what my site is about
(e.g. an "about" page or two).. There will then be the main login page 
which prompts the user for
a username/password (which I've already got working by the way -- works 
great!).   Once logged
in, the user is present with various functions they can perform such as 
"update contact info", or
perhaps "view my reports", etc.   I initially had this coded as a 
subclass of WATask to control the
stepping from one thing to another, but am not sure this is the right 
approach.. I think I was thinking
of having a list of anchorWithActions for each function the user can 
perform and each one of those
action blocks could just do a "new" on the class that knows how to deal 
with that action.  Anyway,
I'm not sure I really need the WATask based class or if I can get away 
with using something based
on WAComponent instead.  My initial idea for going down the WATask path 
was that I could control
the login processing a bit easier that way.. However, If I can get away 
with using the anchorWithActions
for each function to be performed, perhaps my WATask is going to only be 
a couple of lines as it is
today.  It currently looks like :

    self hasUser ifFalse: [self session user: (self call: MSLogin new)].
    self call: (ContactInfoView new).

The above code is forcing the ContactInfoView class to be performed 
after the user logs in, but that
may turn into more of a "main" sort of class that can print the "MOTD" 
(message of the day) and nothing
more (other than some links to the functions the user can perform).

Any suggestions on whether this is a good approach or not would be 
greatly appreciated!  I'll have to
admit that the entire Smalltalk environment + Seaside is getting more 
appealing to me as time goes by
and I get more hours under my belt working out issues, etc.. Its much 
more interesting than playing
games with the Zend Debugger + text editor + reloading pages,etc as I'm 
used to doing for PHP

-- Rick

More information about the Seaside mailing list