Seaside vs. Traditional

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
48 messages Options
123
Reply | Threaded
Open this post in threaded view
|

RE: Seaside vs. Aida

Sebastian Sastre-2
Hi Janko,

        nice clarification. I think I discovered my framework uses Seaside as platform to be able to make something conceptually very similar to what you described. Anyway my code would look more similar to a esktop development.

        cheers,

Sebastian Sastre

> -----Mensaje original-----
> De: [hidden email]
> [mailto:[hidden email]] En nombre
> de Janko Mivšek
> Enviado el: Domingo, 30 de Marzo de 2008 16:33
> Para: Seaside - general discussion; Aida/Web general discussion list
> Asunto: Re: [Seaside] Seaside vs. Aida
>
> Hi Stef,
>
> Let me first rename topic to Seaside vs. Aida, because that's more
> appropriate to the Lucas blog post anyway. He pointed to other
> "traditional" frameworks, not Aida :)
>
> stephane ducasse wrote:
>
> > Now I think that there is room for seaside and aida side by
> side. It
> > would be nice if both frameworks would mention their own limits.
>  > It seems that in Aida you cannot easily embed multiple times the
> > same component on a page.
>
> Ok, let me start explaining Aida's component model more
> broadly, because
> it seems that is one of major misunderstandings when comparing both
> frameworks. Reason seems to be simply in naming and nothing more.
>
> In Aida we have a WebElement which start covering primitive elements
> like images, links or text, and ends up to the whole web page.
> WebElement can namely be a composite of sub elements down to
> primitive
> ones. We have therefore a consistent component model from a web page
> down to primitive elements.
>
> Just recently we started using a name "component" and
> introduce a class
> WebComponent (which is currently just an empty subclass of
> WebElement)
> to  more clearly separate components from mere elements. But where
> elements end and components begin, that's now a question.
>
> Components are supposed to be a standalone, reusable, heavy ajaxified
> parts of web page, but that's already every web element in Aida!
> Introduction of WebComponent class is therefore currently more
> conceptual than practical, but we hope it will evolve in practicality
> through the time.
>
> Let me allow to make a short comparison with a Seaside
> component model.
> Here a web page is a root component and you can have also
> subcomponents
> (children). So far so good, we are the same.
>
> First difference is how those components (say web pages) are
> connected
> and how user navigates among them, another difference is how both
> component models continue building a web page down to a primitive
> elements. Let we look at later for now.
>
> In Seaside you start painting a component, using a hierarchy
> of blocks.
> In Aida you continue building with smaller and smaller
> WebElements. Aida
> therefore continue using consistently the same component
> model down to
> the lowest level of web pages: basic text, images etc.
>
> One of the consequences of this consistency is how long are
> methods in
> Aida. You'll see that almost all are short, inside 10 line
> recommendation. I think this shows well the strengths of Aida
> component
> model. Other is maybe that users find Aida easy to use. Maybe.
>
> Let me finish with a component model example. That's how it
> looks a page
> creation method for squeak.org demo http://squeaksite.aidaweb.si :
>
> pageElement
>    | e t |
>    e := WebElement newId: #container.
>    self headerElementTo: e.
>    t := WebElement new.
>    t table width: 1; cellSpacing: 0; cellPadding: 0.
>    t cell valign: #top. t cell table cellSpacing: 0; cellPadding: 0.
>    t cell cell add: self menuElement. t cell newRow.
>    t cell cell add: self linksElement. t cell newRow.
>    t cell cell add: self sideLogosElement.
>    t newCell valign: #top;
> add: self bodyElement. "contents"
>    t newCell valign: #top. t cell table cellSpacing: 0;
> cellPadding: 0.
>    t cell cell add: self downloadsElement. t cell newRow.
>    t cell cell add: self newsElement. t cell newRow.
>    e add: t.
>    ^e
>
> ...then header element:
>
> headerElementTo: e
>    e add: self headerLinksElement.
>    e add: self headerTitleElement.
>    e add: self headerActionsElement.
>    e add: self headerSessionElement.
>
> ... and finally login part in up right corner:
>
> headerLoginElement
>    | e |
>    e := WebElement newDiv.
>    self session isLoggedIn
>      ifTrue:
>          [e addText: self app session user nameSurname, ' | '.
>           e addLinkTo: self site admin text: 'Logout' view: #logout]
>      ifFalse:
>          [e addLinkTo: self site admin text: 'Login' view: #login].
>    ^e
>
>
> Best regards
> Janko
>
>
>
>
> --
> Janko Mivšek
> AIDA/Web
> Smalltalk Web Application Server
> http://www.aidaweb.si
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Seaside vs. Aida

Rob Rothwell
On Sun, Mar 30, 2008 at 3:52 PM, Sebastian Sastre <[hidden email]> wrote:
       nice clarification. I think I discovered my framework uses Seaside as platform to be able to make something conceptually very similar to what you described. Anyway my code would look more similar to a esktop development.

Can you give me an example of your code (kind of like Janko just did)?  What are you developing (unless it's a secret!)?  Have you built an additional layer on top of Seaside?

Rob 

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Seaside vs. Aida

stephane ducasse
In reply to this post by Janko Mivšek
ok I see
but could you show the code of the multicounter example that nicolas  
mentioned.
because I could not see how you got the 4 counters in a row.
Stef
On Mar 30, 2008, at 9:33 PM, Janko Mivšek wrote:

> Hi Stef,
>
> Let me first rename topic to Seaside vs. Aida, because that's more  
> appropriate to the Lucas blog post anyway. He pointed to other  
> "traditional" frameworks, not Aida :)
>
> stephane ducasse wrote:
>
>> Now I think that there is room for seaside and aida side by side.  
>> It would be nice if both frameworks would mention their own limits.
> > It seems that in Aida you cannot easily embed multiple times the
>> same component on a page.
>
> Ok, let me start explaining Aida's component model more broadly,  
> because it seems that is one of major misunderstandings when  
> comparing both frameworks. Reason seems to be simply in naming and  
> nothing more.
>
> In Aida we have a WebElement which start covering primitive elements  
> like images, links or text, and ends up to the whole web page.  
> WebElement can namely be a composite of sub elements down to  
> primitive ones. We have therefore a consistent component model from  
> a web page down to primitive elements.
>
> Just recently we started using a name "component" and introduce a  
> class WebComponent (which is currently just an empty subclass of  
> WebElement) to  more clearly separate components from mere elements.  
> But where elements end and components begin, that's now a question.
>
> Components are supposed to be a standalone, reusable, heavy  
> ajaxified parts of web page, but that's already every web element in  
> Aida! Introduction of WebComponent class is therefore currently more  
> conceptual than practical, but we hope it will evolve in  
> practicality through the time.
>
> Let me allow to make a short comparison with a Seaside component  
> model. Here a web page is a root component and you can have also  
> subcomponents (children). So far so good, we are the same.
>
> First difference is how those components (say web pages) are  
> connected and how user navigates among them, another difference is  
> how both component models continue building a web page down to a  
> primitive elements. Let we look at later for now.
>
> In Seaside you start painting a component, using a hierarchy of  
> blocks. In Aida you continue building with smaller and smaller  
> WebElements. Aida therefore continue using consistently the same  
> component model down to the lowest level of web pages: basic text,  
> images etc.
>
> One of the consequences of this consistency is how long are methods  
> in Aida. You'll see that almost all are short, inside 10 line  
> recommendation. I think this shows well the strengths of Aida  
> component model. Other is maybe that users find Aida easy to use.  
> Maybe.
>
> Let me finish with a component model example. That's how it looks a  
> page creation method for squeak.org demo http://
> squeaksite.aidaweb.si :
>
> pageElement
>  | e t |
>  e := WebElement newId: #container.
>  self headerElementTo: e.
>  t := WebElement new.
>  t table width: 1; cellSpacing: 0; cellPadding: 0.
>  t cell valign: #top. t cell table cellSpacing: 0; cellPadding: 0.
>  t cell cell add: self menuElement. t cell newRow.
>  t cell cell add: self linksElement. t cell newRow.
>  t cell cell add: self sideLogosElement.
>  t newCell valign: #top;
> add: self bodyElement. "contents"
>  t newCell valign: #top. t cell table cellSpacing: 0; cellPadding: 0.
>  t cell cell add: self downloadsElement. t cell newRow.
>  t cell cell add: self newsElement. t cell newRow.
>  e add: t.
>  ^e
>
> ...then header element:
>
> headerElementTo: e
>  e add: self headerLinksElement.
>  e add: self headerTitleElement.
>  e add: self headerActionsElement.
>  e add: self headerSessionElement.
>
> ... and finally login part in up right corner:
>
> headerLoginElement
>  | e |
>  e := WebElement newDiv.
>  self session isLoggedIn
>    ifTrue:
>        [e addText: self app session user nameSurname, ' | '.
>         e addLinkTo: self site admin text: 'Logout' view: #logout]
>    ifFalse:
>        [e addLinkTo: self site admin text: 'Login' view: #login].
>  ^e
>
>
> Best regards
> Janko
>
>
>
>
> --
> Janko Mivšek
> AIDA/Web
> Smalltalk Web Application Server
> http://www.aidaweb.si
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Seaside vs. Aida

Janko Mivšek
stephane ducasse wrote:
> ok I see
> but could you show the code of the multicounter example that nicolas
> mentioned.
> because I could not see how you got the 4 counters in a row.

I suppose that he did an equivalent of such code:

viewMAin
  | e |
  e := WebElement new.
  e
    add: CounterComponent new;
    add: CounterComponent new;
    add: CounterComponent new;
    add: CounterComponent new.
  self pageFrameWith: e title: 'multicounter'.

So it is actually the same way as you show in your Seaside example.

Janko


> On Mar 30, 2008, at 9:33 PM, Janko Mivšek wrote:
>
>> Hi Stef,
>>
>> Let me first rename topic to Seaside vs. Aida, because that's more
>> appropriate to the Lucas blog post anyway. He pointed to other
>> "traditional" frameworks, not Aida :)
>>
>> stephane ducasse wrote:
>>
>>> Now I think that there is room for seaside and aida side by side. It
>>> would be nice if both frameworks would mention their own limits.
>> > It seems that in Aida you cannot easily embed multiple times the
>>> same component on a page.
>>
>> Ok, let me start explaining Aida's component model more broadly,
>> because it seems that is one of major misunderstandings when comparing
>> both frameworks. Reason seems to be simply in naming and nothing more.
>>
>> In Aida we have a WebElement which start covering primitive elements
>> like images, links or text, and ends up to the whole web page.
>> WebElement can namely be a composite of sub elements down to primitive
>> ones. We have therefore a consistent component model from a web page
>> down to primitive elements.
>>
>> Just recently we started using a name "component" and introduce a
>> class WebComponent (which is currently just an empty subclass of
>> WebElement) to  more clearly separate components from mere elements.
>> But where elements end and components begin, that's now a question.
>>
>> Components are supposed to be a standalone, reusable, heavy ajaxified
>> parts of web page, but that's already every web element in Aida!
>> Introduction of WebComponent class is therefore currently more
>> conceptual than practical, but we hope it will evolve in practicality
>> through the time.
>>
>> Let me allow to make a short comparison with a Seaside component
>> model. Here a web page is a root component and you can have also
>> subcomponents (children). So far so good, we are the same.
>>
>> First difference is how those components (say web pages) are connected
>> and how user navigates among them, another difference is how both
>> component models continue building a web page down to a primitive
>> elements. Let we look at later for now.
>>
>> In Seaside you start painting a component, using a hierarchy of
>> blocks. In Aida you continue building with smaller and smaller
>> WebElements. Aida therefore continue using consistently the same
>> component model down to the lowest level of web pages: basic text,
>> images etc.
>>
>> One of the consequences of this consistency is how long are methods in
>> Aida. You'll see that almost all are short, inside 10 line
>> recommendation. I think this shows well the strengths of Aida
>> component model. Other is maybe that users find Aida easy to use. Maybe.
>>
>> Let me finish with a component model example. That's how it looks a
>> page creation method for squeak.org demo http://squeaksite.aidaweb.si :
>>
>> pageElement
>>  | e t |
>>  e := WebElement newId: #container.
>>  self headerElementTo: e.
>>  t := WebElement new.
>>  t table width: 1; cellSpacing: 0; cellPadding: 0.
>>  t cell valign: #top. t cell table cellSpacing: 0; cellPadding: 0.
>>  t cell cell add: self menuElement. t cell newRow.
>>  t cell cell add: self linksElement. t cell newRow.
>>  t cell cell add: self sideLogosElement.
>>  t newCell valign: #top;
>>     add: self bodyElement. "contents"
>>  t newCell valign: #top. t cell table cellSpacing: 0; cellPadding: 0.
>>  t cell cell add: self downloadsElement. t cell newRow.
>>  t cell cell add: self newsElement. t cell newRow.
>>  e add: t.
>>  ^e
>>
>> ...then header element:
>>
>> headerElementTo: e
>>  e add: self headerLinksElement.
>>  e add: self headerTitleElement.
>>  e add: self headerActionsElement.
>>  e add: self headerSessionElement.
>>
>> ... and finally login part in up right corner:
>>
>> headerLoginElement
>>  | e |
>>  e := WebElement newDiv.
>>  self session isLoggedIn
>>    ifTrue:
>>        [e addText: self app session user nameSurname, ' | '.
>>         e addLinkTo: self site admin text: 'Logout' view: #logout]
>>    ifFalse:
>>        [e addLinkTo: self site admin text: 'Login' view: #login].
>>  ^e
>>
>>
>> Best regards
>> Janko
>>
>>
>>
>>
>> --Janko Mivšek
>> AIDA/Web
>> Smalltalk Web Application Server
>> http://www.aidaweb.si
>> _______________________________________________
>> seaside mailing list
>> [hidden email]
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>
>
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>

--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Seaside vs. Aida

Sophie424
In reply to this post by Janko Mivšek
"Janko Mivsek" <[hidden email]> wrote

> ...

Thanks for sharing your insights.

> In Aida we have a WebElement which start covering primitive elements
> like images, links or text, and ends up to the whole web page.
> WebElement can namely be a composite of sub elements down to primitive
> ones. We have therefore a consistent component model from a web page
> down to primitive elements.

I think this has some real advantages (like Michael Lucas-Smith's earlier
post), though I am not sure of the trade-offs. Lukas explained earlier that
Seaside uses explicit Components and their #children to do several things...

> 1. parse the initial request (#initialRequest:)
> 2. change the current URL (#updateUrl:)
> 3. register objects for backtracking (#updateStates:)
> 4. render something to the XHTML head (#updateRoot:)
> 5. render something to the XHTML body (#renderContentOn:)
> 6. process callbacks (#processCallbackStream:)

Does Aida handle these elsewhere? How would a "component" hook into or
customize any of 1-6?

Also, does Aida have anything like (or have you any plan for something like)
Scriptaculous, to allow talking to client-side Javascript from pure
Smalltalk?

> In Seaside you start painting a component, using a hierarchy of blocks.
> In Aida you continue building with smaller and smaller WebElements.

Yes, render html vs. construct DOM tree.

Perhaps the "hierarchy of blocks" part can be seen as just an API style, and
could also be used as an API to construct a DOM tree behind the scenes,
where Seaside's #div, #anchor, #table, etc. would construct DOM nodes, and
#with: would start constructing the sub-tree ?

- Sophie



_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: Seaside vs. Aida

Sebastian Sastre-2
In reply to this post by Rob Rothwell
Is not a secret Rob. I have at hand this login component I've made. I'll comment on the code the most important methods:
 
Login>>createComponents
    "Creates the subcomponents of the receiver."
 
 super createComponents.
 
 self
  at: #username put: (MVPLabeledPresenter new
       label: 'Username';
       at: #presenter put: (MVPTextInputPresenter new
            submitOnEnter: true;
            yourself);
       yourself);
  at: #password put: (MVPToolbar new  "I use a toobar here just as a layout convenience"
        at: #input
        putTool: (MVPLabeledPresenter new
           label: 'Password';
           at: #presenter put: (MVPPasswordInputPresenter new
                submitOnEnter: true;
                yourself);
           yourself);
        at: #memory
        putTool: (MVPAnchorButton new
           model: 'I forgot my password/username';
           yourself);
        yourself);
  at: #signIn put: (MVPSubmitButton new
       model: 'Sign in';
       voidCallback; "so it wont submit"
       yourself);
  yourself
 
Login>>model: aModel
       "Sets the model of the receiver."
 
 super model: aModel.
 
"Aspect values are cool because they transparently will get the fresh value with each render
or set it if they are submitted." 
 
 self username model: (aModel aspectValue: #username).
 (self password at: #input) model: (aModel aspectValue: #password).
 
 
Login>>makeLayout
 
 | keys |
 
 keys := #(
   username
   password
   signIn
   ) asOrderedCollection.
 
"This creature cames from a kind family of layout policies
and they know how to deal with tables so we can't forget about them"
 ^(MVPVerticalFlowLayout createFor: self)
  order: keys;
  yourself
 
Login>>wireEvents
    "Makes the wiring of events for the receiver.
    This events are in fact announcements in the server (not the ones at DOM).
    This wiring is meant to establish loose coupling between children and parent presenters"
 
 super wireEvents.
 
 self signIn
  subscribe: MVPSubmitButtonPressed send: #onSignInPressed: to: self;
  yourself.
   
 
Login>>onSignInPressed: anAnnouncement
 
 self answer: (self session userOrNilFor: self model)
 
 
"Here are a couple of methods related to the DOM part of the login"
 
 Login>>installDOMElementBehaviorOn: html
 "Returns the script that installs the methods in the
 DOM Element which is an homologue of the receiver."
 
 ^(super installDOMElementBehaviorOn: html)
  add: (self elementOn: html) asJQElement curvyCorner;
  add: ((self username presenter focusOn: html) timeout: 100);
  add: (self assign: (self onSignInClickedFunctionOn: html) as: 'onSignInClicked' on: html);
"Here I hook a DOM event for the homologue of the receiver and wire it to a custom reaction.
This can be done also with custom events (thanks to fire introduced in Prototype 1.6.0)"
 
 add: (self signIn
    elementOn: #click
    call: 'onSignInClicked'
    with:'anEvent' asSUObject
    in: (self elementOn: html)
    on: html);
  yourself
 
Login>>onSignInClickedFunctionOn: html
    "Returns the function which will render as javascript at DOM.
 
    Filters submits with no username so server is not bothered
    with this kind of spureous requests."
 
 ^ SUFunction new argument: 'anEvent';
  add: ((((self username presenter formElementOn: html) value
    access: 'length')  > 1)
     then: (SUForm new id: 'systemForm') submit
     else: (SUScript new
       add: 'anEvent' asSUEvent stop;
       add: (html effect highlight id: (self username elementOn: html));
       add: (self username presenter formElementOn: html) focus;
       yourself));
  yourself
 
I hope you get the idea,
 
    cheers,
 
Sebastian
 
 


De: [hidden email] [mailto:[hidden email]] En nombre de Rob Rothwell
Enviado el: Domingo, 30 de Marzo de 2008 17:05
Para: Seaside - general discussion
Asunto: Re: [Seaside] Seaside vs. Aida

On Sun, Mar 30, 2008 at 3:52 PM, Sebastian Sastre <[hidden email]> wrote:
       nice clarification. I think I discovered my framework uses Seaside as platform to be able to make something conceptually very similar to what you described. Anyway my code would look more similar to a esktop development.

Can you give me an example of your code (kind of like Janko just did)?  What are you developing (unless it's a secret!)?  Have you built an additional layer on top of Seaside?

Rob 

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Seaside vs. Aida

Janko Mivšek
In reply to this post by Sophie424
Hi Sophie,

itsme213 wrote:

> I think this has some real advantages (like Michael Lucas-Smith's earlier
> post), though I am not sure of the trade-offs. Lukas explained earlier that
> Seaside uses explicit Components and their #children to do several things...
>
>> 1. parse the initial request (#initialRequest:)
>> 2. change the current URL (#updateUrl:)
>> 3. register objects for backtracking (#updateStates:)
>> 4. render something to the XHTML head (#updateRoot:)
>> 5. render something to the XHTML body (#renderContentOn:)
>> 6. process callbacks (#processCallbackStream:)
>
> Does Aida handle these elsewhere? How would a "component" hook into or
> customize any of 1-6?

1-2: Url resolution: first, in Aida url always point to the domain
object and not to a Component as in Seaside. Domain object then in MVC
fashion delegates the request to its so called WebApplication (shorter:
App) which is responsible for VC part of MVC. Domain object needs to
therefore have a corresponding App class. Counter needs CounterApp. This
App is then roughly the same as Seaside's root component.

3: Backtracking: Aida don't have backtracking. Why no, maybe later.

4-5: Rendering: is a two step in Aida: first building the object
presentation of page, then serializing it into HTML. After an App
receives a request (actually a #printWebPage call) it starts building a
kind of object DOM tree of page. Then a #printHTMLPage is sent to render
a page into HTML. This two step process has advantages like freedom of
order how you build a page or "late binding" of page header info and
also that you can render in something else instead of HTML. Main
disadvantage is that it takes more time.

6. Actions: Aida don't have callbacks but are actions in MVC fashion
strictly separated in separate methods, which are implemented in Apps.
For instance for view #viewMain you can have an action in method
#actionMain. Also form data posting is automatic directly to the domain
objects. Usually you'll see such code in Aida:

        e addInputFieldAspect: #name for: self observee

Here we add an input field to edit a name of a domain object (named
observee, in accordance to Observer pattern).

But we are thinking on introduction callback like server side validation
of form input fields. Here the callbacks won't intermix too much the
presentation code with action and business logic, which we'd like to
keep separated, in the spirit of MVC paradigm.

> Also, does Aida have anything like (or have you any plan for something like)
> Scriptaculous, to allow talking to client-side Javascript from pure
> Smalltalk?

Yes, Prototype and Scriptaculous JS libraries are there by default and
deeply integrated into Aida. Prototype is always loaded (needed for
Ajax) while Scriptaculous is loaded on demand. Ajax support in Aida is
one of its major strengths. For instance if you'd like to send input
field immediately after something is entered, you would simply:

        aField onChangePost

...and field will be Ajax posted automatically. Such deep integration
allows us now to ajaxify all new applications, because this brings so
big benefit to users for so small cost.

>> In Seaside you start painting a component, using a hierarchy of blocks.
>> In Aida you continue building with smaller and smaller WebElements.
>
> Yes, render html vs. construct DOM tree.
>
> Perhaps the "hierarchy of blocks" part can be seen as just an API style, and
> could also be used as an API to construct a DOM tree behind the scenes,
> where Seaside's #div, #anchor, #table, etc. would construct DOM nodes, and
> #with: would start constructing the sub-tree ?

Here I actually see the possibility to learn something from each other
and I'm already thinking of introducing a simpler page building syntax
with recent Seaside syntax as an example. Here Seasiders would also
profit to extend component model to be more fine grained, with simpler
and shorter methods as a first consequence.

Best regards
Janko



--
Janko Mivšek
AIDA/Web
Smalltalk Web Application Server
http://www.aidaweb.si
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Seaside vs. Aida

stephane ducasse
In reply to this post by Janko Mivšek
thanks I see.

Stef

>
>> ok I see
>> but could you show the code of the multicounter example that  
>> nicolas mentioned.
>> because I could not see how you got the 4 counters in a row.
>
> I suppose that he did an equivalent of such code:
>
> viewMAin
> | e |
> e := WebElement new.
> e
>   add: CounterComponent new;
>   add: CounterComponent new;
>   add: CounterComponent new;
>   add: CounterComponent new.
> self pageFrameWith: e title: 'multicounter'.
>
> So it is actually the same way as you show in your Seaside example.
>
> Janko
>
>
>> On Mar 30, 2008, at 9:33 PM, Janko Mivšek wrote:
>>> Hi Stef,
>>>
>>> Let me first rename topic to Seaside vs. Aida, because that's more  
>>> appropriate to the Lucas blog post anyway. He pointed to other  
>>> "traditional" frameworks, not Aida :)
>>>
>>> stephane ducasse wrote:
>>>
>>>> Now I think that there is room for seaside and aida side by side.  
>>>> It would be nice if both frameworks would mention their own limits.
>>> > It seems that in Aida you cannot easily embed multiple times the
>>>> same component on a page.
>>>
>>> Ok, let me start explaining Aida's component model more broadly,  
>>> because it seems that is one of major misunderstandings when  
>>> comparing both frameworks. Reason seems to be simply in naming and  
>>> nothing more.
>>>
>>> In Aida we have a WebElement which start covering primitive  
>>> elements like images, links or text, and ends up to the whole web  
>>> page. WebElement can namely be a composite of sub elements down to  
>>> primitive ones. We have therefore a consistent component model  
>>> from a web page down to primitive elements.
>>>
>>> Just recently we started using a name "component" and introduce a  
>>> class WebComponent (which is currently just an empty subclass of  
>>> WebElement) to  more clearly separate components from mere  
>>> elements. But where elements end and components begin, that's now  
>>> a question.
>>>
>>> Components are supposed to be a standalone, reusable, heavy  
>>> ajaxified parts of web page, but that's already every web element  
>>> in Aida! Introduction of WebComponent class is therefore currently  
>>> more conceptual than practical, but we hope it will evolve in  
>>> practicality through the time.
>>>
>>> Let me allow to make a short comparison with a Seaside component  
>>> model. Here a web page is a root component and you can have also  
>>> subcomponents (children). So far so good, we are the same.
>>>
>>> First difference is how those components (say web pages) are  
>>> connected and how user navigates among them, another difference is  
>>> how both component models continue building a web page down to a  
>>> primitive elements. Let we look at later for now.
>>>
>>> In Seaside you start painting a component, using a hierarchy of  
>>> blocks. In Aida you continue building with smaller and smaller  
>>> WebElements. Aida therefore continue using consistently the same  
>>> component model down to the lowest level of web pages: basic text,  
>>> images etc.
>>>
>>> One of the consequences of this consistency is how long are  
>>> methods in Aida. You'll see that almost all are short, inside 10  
>>> line recommendation. I think this shows well the strengths of Aida  
>>> component model. Other is maybe that users find Aida easy to use.  
>>> Maybe.
>>>
>>> Let me finish with a component model example. That's how it looks  
>>> a page creation method for squeak.org demo http://squeaksite.aidaweb.si 
>>>  :
>>>
>>> pageElement
>>> | e t |
>>> e := WebElement newId: #container.
>>> self headerElementTo: e.
>>> t := WebElement new.
>>> t table width: 1; cellSpacing: 0; cellPadding: 0.
>>> t cell valign: #top. t cell table cellSpacing: 0; cellPadding: 0.
>>> t cell cell add: self menuElement. t cell newRow.
>>> t cell cell add: self linksElement. t cell newRow.
>>> t cell cell add: self sideLogosElement.
>>> t newCell valign: #top;
>>>    add: self bodyElement. "contents"
>>> t newCell valign: #top. t cell table cellSpacing: 0; cellPadding: 0.
>>> t cell cell add: self downloadsElement. t cell newRow.
>>> t cell cell add: self newsElement. t cell newRow.
>>> e add: t.
>>> ^e
>>>
>>> ...then header element:
>>>
>>> headerElementTo: e
>>> e add: self headerLinksElement.
>>> e add: self headerTitleElement.
>>> e add: self headerActionsElement.
>>> e add: self headerSessionElement.
>>>
>>> ... and finally login part in up right corner:
>>>
>>> headerLoginElement
>>> | e |
>>> e := WebElement newDiv.
>>> self session isLoggedIn
>>>   ifTrue:
>>>       [e addText: self app session user nameSurname, ' | '.
>>>        e addLinkTo: self site admin text: 'Logout' view: #logout]
>>>   ifFalse:
>>>       [e addLinkTo: self site admin text: 'Login' view: #login].
>>> ^e
>>>
>>>
>>> Best regards
>>> Janko
>>>
>>>
>>>
>>>
>>> --Janko Mivšek
>>> AIDA/Web
>>> Smalltalk Web Application Server
>>> http://www.aidaweb.si
>>> _______________________________________________
>>> seaside mailing list
>>> [hidden email]
>>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>>
>> _______________________________________________
>> seaside mailing list
>> [hidden email]
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
> --
> Janko Mivšek
> AIDA/Web
> Smalltalk Web Application Server
> http://www.aidaweb.si
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
123