[aida] Re usable Components in Seaside & Aida

Frank Young franklin1 at runbox.com
Fri Jan 30 09:42:11 CET 2009


After learning a little about Seaside, I just tried out Aida/Web recently.  I
found it simpler and easier to pick up than Seaside. In fact, Aida reminds
me of Ruby on Rails in some ways, with its emphasis on naming and
convention.  Methods are named viewXXXX and actionXXXX; models are named
YYYY while their corresponding WebApplications are named YYYYApp.  Of
course, Smalltalk provides a much faster and more productive development
environment than any Ruby IDE.

The most striking difference between Seaside and Aida that people have
pointed out, of course, is control flow.  Seaside permits WAcomponents to be
called, just like a subroutine, which facilitates reusability of that
component.  Moreover, a WAComponent can also be rendered within a page as
well, further enhancing its reusability.

As an example, consider a WAComponent that acts as a login page, prompting a
user for username and password:

LoginComponent>>renderContentOn: html
	html form: [
		html text: 'Login: '.
         html textInputOn: #username of: self; break.
         html text: 'Password: '.
         html passwordInputOn: #password of: self;break.
         html submitButtonWithAction: [
			self authenticate] text: 'Login']]

In Seaside, one can call this LoginComponent

		self call: LoginComponent new

to have a login page pop up, or one can render an embedded LoginComponent
within the current page:

		html render: loginComponent

similar to how a Java applet can function either as an applet or as a Java
application (if called from an AWT Frame).

I think this is one of the strong points of Seaside in permitting
WAComponents to be used in different contexts, so that programmers can
easily develop a library of reusable components.



More information about the Aida mailing list