All About Sammy

6,190 views
6,047 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
0 Comments
6 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
6,190
On SlideShare
0
From Embeds
0
Number of Embeds
1,289
Actions
Shares
0
Downloads
76
Comments
0
Likes
6
Embeds 0
No embeds

No notes for slide

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

×