“REST + ExtJS + Jester”
August 27, 2008
Study each of these geeky things, and then read on:
- REST: http://en.wikipedia.org/wiki/Representational_State_Transfer, and http://ryandaigle.com/articles/2006/8/1/whats-new-in-edge-rails-simply-restful-support-and-how-to-use-it
- ExtJS: http://extjs.com/
- Jester: http://giantrobots.thoughtbot.com/2007/4/2/jester-javascriptian-rest
What is the idea? Hmm, let me explain it as simply as I can.
REST
The idea of REST is that a web service should simply provide resources (’things’, or ‘objects’, that you can do things with, such as create and read and change), with a set of actions
(verbs, the things you can do with those objects). A typical RESTful
website will provide a set of related resources with a set of possible
actions for each of those resources. To a person the site will send
HTML, but to a machine it might send XML or JSON formatted data. The
actions that can be performed on these objects should the several verbs
of REST: post, get, put, and delete (these correspond to the more human
words create, read, update, and destroy, also known as CRUD).
ExtJS
The
idea behind ExtJS (as far as I can perceive) is to create a javascript
framework that makes it possible to script an application’s entire
workings in the browser, with a rich look and feel. Do some google
searches to find examples of ExtJS in the works, or head over to the Ext Documentation for API and examples.
Jester
Jester
is a Javascript library that emulates Rails-style models. It could be
thought of as a Javascript ActiveResource. Specifically, it allows you
to access a Person object, for example, in your Javascript code.
Getting that object includes a transparent AJAX call to the
application’s standard REST protocol, and it supports modifying those
objects and saving them, almost identical to the way you’d do it in
your Rails controllers.
The Synergy
My
point to this article is that I think the combination of these
libraries and concepts is the Right Way to do web programming (at least
with what we have at our fingertips this year). I believe it is the
Right Concept to execute all of the application-specific logic at the
client and leave the webserver as a dumb but robust resource operator.
(Bonus: Add slingshot to your application and this will work extremely well!)
The
coolness begins here. If you program your applications in this way, you
get a bonus: You can super-easily (well, okay, gui’s can take a while
to make well) create several different client-side interfaces to your
application. You could create a multi-faceted application and create a
client interface that is specific to each facet of operations. Scale it
bigger and run several applications that are mostly different, all as
one integrated application, just with different client interfaces to
interact with only what is relevant to its needs.
Give me your thoughts!
Entry Filed under: jester, rails, rest, restful, rubyonrails. Tags: jester, rails, rest, restful, rubyonrails.
Trackback this post | Subscribe to the comments via RSS Feed