[Seaside] Some thoughts and cs to improve Seaside

Avi Bryant avi.bryant at gmail.com
Sun Nov 28 13:20:07 CET 2004


Hi Stef,

Thanks for the detailed message.  Comments and answers below.

> - How can I get the WAAllTests running?
> I added a initialize method so that we can get AllTests up and running
> in the browser.

The other way would be through the /seaside/config app:
- add a new application named "tests"
- choose WAAllTests as the root component

> I guess like that so may be this should be in the distribution...

AllTests is really meant more as a (non-automated) regression test
suite than as a set of examples.  Ideally we would have a
better/prettier set of components that were meant purely as examples.


> - What is the process to add comments to seaside? Should we send
> something to this list and avi will review it and include it?

Yes, preferably as a .mcz.  If you have a bunch of comments to submit,
it's probably best to just send one version that has all of them
added.

> - There are a lot of widgets but I could not find example (may be this
> is in WAAllTests)?
> Is there a simple process to have examples of the widgets.

Actually, yes, although it's little known and little used (but please,
let's change that).  Just add class-side creation methods to
subclasses of WAComponent, with selectors that start with #example. 
These will then automatically show up in WAExampleBrowser.

> - Is there an FAQ? Is there a Wiki that we can add some examples?
> - Is there a process to collect and document other widgets?
> - Is there a database of widgets?

Not yet.  These are definitly things we need to do.  Does anybody want
to volunteer to organize this?

> Would he make sense to have
> www.seasideSource.com (a SqueakSource containing only seaside examples?)

That would certainly be one way to organize the above... if someone
sets that up, I'll be happy to move the development of the Seaside
package itself to it as well.

> What is the difference between a task and a component?

This is a FAQ.  Both of them are reusable, embeddable, callable pieces
of user interface.  A component has state (instance variables),
behavior (it may change its state, and it may also choose to display
other components with #call:), and appearance (it renders HTML).  A
Task has only the first two - it doesn't render any HTML directly, but
only through the components it calls.  This is useful when what you
want to encapsulate/embed/call is purely a process (show this
component, then this one, then this one).

The key method for WATask is #go - as soon as a task is displayed,
this method will get invoked, and will presumably #call: other
components.

> What is the difference between renderOn: and renderContentOn:?

#renderOn: is the low level method that gets sent to any object
encountered by the HtmlRenderer (for example, if you do "html bold:
'foo'", then String>>renderOn: will get called).

Components need to do various special things when they are rendered
(for example, they need to render any Decoration objects that have
been applied to them).  So subclasses are expected to override
#renderContentOn: instead (this is the Template Method pattern, I
guess).

> In
> WAStoreFillCart>>displayItems: aCollection
>         | list |
>         aCollection size = 1 ifTrue: [^ self displayItem: aCollection first].
>         list := WABatchSelection
>                          items: aCollection
>                          link: #title
>                          text: #subtitle.
>         [self displayItem: (main call: list)] repeat
> 
> I do not understand the repeat.

Yeah, that's a little subtle.  Why don't you try removing it and see
what happens?

"self displayItem: (main call: list)" is letting the user pick and
examine a single item from the collection.  But usually when you're
looking at a list of search results, you want to browse through many
items.  So all this is doing is letting you pick another one (by
showing you the list again) when you're done with the first one.

> my domain objects have accents in its string representation
> and I do not know how from the model object I can specify that the
> text should be encoded.

It's best to have your domain objects encoded in UTF-8; then you
shouldn't need to do any conversion.

> In a batchSelection I wanted to have my own element displayer. Because
> I would like
> to have more information. Is it possible?

Yes, if you look at WABatchSelection you'll see that the list of page
numbers is in fact another, smaller component called WABatchedList. 
You can use WABatchedList with your own way of displaying the list. 
You give it the full collection with #items:, and retrieve and display
just the current batch with #batch.

> So if you really like seaside (like me for example) I can't imagine
> that you can only
> use it without willing to help making it better. So I'm sure that if we
> take each us
> some times to comment a bit the classes we know and the key methods in
> no time
> we will get a much better version. I think that this is our
> responsibility as a community
> to help seaside inventors to make it better.

I certainly won't argue with that :).

Avi


More information about the Seaside mailing list