LA RubyConf 2009 Waves And Resource-Oriented Architecture


Published on

What is resource-oriented architecture? Why does it matter? How does Waves support ROA?

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

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

LA RubyConf 2009 Waves And Resource-Oriented Architecture

  1. Resource-Oriented Architecture And Why It Matters And How Waves Make It Easier
  2. dan yoder interactive r&d director.hacking AutoCode • Functor • Filebase Waves • Pages • Hoshi • DateJS
  3. The Web works pretty well.
  4. Web Sites (M) 160 120 Scalability? 80 The Web Has It. 40 0 2005 2006 2007 2008
  5. HTML JSON CSS Open? M I M E Yep. Mostly, anyway. XML RSS RDF
  6. Existing Infrastructure? Firewalls, Edge Caches, Proxy Servers, Etc.
  7. But why does it work?
  8. The Web Isn’t MVC So Why Do We Use It So Often For Web Apps?
  9. RSS: From Blogs To Podcasts Feed provides RDF-like metadata, media-type can vary, many different clients.
  10. login get request token grant permission get permission Provider Consumer Resource Proxy access resource access token HTTP Auth OAuth OAuth Smart Proxies Like firewalls for your apps - implementors don’t need to add OAuth support directly.
  11. Video Search Edge caching takes the burden of caching away from overloaded servers.
  12. Taking a step back ...
  13. ROA Is Just Distributed Objects. Except based on Fielding’s REST constraints.
  14. ROA Solves An Old Problem. RPC? CORBA? DCOM? DSOM? RMI? SOA?
  15. Learning From Past Mistakes
  16. Be platform neutral. Don’t assume anything about the format of an object. Let the client specify it, instead.
  17. Be Wire Neutral, Too. Protocols evolve and change. Make it possible to link to resources using older protocols.
  18. Define Meta-Object Protocols “Uniform stateless interface” means rich interactions happen on the client.
  19. Don’t Forget Performance. This means edge caching and pushing computation out to the client.
  20. Allow Layered Architectures Proxies and gateways can decouple server implementations from network policies.
  21. Waves and ROA ...
  22. Rich DSL for HTTP requests on( :get, [ ‘location’ ], :query => { :lat => /d{4}/, :long => /d{4}/ }, :accept => [ :json, :xml ] )
  23. But it’s still just Ruby ... pages $ waves console Pages::Resources::Story.instance_methods & %w( get put post delete ) # => [quot;deletequot;, quot;postquot;, quot;putquot;, quot;getquot;]
  24. Resource Classes Inheritance. I can now just inherit from a base class to provide common REST features. Modularity. Request-handling is broken down into logically discrete chunks, just like normal classes. Performance. I don’t have to go through each possible match - just those for the matching resource.
  25. The One File Waves App module HelloWorld include Waves::Foundations::Compact module Resources class Map on( :get, [] ) { quot;Hello #{}quot; } end end end
  26. Roadmap # TODO: this is a hack ...
  27. A Resource DSL class Blog include Waves::Resource::Server   resource :list, :expires => 3.days, [ ‘blogs’ ]  do     get { model.find_all }   end   resource :element, :expires => 3.days, [ ‘blog’, :name ]  do     get { model.find_by_name( ) }   end   schema :element, [ 'schema', 'blog', '2009-03' ] do     attributes :title => String, :description => String     link :entries, :list => Story   end   representations :list do    as :html, :lang => :en do | blogs |      view( :blog ).list( blogs )    end   end end
  28. Waves::Vitals Initial 0.7.0 release Feb 08 Release 0.8.3 Available Soon! Of course, we’re on git. Join Us On Google Groups. rubywaves And, lest we forget, a Web site.
  29. Shout Out polymar, rue, leetspete, kaykay, automatthew, pascal, copawaves, and many others.
  30. Thanks!