[Seaside] REST-ful urls

John Thornborrow john at pinesoft.co.uk
Mon Jun 4 10:31:11 UTC 2007


Lukas Renggli wrote:
>> The #controller returns an instance of my own-made controller class.
>
> What is a controller class? A component?
No, it is my implementation of a Controller (pattern) which interprets
the URL and returns the relevant component for rendering. It doesn't do
anything else.
>
>> This class returns (via #answer:) an instance of the subcomponent
>> to be rendered.
> You seem to use #call: and #answer: where you should use plain
> Smalltalk message send and return. Even-tough #call: and #answer:
> mimic the Smalltalk send/return, it has completely different
> semantics. Unless you want to display a component and return an answer
> from an end-user interaction, never use #call: and #answer:.
>
> Why not write something along:
>
>    controller := PineSoftWebController new uri: url.
>    self registry at: 'content' put: controller currentComponent
>
That is what I have now done, you are correct that I was using
#call:/#answer: unnecessarily.
>> I did not know it broke initialisation! I thought that would only happen
>> if I called #isolate: like so:
>>
>> ---
>> self isolate: [
>>     self call: controller]
>
> #isolate: is to control the use of the back-button in a control flow,
> where multiple components are displayed in sequenze. You find in-depth
> explanation about the semantics and the use of #call:, #answer: and
> #isolate in "Seaside – A Multiple Control Flow Web Application
> Framework" [1]
>
> Lukas
>
> [1] http://www.iam.unibe.ch/~scg/Archive/Papers/Duca04eSeaside.pdf
>
Thanks, I shall have a read.

John

www.pinesoft.co.uk


Pinesoft Computers are registered in England, Registered number: 2914825. Registered office: 266-268 High Street, Waltham Cross, Herts, EN8 7EA



This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com



More information about the Seaside mailing list