Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
All about
Sammy
Who is Sammy?
A Clientside
  JavaScript
 Framework
Inspired by Sinatra, a server-side
framework from the Ruby World

       and created ...
For single-page apps
(no-reload, a la gmail)
Using the URL Hash
            (#...)
http://yourapp.com/#/
http://yourapp.com/#/posts
http://yourapp.com/#/posts/hello-wo...
Remains bookmarkable
 Retains “back” button
Built on jQuery
Tiny
About 7kb when minified
The App
Application Function
Routes
verb + path + callback
Example: a little jQuery
Verbs
GET, POST, PUT, DELETE, and bind
Client-Side Forms
  This is where ‘post’ comes in...
Create a “post” route
  “posts” have access to a params hash
Route Paths

•   Can be a string      '#/say_my_name'

•   Or a regular expression /#/by_name/(.*)/ params[‘splat’]

•   N...
Binding
Routes that respond to internal events
Triggering
Execute bound routes with trigger(event_name, ...)
Bind/Trigger Example
Templates & Partials
ERB style notation. HTML, substitute variables, etc.




      Template file: “task_details.html.erb”
Multiple apps, one page

• each app bound to specific element
• unique ID and namespace
• possible to create controller app...
Data Storage

• CouchDB
• CloudKit
• Client-side Storage

       So many buzzwords, so little time...
Thanks!
Scott Becker - http://synthesis.sbecker.net
       http://twitter.com/sbecker
Upcoming SlideShare
Loading in …5
×

All About Sammy

6,517 views

Published on

A short technical overview of Sammy, a client-side JavaScript framework, inspired by the server-side Ruby framework Sinatra.

Published in: Technology, Education
  • Be the first to comment

All About Sammy

  1. 1. All about Sammy
  2. 2. Who is Sammy?
  3. 3. A Clientside JavaScript Framework Inspired by Sinatra, a server-side framework from the Ruby World and created by: Aaron Quint :: quirkey.com
  4. 4. For single-page apps (no-reload, a la gmail)
  5. 5. Using the URL Hash (#...) http://yourapp.com/#/ http://yourapp.com/#/posts http://yourapp.com/#/posts/hello-world
  6. 6. Remains bookmarkable Retains “back” button
  7. 7. Built on jQuery
  8. 8. Tiny About 7kb when minified
  9. 9. The App
  10. 10. Application Function
  11. 11. Routes verb + path + callback
  12. 12. Example: a little jQuery
  13. 13. Verbs GET, POST, PUT, DELETE, and bind
  14. 14. Client-Side Forms This is where ‘post’ comes in...
  15. 15. Create a “post” route “posts” have access to a params hash
  16. 16. Route Paths • Can be a string '#/say_my_name' • Or a regular expression /#/by_name/(.*)/ params[‘splat’] • Named params '#/by_name/:name' params[‘name’]
  17. 17. Binding Routes that respond to internal events
  18. 18. Triggering Execute bound routes with trigger(event_name, ...)
  19. 19. Bind/Trigger Example
  20. 20. Templates & Partials ERB style notation. HTML, substitute variables, etc. Template file: “task_details.html.erb”
  21. 21. Multiple apps, one page • each app bound to specific element • unique ID and namespace • possible to create controller apps for individual elements, widgets, etc.
  22. 22. Data Storage • CouchDB • CloudKit • Client-side Storage So many buzzwords, so little time...
  23. 23. Thanks! Scott Becker - http://synthesis.sbecker.net http://twitter.com/sbecker

×