Sign In/My Account | View Cart  
advertisement


Listen Print Discuss
The Beauty of REST

The Beauty of REST

by Jon Udell
March 17, 2004

I've just been to SXSW to speak on a panel called Streetwise Librarians and the Revolution in Libraries. My own small contribution to that revolution, and the reason for my visit to SXSW, is the LibraryLookup project I launched 16 months ago. I'll admit that "project" is a lofty term for what is, basically, just a bunch of variations on a simple JavaScript bookmarklet. But for thousands of patrons of hundreds of libraries, that snippet of JavaScript -- which extracts the ISBN from an Amazon (or other ISBN-bearing) URL and checks for the book's availability in your local library -- has been an eye-opener.

Rekindled interest in local libraries is part of LibraryLookup's charm. In the ecommerce era, when any book is just a click and a Fedex shipment away, we tend to forget that access to library books is both free and immediate. You don't need to own every book that you read! Despite its anti-commercial overtones, though, I don't think LibraryLookup competes with booksellers in any serious way. Rather, I'd argue that by encouraging the habit of reading it can only help the booksellers' cause. In any case, promoting literacy isn't LibraryLookup's only agenda. It's also my best example of how RESTful systems enable ad-hoc integration, and of how, conversely, non-RESTful systems can thwart it.

There are a handful of major OPAC (online public access catalog) systems, and dozens of minor ones. I started with the major variants, and followed the usual recipe: first identify the URL that does what you want (in my case, search by ISBN), then repackage or parameterize the URL. It's helpful when the system you're working with uses HTTP GET and leaves the URL in the browser's location field ("URL-line"). But recovering the implicit URL that's hidden behind an HTTP POST gets easier all the time. My new favorite tool for that job is Chris Pederick's Web Developer Extension, an installable add-in for Mozilla-family browsers. Among many other conveniences, it will automatically convert between GETs and POSTs.

The use of POST rather than GET is a minor obstacle, but some other design choices are deal breakers. At least one OPAC, for example, presents its user interface in a Java applet, thereby foreclosing the possibility of Web-style integration. If there were Flash-based OPAC clients, they'd suffer from the same problem. The solution here isn't to eschew the rich client, but rather to build it on a foundation of XML services and to make sure those services are available to REST clients as well as to those using SOAP or some other flavor of XML over HTTP. If you're starting from scratch and want to use SOAP, make sure your SOAP toolkit supports the HTTP GET mode of access.

The use of session identifiers is another deal breaker. Some OPAC systems require them unnecessarily. If you want to review your account or renew a book, you've got to be logged in. But there's no need to identify yourself if you're only searching. Yet some OPACs establish session IDs for all activities, including anonymous search. This policy thwarts LibraryLookup. I could field a proxy service to handle the session-ID protocol, thus enabling the LibraryLookup bookmarklet user to have a one-click, no-hassle experience. But requiring a hosted intermediary throws cold water on spontaneous integration. The fewer moving parts, the better. The LibraryLookup project originally manifested itself as a handful of lists of prebuilt bookmarklets. When it became impractical to maintain those lists, I added a JavaScript-based build your own bookmarklet page that translates a domain name and an OPAC type into a LibraryLookup bookmarklet. But there are no dynamic services running in support of that page. That would be overkill for something as simple as splicing together two existing web-based services that share a common piece of metadata.

I've really enjoyed watching librarians grasp and apply this technique. There's a standing invitation, on the build-your-own-bookmarklet page, for new URL patterns that extend the list of OPACs. The contributions I've received have more than doubled the number of supported systems. Often the contributors are not particularly geeky. They're just librarians who are thrilled to be able to produce the key that unlocks a useful bit integration on behalf of the patrons of their libraries. It never would have occurred to them that cross-site integration can be a simple thing, requiring neither the explicit cooperation of the endpoint systems nor a propellerhead in the middle to wrangle things into place. But once they see that the integration tool can be a plain old URL -- something they know how to capture, alter, and reuse -- they're off and running.

Although librarians are pleasantly surprised by all this, I'd rather it were the other way around. I think librarians, like all users of web-based information systems, should be unpleasantly surprised when they find that their systems haven't been engineered in the common sense ways that make them friendly to ad hoc integration.

    

More from Jon Udell

Lightweight XML Search Servers, Part 2

Lightweight XML Search Servers

The Social Life of XML

Interactive Microcontent

Language Instincts

I do see hopeful signs. When I showed one librarian why her OPAC system wouldn't cooperate with LibraryLookup, she concluded that her vendor had used "the wrong kind of software." And I agreed. She has never read Roy Fielding's thesis and never will, but she groks the REST principles intuitively. What she was saying, thogh she lacked the terminology to describe it, is that her OPAC is broken because it's not RESTful. And if she has any say in the matter, the next OPAC her library buys will be.

The word used again and again lately to describe distributed information systems is "composition". The Unix idea of piecing together solutions from reusable parts has morphed into XML-based, service-oriented architecture. This time around, though, it's all happening on the Web, in an environment where everybody can compose simple and popular tunes. When technologists forget that, I hope users will administer the dope slap we deserve.


Comment on this articleDo you have other success stories of RESTian systems?
(* You must be a
member of XML.com to use this feature.)
Comment on this Article


Titles Only Titles Only Newest First
  • Locksmith Los Angeles 1-877-364-5264 24/7 Locksmiths
    2008-12-16 12:48:29 services123 [Reply]

    Locksmith Los Angeles 1-877-364-5264 24/7 Locksmiths


    San Fernando Valley Locksmith 1-818-386-1022



    Los Angeles Hollywood Locksmith 1-323-678-2704



    West Los Angeles, Marina Del Rey, Culver City, Santa Monica, Beverly Hills Locksmith 1-310-925-1720
    install, repair, professional, locksmiths, unlock, lockout, locked out, rekey, rekeying
    Los Angeles Safe & Vault Sales and Installation For All Your Home & Business Needs | Doors installation wood, metal, Kalamein, and fire rated wood doors for both heavyweight commercial and standard residential needs. Door Closers Panic Bars Fire Exit Devices Floor or Head Check Bolts Door Frames Hinges Buzzer Systems Card Access Elevator Doors magnetic door locks, electric strikes, CCTV install Dvr Video Camera master key systems, CCTV and video surveillance, Alarm Systems, Keyless Entry Systems and Access Control Iron Works specializes in custom exterior and interior wrought iron design. We design and hand forge wrought iron entrance gates, driveway gates Child guard gates A/C cage gates Elevator doors Backyard gates Fire exit gates Custom design gates Storefront and Commercial Rolling Locksmith Blogs Locksmith Lockout Los Angeles Locksmith in Los Angeles

  • Water Damage Restoration Emergency 24 hour open 7 Days Call 1-877-364-5264
    2008-10-16 10:00:11 orellytos [Reply]

    Water Damage Restoration Emergency 24 hour open 7 Days Call 1-877-364-5264
    When disaster strikes such as a washing machine overflow, bath
    overflow, burst pipe, rainwater from balcony etc, water damage
    restoration procedures must be followed.
    It is not as simple as just sucking up the water and cleaning the
    carpet and letting the area dry naturally.


    It is not the wet carpet that is the problem it is the underlay and
    the wood or concrete floor that needs to be dried.



    If the underlay is not dried or replaced you will end up with mould
    and odour problems.
    Our procedure for wet carpet is as follows.



    1/ Call out to the premises and extract water using powerful vacuum
    extraction machinery.



    2/ Apply browning treatment to carpet to prevent water stains.



    3/ Move furniture on to foam blocks to avoid further damage.



    4/ Lift corner of carpet and inspect for damage underneath carpet.



    5/ Install drying equipment such as air movers and / or dehumidifiers
    and leave these on site until area is dry.



    6/ Call back to premises on daily basis to check drying progress.



    7/ Relay carpet and underlay when dry.



    8/ Steam clean and deodorise carpet on completion of restoration.



    Notes on water restoration:



    1/ An area such as a bedroom will normally take between 24-48 hours to
    dry completely using drying equipment.



    2/ When a premises has been affected by sewage overflow we do not
    attempt carpet restoration. The carpet and underlay must be removed
    from the premises and disposed and the flooring treated and
    deodorised. USA Standards does not allow restoration of sewage
    affected carpet.


    Water Damage Restoration Emergency 24 hour open 7 Days Call 1-877-364-5264





  • article
    2007-07-28 14:33:04 profesjonalna [Reply]

    This is really great article I think I will write a post with link to this brilliant idea!


    Tom Black
    http://www.article.webdirectorybid.org

  • Anonymous sessions
    2004-05-27 02:34:11 Owen Stephens [Reply]

    Although I agree with the general points made in the article, I just thought it was worth pointing out that the use of session ids doesn't necessarily mean that you can't use the library lookup tool. The application just has to handle sessions sensibly - and be able to create a session when necessary.


    At least one system I know uses session IDs to allow even an anonymous user to see a 'history' of their searching of the catalogue so far. This is pretty standard functionality for a library catalogue, and very handy to go back to searches that you have done previously