Spindle Web Framework

19
The Spindle Web Framework Kristoffer Lawson, [email protected] Twitter: @Setok

description

Description of the Spindle web framework, which has a strong separation between view and controller (unlike many web frameworks), and utilises concepts such as widgets and form objects. It also has a powerful full template language, instead of inventing a crippled and awkward second language. Written in Tcl with the XOTcl OO extension.

Transcript of Spindle Web Framework

Page 1: Spindle Web Framework

The Spindle Web Framework

Kristoffer Lawson, [email protected]: @Setok

Page 2: Spindle Web Framework

Motivation

• Experience with Django

• Knowledge of Cocoa’s MVC

• Love of the Tcl language

Page 3: Spindle Web Framework

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

Page 4: Spindle Web Framework

Tcl — Language of Kings

• Script language, http://www.tcl.tk/

• Popular GUI: Tk

• Ultra-dynamic

• Extendable

• Embeddable

Page 5: Spindle Web Framework

Everything is a Command

set a 5puts “Hello, world”while {$a} { puts “Hi” incr a -1}

Page 6: Spindle Web Framework

Everything is a String

set a “pu”set b “ts”$a$b “Hello, world”

Page 7: Spindle Web Framework

Create new Constructs

proc do {body while expr} { uplevel while $expr $body}

Page 8: Spindle Web Framework

Everything is Dynamic

rename while {}

Page 9: Spindle Web Framework

Model-View-Controller

Model

Controller Viewactions

building rendered from

Page 10: Spindle Web Framework

MVC in Cocoa (sometimes)

Model

Controller Viewactions

building based on

Page 11: Spindle Web Framework

1: Connecting Controllers to URLs

FooController/foo connected

getHTMLFooView/foo

uses

connectedcall 'getHTML'

Page 12: Spindle Web Framework

2: Connecting sub-URLs to methods

barFooController/foo/bar

getHTMLFooView/foo

call 'bar'

uses

connected

Page 13: Spindle Web Framework

3: Passing forms

barenterName

FooController/foo

getHTMLFooView/foo

call 'enterName'

uses

With form 'enterName'

connected

nameFooNameForm

CreatesGets passed as arg

Page 14: Spindle Web Framework

4: Widgets

barenterName

FooController/foo

getHTMLFooView/foo

connected'

uses

connected

AttributeAttribute

ListWidgetController

is datasource for

gets info from

getHTMLListWidgetView

uses

calls 'getHTML'

Page 15: Spindle Web Framework

5: Templates

<html><body>Hello, [$controller name][widget UserList]</body></html>

Page 16: Spindle Web Framework

Templates contd.

<ul>[foreach name [$controller names] {<li>Hello, $name</li>}]</ul>

Page 17: Spindle Web Framework

Models?

• No forced model framework

• Use whichever one you like

• Been developing an experiment called Storm

Page 18: Spindle Web Framework

Want to try?

• http://github.com/Setok/Spindle/

• http://github.com/Setok/Storm/

Page 19: Spindle Web Framework

Contact

Kristoffer Lawson

[email protected]

Twitter: @Setok