Introduction
David ShafferShaffer Consulting
Why Seaside?
Maybe more accurately "What attracted me to Seaside?". If
you're not comfortable with anecdotal motivations or you've never used
any other web programming frameworks, skip this section. I've been
working with web development frameworks for years. I've used
everything from Python CGI scripts, to PHP and Java Server Pages.
I've used scaffolding built on top of these technologies as well as
built some of my
own. Many of these technologies, such as WebOjects® and Java
Server Faces, gave me hints of what web development could be like but
they all fell short in one area or another. In most cases the
component model was weak. In others the flow of the application was
encumbered with transporting data along with it (ever had to sneak
data into hidden fields or anchors simply to "move" it from
one form to another?). Such encumberances limit reuse of components.
Seaside attracted me because is has
- a solid component model with decorators and callbacks,
- support for sequencing interactions, and
- native (Smalltalk) debugging interface.
None of these features is impossibly difficult to envision
implementing but anyone who has set to implement frameworks with these
characteristics knows that there are many decisions and compromises to
make along the way. These decisions give the framework its unique
flavor. Here are some of the decisions that the Seaside developers
made:
- all session state is maintained on the server,
- HTML is generated completely in Smalltalk, no templates or
"server pages" (although it isn't hard to build such things
in Seaside),
- encourage the use of CSS to customize application
appearence
- use callbacks for anchors and buttons, rather than loosely
coupled page references,
- use native language (Smalltalk) support for continuations to
implement sequencing,
- others?
Combined these features make working with Seaside much like writing a
GUI application. Actually, in some ways simpler, since the web
browser takes a lot of the application details out of your hands.
Using continuations means the state in your application is localized
to the scope on which it is relevant. No need to store temporary
variables in the session (or hidden fields or anchors) just to move
them between pages. No need to build URL's from session data or
configuration files to properly control the flow of your complex
applications. If you've used other frameworks then Seaside's somewhat
unique characteristics will likely attract you as they did me.
Seaside Limitations
Many of the decisions discussed in the previous section present
limitations to the developer. Here are some:
- Seaside applications are memory intensive, requiring about 100Kb-10Mb per session
- "Web page developers" (or graphics artists) will have
to learn CSS!
- Seaside is not particularly performant although you can design
your applications to scale well with the addition of new
servers
As Seaside is becoming more widely used I hope to give more
concrete examples of performance-related problems and solutions. This
tutorial shows you how to deploy applications to a small group of
concurrent users (around 50 concurrent users, 2-3 requests per second
peak on a low end server). As people push the envelope I hope to have
more to say on the topic.
Prerequisite: Smalltalk
I will assume that you can find your way around the Squeak Smalltalk
environment so that I don't have to go into too much detail. If you
are completely new to Smalltalk or Squeak you can still work your way
through this tutorial as long as you are determined to do so. In
fact, it is a great way to learn Smalltalk...total immersion. Still
you will need supplemental materials to help you learn the language
and the development environment. If you fit in this category take a
short break now and collect a few sources of information:
- Find a free Smalltalk book
that suites your learning style or look on amazon
for print copies.
- Bookmark a few web sites with helpful information including:
- Subscribe to the squeak-dev and seaside mailling lists and
find out how to search the archives.
- Find a newsgroup or two (comp.lang.smalltalk is great!)
Great. Now you have enough tools at your disposal to help you through
any problems you might encounter. The Smalltalk-related mailling
lists that I use (VWNC, squeak-dev and the Seaside mailling list) are
chock full of helpful and friendly people. Do your reading but if
you're still stuck don't hesitate to post a question.
Organization of this document
This document has two sections each divided into units. The first
section forms an introduction to Seaside. This material moves slowly
through the Seaside framework in a bottom up fashion and is
appropriate for programmers with no Seaside experience. The second
section is divided into more topical units. The flow of these units
is less clear than the introductory text. You might find yourself
skipping around in the section, reading only topics which are of
interest to you. You should cover the first unit, "Building
Applications", since it brings together the introductory topics
and talk about how you should structure Seaside applications.
This document looks best when viewed in a 1024x768 window using
16pt or smaller fonts. Much of the sample code requires 16pt or
smaller monospaced font.
Other tutorials
There are many Seaside tutorials available. Look at the Seaside tutorial pages.
C. David Shaffer
Last modified: Wed Jul 20 22:58:02 EDT 2005