Sunday, August 28, 2005

Seaside

Seaside is a Smalltalk-based web development framework with continuation support. Seaside models a web page as a tree of nested component objects, each of which can independently render itself and respond to user interaction. A component can use the call method to suspend its own processing and replace itself with another component, which appears in its place on the page. The replacing component may use its answer method to remove itself, resuming the original component and passing it data. As with send/suspend/dispatch, Seaside allows web applications to associate blocks of code with links, which are executed when the links are clicked. Applications do not have access to the URLs generated for these links, as they do with send/suspend/dispatch, and therefore cannot re-use them on a page (to conserve resources), modify them, or include them in JavaScript. Nevertheless, Seaside also supports attaching blocks of code to form input elements and submit buttons, which get executed automatically when the associated form is submitted. Though Seaside’s object-oriented approach makes it more susceptible to the Orbitz bug and other misplaced mutations, it overcomes this with a mechanism to “backtrack” the state of components if the user uses the back button.

While Seaside’s component-based approach is very good for modularizing complex pages, it does have the limitation that a single component cannot interrupt its computation to send a page to the user without passing control to another component using the call method. Furthermore, Seaside’s request-processing strategy requires that a component define a method to return a list of all subcomponents it might render, separate from the method that actually chooses and renders those components.

Good Things
  • HTML is generated by sending messages to an HTMLRenderer object. Nested content is created by using a block with its own messages as an argument. Good means of abstraction.
  • Anchors and submit buttons are given blocks, which function as s/s/d callbacks
  • Small support for custom URLs: components can implement an updateUrl method. Needs more documentation.
  • Support for embedding subcomponents, who can call: other components, which replace them in the rendered page.
  • Has an isolate: method for preventing backing into committed transactions.
  • Strong development environment, with updating running code and online debugging
Curious Things
  • All input elements are given callbacks that are invoked when the form is submited. The argument to the callback is the value of the form field. Used for saving the form state to an object. Seems like a lot of boilerplate?
  • It’s good that Seaside provides a mechanism for “backtracking” objects, but bad because it needs this because of its heavy reliance on mutation.
Bad Things
  • Because Smalltalk keywords must come in a particular order, need a hack, the attribute buffer, to handle arbitrary attributes on HTML elements.
  • Is it true that call: must take a separate controller as its argument?
  • Leakage: “Each parent component must implement a #children method that returns a collection of all of the subcomponents that it might display on the next render.”
  • Don’t seem to have access to URLs (for re-using or for appending #s to)
  • Can a subcomponent make a call to another component modally? i.e.: the called component takes over the screen, but when it answers it does it to subcomponent?

Opinion Things
  • Award for slickest-looking web site so far

0 Comments:

Post a Comment

<< Home