Systems integration over the web has been successfully growing in a pace incomparable to any internal company attempt to centralize its services. Those REST systems are available and consumed everywhere over the web.
Yet there is one thing one can add to some of those systems that might make clients and services less bound to each other. Hypermedia. On my talk at QCon San Francisco 2010 I was able to show how the future of the systems integration over the web might look like.
Restfulie‘s first attempt to create a Ruby client for hypermedia services was in late 2009 with 100 lines of spaghetti ruby code. Eighteen months and lots of contributions later, Restfulie Ruby 1.0 is out: tackling both the server and client side on hypermedia based systems.
On the server side it is compatible both with Rails, Sinatra, while the its template engine can also be used anywhere else. On the client side, Restfulie provides an api that allows developers to bind their code to the media type and link relations, as expected with REST systems. Navigating a service is easy:
# entry points response =Restfulie.at(order_uri).get puts response.body # unmarshalling order = response.resource puts order.price # using hypermedia response = order.link.payment.post(my_payment)
Restfulie has grown to support other media types such as open search:
description = Restfulie.at("http://myserver.com/opensearch.xml") .accepts('application/opensearchdescription+xml') .get.resource items = description.use("application/xml") .search(:searchTerms => what, :startPage => 1)
We will be releasing the series Rest from Scratch again, using this latest release of Restfulie, wait for upcoming posts.
In the near future, Restfulie Ruby shall support forms and more. What are you waiting for to start decoupling those nasty client ideas of early 2000s? Or are you sticking to plain old coupling?