Resource-Oriented Architecture
And Why It Matters
And How Waves Make It Easier
dan yoder                      interactive
                                     r&d
          director.hacking
        dan...
The Web works pretty well.
Web Sites (M)

160




120



         Scalability?
 80

       The Web Has It.
 40




  0
      2005   2006           20...
HTML
      JSON
        CSS
Open? M I M E
      Yep. Mostly, anyway.
       XML
        RSS
       RDF
Existing Infrastructure?
Firewalls, Edge Caches, Proxy Servers, Etc.
But why does it work?
The Web Isn’t MVC
So Why Do We Use It So Often For Web Apps?
http://www.flickr.com/photos/seokchanyun/
RSS: From Blogs To Podcasts
Feed provides RDF-like metadata, media-type
can vary, many different clients.
http://www.flickr...
login                    get request token
           grant permission               get permission
                      ...
Video Search
Edge caching takes the burden of caching away
from overloaded servers.
http://www.flickr.com/photos/33122834@N...
Taking a step back ...
ROA Is Just Distributed Objects.
Except based on Fielding’s REST constraints.
ROA Solves An Old Problem.
RPC? CORBA? DCOM? DSOM? RMI? SOA?
http://www.flickr.com/photos/secretlondon/
Learning From Past Mistakes
Be platform neutral.
Don’t assume anything about the format of an
object. Let the client specify it, instead.
http://www.fl...
Be Wire Neutral, Too.
Protocols evolve and change. Make it possible to
link to resources using older protocols.
http://www...
Define Meta-Object Protocols
“Uniform stateless interface” means rich
interactions happen on the client.
Don’t Forget Performance.
This means edge caching and pushing
computation out to the client.
http://www.flickr.com/photos/2...
Allow Layered Architectures
Proxies and gateways can decouple server
implementations from network policies.
http://www.flic...
Waves and ROA ...
Rich DSL for HTTP requests
on( :get, [ ‘location’ ],
  :query => { :lat => /d{4}/, :long => /d{4}/ },
  :accept => [ :json...
But it’s still just Ruby ...
pages $ waves console

Pages::Resources::Story.instance_methods &
  %w( get put post delete )...
Resource Classes

Inheritance. I can now just inherit from a base class to
provide common REST features.
Modularity. Reque...
The One File Waves App

module HelloWorld

  include Waves::Foundations::Compact

  module Resources
    class Map
      o...
Roadmap
# TODO: this is a hack ...
A Resource DSL
class Blog
  include Waves::Resource::Server
  resource :list, :expires => 3.days, [ ‘blogs’ ]  do
    get ...
Waves::Vitals
 Initial 0.7.0 release Feb 08
 Release 0.8.3 Available Soon!

 Of course, we’re on git.
 http://github.com/w...
Shout Out
polymar, rue, leetspete, kaykay, automatthew,
pascal, copawaves, and many others.
Thanks!
Upcoming SlideShare
Loading in...5
×

LA RubyConf 2009 Waves And Resource-Oriented Architecture

714

Published on

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

Published in: Technology, Education
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
714
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
50
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

LA RubyConf 2009 Waves And Resource-Oriented Architecture

  1. 1. Resource-Oriented Architecture And Why It Matters And How Waves Make It Easier
  2. 2. dan yoder interactive r&d director.hacking dan@zeraweb.com http://twitter.com/dyoder http://dev.zeraweb.com/ AutoCode • Functor • Filebase Waves • Pages • Hoshi • DateJS
  3. 3. The Web works pretty well.
  4. 4. Web Sites (M) 160 120 Scalability? 80 The Web Has It. 40 0 2005 2006 2007 2008
  5. 5. HTML JSON CSS Open? M I M E Yep. Mostly, anyway. XML RSS RDF
  6. 6. Existing Infrastructure? Firewalls, Edge Caches, Proxy Servers, Etc.
  7. 7. But why does it work?
  8. 8. The Web Isn’t MVC So Why Do We Use It So Often For Web Apps? http://www.flickr.com/photos/seokchanyun/
  9. 9. RSS: From Blogs To Podcasts Feed provides RDF-like metadata, media-type can vary, many different clients. http://www.flickr.com/photos/abletoven/
  10. 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. 11. Video Search Edge caching takes the burden of caching away from overloaded servers. http://www.flickr.com/photos/33122834@N06/
  12. 12. Taking a step back ...
  13. 13. ROA Is Just Distributed Objects. Except based on Fielding’s REST constraints.
  14. 14. ROA Solves An Old Problem. RPC? CORBA? DCOM? DSOM? RMI? SOA? http://www.flickr.com/photos/secretlondon/
  15. 15. Learning From Past Mistakes
  16. 16. Be platform neutral. Don’t assume anything about the format of an object. Let the client specify it, instead. http://www.flickr.com/photos/dirigibleduck/
  17. 17. Be Wire Neutral, Too. Protocols evolve and change. Make it possible to link to resources using older protocols. http://www.flickr.com/photos/megans_photography/
  18. 18. Define Meta-Object Protocols “Uniform stateless interface” means rich interactions happen on the client.
  19. 19. Don’t Forget Performance. This means edge caching and pushing computation out to the client. http://www.flickr.com/photos/24293932@N00/
  20. 20. Allow Layered Architectures Proxies and gateways can decouple server implementations from network policies. http://www.flickr.com/photos/rengel134/
  21. 21. Waves and ROA ...
  22. 22. Rich DSL for HTTP requests on( :get, [ ‘location’ ], :query => { :lat => /d{4}/, :long => /d{4}/ }, :accept => [ :json, :xml ] )
  23. 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. 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. 25. The One File Waves App module HelloWorld include Waves::Foundations::Compact module Resources class Map on( :get, [] ) { quot;Hello #{query.name}quot; } end end end
  26. 26. Roadmap # TODO: this is a hack ...
  27. 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( captured.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. 28. Waves::Vitals Initial 0.7.0 release Feb 08 Release 0.8.3 Available Soon! Of course, we’re on git. http://github.com/waves/stable Join Us On Google Groups. rubywaves irc:freenode.net#waves And, lest we forget, a Web site. http://rubywaves.com/
  29. 29. Shout Out polymar, rue, leetspete, kaykay, automatthew, pascal, copawaves, and many others.
  30. 30. Thanks!
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×