Frameworks
Upcoming SlideShare
Loading in...5
×
 

Frameworks

on

  • 609 views

 

Statistics

Views

Total Views
609
Views on SlideShare
609
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Frameworks Frameworks Presentation Transcript

  • The Right Tool For the Job
  • Who am I?
  • @itchyankles View slide
  • I need to build a server! View slide
  • What do I do?!
  • So many choices Django Compojure ASP.Net MVC Spring Sinatra Scalatra Meteor Rails Play Cake Liberator Code Ignitor Grails
  • What Makes Them Different? • Language • Performance • General Developer Speed • Library Support • Abstraction
  • Quick HTTP Break
  • What is HTTP?
  • Protocol An established set of guidelines for communication
  • Some Languages Have Nice Built in Web Server Support
  • var http = require("http"); http.createServer(function(request,response){ response.write("Hello World"); response.end(); }).listen(8080);
  • package main ! import ( "fmt" "net/http" ) ! func handler(w http.ResponseWriter, r *http.Request) { fmt.Fprint(w, "Hello, world!") } ! func main() { http.HandleFunc("/", handler) http.ListenAndServe(":8080", nil) }
  • Ruby also has a built in server library….
  • … but no one uses it.
  • Rack wraps HTTP in a very thin Ruby layer
  • Rack app = lambda do |env| body = "Hello, World!" [ 200, { "Content-Type" => "text/plain", "Content-Length" => body.length.to_s }, [body] ] end ! run app
  • Weird, no?
  • Let’s Make this Prettier
  • Sinatra require 'sinatra' ! get '/' do "Hello World!" end
  • And The Next Step?
  • Well there are other alternatives, but let’s hold off on those…
  • Let’s Compare, Shall We?
  • Why Would We Ever Use Rack?
  • With Great Power Comes…
  • With Great Power Comes…
  • So why does Sinatra give us?
  • DSL (Domain Specific Language)
  • View Helpers!
  • A bit of convenience
  • So why does Rails give us?
  • ActiveRecord ActiveSupport ActionView
  • Good News
  • Rails and Sinatra are Popular!
  • Questions?!