32
Seaside Evolution and things you never knew you could do Julian Fitzell – [email protected]

Seaside Evolution

  • Upload
    esug

  • View
    339

  • Download
    1

Embed Size (px)

DESCRIPTION

Seaside Evolution and things you never knew you could do. Julian Fitzell. ESUG 2008, Amsterdam

Citation preview

Page 1: Seaside Evolution

Seaside Evolution

and things you never knew you could do

Julian Fitzell – [email protected]

Page 2: Seaside Evolution

Experimentation

Stabilization

Optimization

Adoption

Page 3: Seaside Evolution

Experimentation

Page 4: Seaside Evolution

WebObjects

Page 5: Seaside Evolution

Iowa

Interpreted

Objects

for

Web

Applications

Page 6: Seaside Evolution

Iowa Exampleclass Main < Iowa::Component

attr_accessor :person

def all_people

Person.fetch_all()

end

def delete_person

Person.delete(@person)

end

end

Page 7: Seaside Evolution

Iowa Example (cont’d)<ul oid="people">

<li>@person.firstName @person.lastName

<a oid="delete_person">delete</a></li>

</ul>

<?

people {

item = person

list = all_people

}

?>

Page 8: Seaside Evolution
Page 9: Seaside Evolution

Synchronous Development:

inverting the request/response loop

Web Browser

Web Server

Sta

rt

Start app and

Request data A

Requ

est A

Subm

it A

Process A and

Request B

Requ

est B

Subm

it B

Process B and

Request C

Requ

est C

Request data A

and Process

Request data B

and Process

Request

data CStart app

Page 10: Seaside Evolution

Seaside 0.9: Examplehtml

^ '

<ul sea:id="people">

<li>[person.firstName] [person.lastName]

<a sea:id="delete:">delete</a></li>

</ul>

'

Page 11: Seaside Evolution

Example (cont’d)addBindingsTo: template

(template elementNamed: 'people')

bind: #list toPath: 'allPeople';

set: #iterator to: #person.

(template elementNamed: 'delete:')

bind: #argument toPath: 'person'.

Page 12: Seaside Evolution

Example (no bindings)html

^ '

<ul sea:id="person/allPeople">

<li>[person.firstName] [person.lastName]

<a sea:id="delete:">delete</a></li>

</ul>

'

Page 13: Seaside Evolution

Example (conditionals, embedding)

html

^ '

<if sea:id="allPeople.isEmptyOrNil.not">

Number of people: [allPeople.size]

</if>'

html

^ '

<form sea:id="save">

<input sea:id="firstName" />

<IADateSelector sea:id="birthday" />

</form>'

Page 14: Seaside Evolution

Seaside 0.9: Architecture

CORE

Comanche

Adaptor

PWS

Adaptor

ModLisp

Adaptor

Templates, tags

Components (pages)

Session, etc.

Page 15: Seaside Evolution

Templates

Magic

Layers

Seaside 2.x – Borges

Page 16: Seaside Evolution

- Jorge Luis Borges, The Garden of Forking Paths

In all fiction, when a man is faced with alternatives he

chooses one at the expense of the others. In the almost

unfathomable Ts'ui Pen, he chooses - simultaneously - all of them. He thus creates various futures, various times

which start others that will in turn branch out and bifurcate in other times...

Page 17: Seaside Evolution

Seaside 2.0: Architecture

Web Server (Comanche, etc)

Server Adaptor

KernelContinuations, request/response,

session management, state (back-)tracking

Viewscallbacks, HTML rendering

Componentscall/return, embedding, tools

Page 18: Seaside Evolution

Seaside 2.3: Architecture

Web Server (Comanche, etc)

Server Adaptor

Componentdelegation/calling, embedding

Rendering

HTML generation

Sessioncontinuations, state (back-)tracking, callbacks

Base

request/response handling

Page 19: Seaside Evolution

Stabilization

•State tracking

•Modularity

•Canvas API

Page 20: Seaside Evolution

OptimizationMemory•Speed•Complexity

Page 21: Seaside Evolution

AdoptionPortability

Documentation

Advocacy

GLASS

WebVelocity

Page 22: Seaside Evolution

Base

Seaside 2.9: Architecture

Platform

Config

Request Handling

Session Management

ComponentsRender Loop

Painter

Canvas

Server

Adaptors

ServersServersServers

Tests ExamplesDevelopment

Tools

Utils Exceptions HTTP

RenderLoopMain

Main

Application

EntryPoint

Native

Requests

Seaside Requests

CO

RE

Page 23: Seaside Evolution

The Metaphor

• main() {

• root = new_root_component();

• while (1) {

• render(root);

• process_callbacks(root);

• redirect();

• }

• }

WARenderLoopMain

WARenderLoop

WARenderContinuation

WARedirectContinuation

Page 24: Seaside Evolution

Plugging In: Some Ideas

• Configuration

• Error Handler

• Request Handler

• Session Expiry Handler

• Toolbar or Halo plugin

• … ?

Page 25: Seaside Evolution

Example: Configuration

• Subclass WASystemConfiguration

• Implement #describeOn:

• (optional) Implement #parents

• Add the configuration to your application

• Note: attribute names need to be unique so prefix yours appropriately to avoid collisions

Page 26: Seaside Evolution

Example: ConfigurationdescribeOn: config

(config string: #myappSoapHost)

label: 'SOAP Host';

comment: 'My App SOAP server hostname'.

(config list: #myappTheme)

label: 'Theme';

options: [self allThemes].

config at: #sessionClass put: MySession.

Page 27: Seaside Evolution

Example: Error Handler

• Subclass WAErrorHandler

• Implement #handleError:

• (optional) Implement #handleWarning: and #internalError:

• Select the error handler in your application’s configuration

Page 28: Seaside Evolution

Example: Error HandlerhandleError: anError

session := WACurrentRequestContext session.

self

sendEmailForSession: session

error: anError.

self forkAndSaveForDebugging.

Page 29: Seaside Evolution

Example: Request Handler

• Subclass WAEntryPoint

• Implement #handleRequest:

• (optional) Implement your own Configuration and add it as a parent in #defaultConfiguration

• Add an instance of your class to a dispatcher

Page 30: Seaside Evolution

Example: Session Expiry

Handler

• Subclass WAExpiredSessionKeyHandler

• Implement #handleRequest: to return a response

• Configure your application to use your new handler

Page 31: Seaside Evolution

Questions?

Julian Fitzell – [email protected]

Page 32: Seaside Evolution

Seaside 2.9 (a peek)

• Split into modules

• Configuration system refactoring

• First class mime types and locales

• Cryptographically secure session and continuation keys

• RequestContext

• Painter/Presenter refactoring (?)