Spindle Web Framework
-
Upload
kristoffer-lawson -
Category
Technology
-
view
1.267 -
download
0
description
Transcript of Spindle Web Framework
The Spindle Web Framework
Kristoffer Lawson, [email protected]: @Setok
Motivation
• Experience with Django
• Knowledge of Cocoa’s MVC
• Love of the Tcl language
Features
• Embedded web server
• MVC with full separation of each part of framework
• Simple, but powerful
• No dumb invented template language
• Based on Tcl + XOTcl
Tcl — Language of Kings
• Script language, http://www.tcl.tk/
• Popular GUI: Tk
• Ultra-dynamic
• Extendable
• Embeddable
Everything is a Command
set a 5puts “Hello, world”while {$a} { puts “Hi” incr a -1}
Everything is a String
set a “pu”set b “ts”$a$b “Hello, world”
Create new Constructs
proc do {body while expr} { uplevel while $expr $body}
Everything is Dynamic
rename while {}
Model-View-Controller
Model
Controller Viewactions
building rendered from
MVC in Cocoa (sometimes)
Model
Controller Viewactions
building based on
1: Connecting Controllers to URLs
FooController/foo connected
getHTMLFooView/foo
uses
connectedcall 'getHTML'
2: Connecting sub-URLs to methods
barFooController/foo/bar
getHTMLFooView/foo
call 'bar'
uses
connected
3: Passing forms
barenterName
FooController/foo
getHTMLFooView/foo
call 'enterName'
uses
With form 'enterName'
connected
nameFooNameForm
CreatesGets passed as arg
4: Widgets
barenterName
FooController/foo
getHTMLFooView/foo
connected'
uses
connected
AttributeAttribute
ListWidgetController
is datasource for
gets info from
getHTMLListWidgetView
uses
calls 'getHTML'
5: Templates
<html><body>Hello, [$controller name][widget UserList]</body></html>
Templates contd.
<ul>[foreach name [$controller names] {<li>Hello, $name</li>}]</ul>
Models?
• No forced model framework
• Use whichever one you like
• Been developing an experiment called Storm
Want to try?
• http://github.com/Setok/Spindle/
• http://github.com/Setok/Storm/
Contact
Kristoffer Lawson
Twitter: @Setok