[Seaside] refactoring large renderContentOn: methods...
damien.cassou at laposte.net
Thu Jul 20 06:29:31 UTC 2006
Rick Flower wrote:
> I've got one renderContentOn: method for one of my web-app classes (and
> believe that I'll probably have this sort of issue with some of my other
> rendering classes as well) and would like to break-apart some of the
> content into smaller pieces that can then be directly rendered by the
> aforementioned renderContentOn: method. I tried using perform: but am
> not really sure how it works (and I didn't get it to work), but it
> looked similar to what I'm looking for (I saw it in some of the Seaside
> example test code). Anyway, just wondering if this is do-able or not
> and if so, what's the best method?
I'm sure I miss something in your mail but can't find what. Why do you
need #perform: ? This message is used when you have a symbol and want to
call the associated method.
selector := #printString.
value := 13 perform: selector.
value is a string that equals to '13'.
If you want to simplify renderContentOn:, you can always do things like
self renderTitleOn: html.
self renderBodyOn: html.
self renderFooterOn: html
and implement thoose three new methods. But again, I'm quite sure you
already know that. You may want to explain again what you want.
More information about the Seaside