Web Sites (M)
160
120
Scalability?
80
The Web Has It.
40
0
2005 2006 2007 2008
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.com/photos/abletoven/
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.
Video Search
Edge caching takes the burden of caching away
from overloaded servers.
http://www.flickr.com/photos/33122834@N06/
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.flickr.com/photos/dirigibleduck/
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/
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/24293932@N00/
Allow Layered Architectures
Proxies and gateways can decouple server
implementations from network policies.
http://www.flickr.com/photos/rengel134/
But it’s still just Ruby ...
pages $ waves console
Pages::Resources::Story.instance_methods &
%w( get put post delete )
# => [\"delete\", \"post\", \"put\", \"get\"]
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.
The One File Waves App
module HelloWorld
include Waves::Foundations::Compact
module Resources
class Map
on( :get, [] ) { \"Hello #{query.name}\" }
end
end
end
Roadmap
# TODO: this is a hack ...
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
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/
Shout Out
polymar, rue, leetspete, kaykay, automatthew,
pascal, copawaves, and many others.
0 comments
Post a comment