[Seaside] Seaside vs. Aida

Janko Mivšek janko.mivsek at eranova.si
Sun Mar 30 19:33:21 UTC 2008


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


More information about the seaside mailing list