×
Copy
Open
Link
Embed
Share
Beginning
This slide
Copy link URL
Copy link URL
Copy iframe embed code
Copy iframe embed code
Copy javascript embed code
Copy javascript embed code
Share
Tweet
Share
Tweet
Slide 1
Slide 1 text
A Tale of Two Frameworks Chang Sau Sheong @sausheong
Slide 2
Slide 2 text
“It was the best of times, it was the worst of times …”
Slide 3
Slide 3 text
No content
Slide 4
Slide 4 text
How web frameworks work
Slide 5
Slide 5 text
Server Client Request Response Header Body Header Body HTTP methods: GET, POST etc Status codes: 200, 404 etc
Slide 6
Slide 6 text
No content
Slide 7
Slide 7 text
Parts of a server-side web framework
Slide 8
Slide 8 text
Models
Slide 9
Slide 9 text
Routes
Slide 10
Slide 10 text
Views
Slide 11
Slide 11 text
Assets
Slide 12
Slide 12 text
Minimalist Sinatra + Haml + Sequel + Postgres
Slide 13
Slide 13 text
Alternative Cuba + Mustache + Mongoid + MongoDB
Slide 14
Slide 14 text
Minimalist
Slide 15
Slide 15 text
Least effort
Slide 16
Slide 16 text
Code for humans
Slide 17
Slide 17 text
Principle of Good Enough
Slide 18
Slide 18 text
Sinatra
Slide 19
Slide 19 text
“Domain specific language for quickly creating web applications.”
Slide 20
Slide 20 text
No content
Slide 21
Slide 21 text
*HTML abstraction markup language
Slide 22
Slide 22 text
“Markup should be beautiful.”
Slide 23
Slide 23 text
%section.container %h1= post.title %h2= post.subtitle .content = post.content
<%= post.title %>
<%= post.subtitle %>
<%= post.content %>
Slide 24
Slide 24 text
No content
Slide 25
Slide 25 text
No content
Slide 26
Slide 26 text
“Ruby object relational mapper.”
Slide 27
Slide 27 text
No content
Slide 28
Slide 28 text
Migrate (Create the database tables)
Slide 29
Slide 29 text
Model
Slide 30
Slide 30 text
No content
Slide 31
Slide 31 text
Alternative
Slide 32
Slide 32 text
Cuba
Slide 33
Slide 33 text
“Ruby microframework for web development.”
Slide 34
Slide 34 text
Hierarchical routes
Slide 35
Slide 35 text
Focus on matching
Slide 36
Slide 36 text
No content
Slide 37
Slide 37 text
{ Mustache
Slide 38
Slide 38 text
“Logic-less templates.”
Slide 39
Slide 39 text
There are only tags.
Slide 40
Slide 40 text
No content
Slide 41
Slide 41 text
No content
Slide 42
Slide 42 text
“Document database with JSON- styled documents.”
Slide 43
Slide 43 text
Mongoid
Slide 44
Slide 44 text
“Ruby object document mapper for MongoDB.”
Slide 45
Slide 45 text
No content
Slide 46
Slide 46 text
https://github.com/sausheong/server-frameworks
Slide 47
Slide 47 text
Questions?