Strategies for Landing an Oracle DBA Job as a Fresher
Seaside
1. ESUG 2002 Seaside
Seaside
Web Application Toolkit
for Squeak
Lukas Renggli, Adrian Lienhard Sheet #1
2. ESUG 2002 Seaside
Introduction
Ø About us
• Lukas Renggli
users of the Seaside framework
• Adrian Lienhard
Ø Seaside Developers
• Avi Bryant
• Julian Fitzell
Lukas Renggli, Adrian Lienhard Sheet #2
3. ESUG 2002 Seaside
Content
Ø What can be done with Seaside?
• Example Application: SWebMail
• Reading mailbox form POP account
• Sending e-mails over SMTP server
Ø Why should Seaside be used?
• Complete separation of logic and design
• Object-oriented programming on the fly
• Application control flow
Ø Why is Seaside so easy to use?
• Action methods
• Bidirectional binding of properties
• Session management
• …
Lukas Renggli, Adrian Lienhard Sheet #3
5. ESUG 2002 Seaside
Reuse by Composition
Ø Component architecture
Ø Widgets
• Tab sheet
• Date selector
• Batches
• Sortable tables
Ø Dialogs
• Information
• Confirmation
• Choose
• Ask
Lukas Renggli, Adrian Lienhard Sheet #5
6. ESUG 2002 Seaside
Separation of Logic
and Design
Ø Programmers should create logic
Ø Designers should create HTML (templates)
M V C
IAComponent
ViewController
+html()
Model +actionMethod()
Lukas Renggli, Adrian Lienhard Sheet #6
7. ESUG 2002 Seaside
Creation of Templates
Ø Override IAComponent>>html and return
• a string containing valid HTML
SWebMail>>html
^ '<html>
<head>
V
<title>SWebMail</title>
<style type="text/css">[css]</style>
</head>
<body>
<h1>SWebMail</h1>
<swebmaillogin sea:id="login"></swebmaillogin>
</body>
</html>'
Ø External files
• WYSIWYG editors
• Designers can work independently
Lukas Renggli, Adrian Lienhard Sheet #7
8. ESUG 2002 Seaside
Binding of Properties
Ø Unidirectional binding
SWebMailView>>html
^ '...
<tr>
V
<td>Subject:</td>
<td>[message.subject]</td>
</tr>
...'
Ø Bidirectional binding
SWebMailCompose>>html
^ '...
<form sea:id="reload">
V
<input type="text" sea:id="subject">
...'
C
SWebMailCompose>>subject
^ subject ifNil: [ subject := String new ]
SWebMailCompose>>subject: aString
subject := aString
Lukas Renggli, Adrian Lienhard Sheet #8
9. ESUG 2002 Seaside
Template-Variable Look Up
Ø Looking up sequence of properties
• Template Locals
• Accessor methods
• Instance variables
SWebMailInbox>>html
^ '... V
<tr sea:id="item/sortedmessages">
<td>[item.subject]</td>
<td>[item.fromAddress]</td>
...'
Lukas Renggli, Adrian Lienhard Sheet #9
10. ESUG 2002 Seaside
Action Methods
Ø Modify the component's state
• Message is executed
• Same component is redisplayed
Ø The action method might also
• Expect a parameter
• Replace the current component at runtime
• Throw an exception: a stack-dump will be sent to
the browser
SWebMailMain>>html
^ '... V
<a href="@about">About</a>
...'
C
SWebMailMain>>about
self callPage: (SWebMailAbout new)
Lukas Renggli, Adrian Lienhard Sheet #10
11. ESUG 2002 Seaside
Application Control Flow
Ø Common way
• Manual stack handling
• Difficult to implement
• Error prone
1: goto 2: goto 3: goto
Login Inbox View Reply
Ø Seaside
• Transforms traditional Smalltalk send/return
control flow onto the web
• Supports
• Backtracking (back button)
• Transactions (full blocks)
Lukas Renggli, Adrian Lienhard Sheet #11
12. ESUG 2002 Seaside
Application Control Flow
Ø Call pages with message:
IAComponent>>callPage: aComponent
Ø Return result from page with message:
IAComponent>>return: aValue
4: #callPage: Reply
5: #return
3: #callPage: View
6: #return
Inbox
1: #callPage:
7: #confirm:
8: #return:
Login Dialog C
2: #return:
Lukas Renggli, Adrian Lienhard Sheet #12
13. ESUG 2002 Seaside
Session Management
Ø Seaside manages and caches all needed
session data automatically
• Each session has its own set of objects
• Caches: LRU, Expiring, ...
Ø Example: IASession is subclassed to
• Store the user-preferences
• Login and logout handling
IASession
SWebMailSession SWebMailPreferences
Lukas Renggli, Adrian Lienhard Sheet #13
15. ESUG 2002 Seaside
Seaside 2.0 (Borges)
Ø Full reimplementation
Ø Supports a wider set of styles
Ø Layered design
Borges-Components
Control flow between pages
Safe backtracking
Component embedding
Borges-Support
Callback system
HTML renderer
Borges-Kernel
HTTP session
Request
Response
Lukas Renggli, Adrian Lienhard Sheet #15
16. ESUG 2002 Seaside
Comparison
Seaside Zope
Language Smalltalk Python
OOP Complete Partly
Reuse Heavily Possible
Separation Yes No, but ZPT
Control Flow Message calling Request, Response
Debugging WebInspector Difficult
Database (Seashell), GOODS, ZODB, PostgreSQL,
Tantalus, ODBC, ... MySQL, ODBC, ...
Large Systems Not tested Possible
Integration Apache Apache
Lukas Renggli, Adrian Lienhard Sheet #16
17. ESUG 2002 Seaside
Summary
Ø Seaside: Squeak Enterprise Aubergines Server
• Developers: Avi Bryant, Julian Fitzell
• Current Version: 0.94.1
• License: Squeak-L, BSD
Ø Works best with
• Squeak 3.0, 3.1, 3.2
• Comanche 4.9, 4.10
• Windows, Mac OS X, Linux, SUN Unix, ...
Ø Ports underway
• Dolphin Smalltalk
• VisualWorks
Lukas Renggli, Adrian Lienhard Sheet #17