Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up
for free
A Tale of Two Frameworks
Sau Sheong Chang
February 19, 2014
0
56
A Tale of Two Frameworks
https://github.com/sausheong/server-frameworks
Sau Sheong Chang
February 19, 2014
Tweet
Share
More Decks by Sau Sheong Chang
See All by Sau Sheong Chang
sausheong
0
54
sausheong
0
370
sausheong
0
200
sausheong
0
85
sausheong
0
44
sausheong
0
26
sausheong
7
590
sausheong
1
50
sausheong
3
260
Featured
See All Featured
sachag
267
17k
samanthasiow
56
6.3k
jponch
103
4.9k
vanstee
116
4.8k
hatefulcrawdad
257
17k
holman
461
280k
akmur
252
19k
iamctodd
17
1.8k
morganepeng
92
13k
sstephenson
144
12k
addyosmani
1348
190k
qrush
285
18k
Transcript
A Tale of Two Frameworks Chang Sau Sheong @sausheong
“It was the best of times, it was the worst
of times …”
None
How web frameworks work
Server Client Request Response Header Body Header Body HTTP methods:
GET, POST etc Status codes: 200, 404 etc
None
Parts of a server-side web framework
Models
Routes
Views
Assets
Minimalist Sinatra + Haml + Sequel + Postgres
Alternative Cuba + Mustache + Mongoid + MongoDB
Minimalist
Least effort
Code for humans
Principle of Good Enough
Sinatra
“Domain specific language for quickly creating web applications.”
None
*HTML abstraction markup language
“Markup should be beautiful.”
%section.container %h1= post.title %h2= post.subtitle .content = post.content <section class=”container”>
<h1><%= post.title %></h1> <h2><%= post.subtitle %></h2> <div class=”content”> <%= post.content %> </div> </section>
None
None
“Ruby object relational mapper.”
None
Migrate (Create the database tables)
Model
None
Alternative
Cuba
“Ruby microframework for web development.”
Hierarchical routes
Focus on matching
None
{ Mustache
“Logic-less templates.”
There are only tags.
None
None
“Document database with JSON- styled documents.”
Mongoid
“Ruby object document mapper for MongoDB.”
None
https://github.com/sausheong/server-frameworks
Questions?