A RESTful chess service: Part 1

Author: Dave Cassel  |  Category: Software Development

I recently got a copy of RESTful Web Services, a book in the O’Reilly series that I read some time ago. I first read it when I was introduced to REST as an architectural style. It helped me get my head around a number of the concepts.

I decided that I want to refresh my memory about some aspects of designing RESTfully and to explore how to build a RESTful service using MarkLogic Server, so this post is actually the introduction to a miniseries. The book has a suggested method for going through the design steps, so I’ll walk through those steps and the implementation over a few posts. I invite you to read along and see how the process unfolds.

First things first: I need to decide what need I’m trying to satisfy. Being a chess player, I decided to implement a service that would be used by a chess organization such as the US Chess Federation, FIDE or the Free Internet Chess Server. These groups hold lots of tournaments, some of which are major international events while others are small events held by community chess clubs. In all cases, the tournament director needs to report the results to the organization, which will record the results and update players’ ratings.

Besides reporting, my service will support searching. The service should provide representations of players, events, and individual games. We’ll return player and event information as XML, but we’ll give users the choice between XML and PGN, the standard for chess notation, for individual games. We’ll need some search capability, in addition to browsing.

RESTful Web Services gives a 9-step Generic ROA (Resource Oriented Architecture) Procedure:

  1. Figure out the data set
  2. Split the data set into resources
  3. For each resource:

  4. Name the resources with URIs
  5. Expose a subset of the uniform interface
  6. Design the representation(s) accepted from the client
  7. Design the representation(s) served to the client
  8. Integrate this resource into existing resources, using hypermedia links and forms
  9. Consider the typical course of events
  10. Consider error conditions

In this post, I’ve introduced the series and laid out roughly what I want to do. Next time I’ll tackle the first two steps in the process. See you then!

Tags: , ,

3 Responses to “A RESTful chess service: Part 1”

  1. A RESTful chess service: part 2 « David Cassel Says:

    […] David Cassel on Software Development and Entrepreneurism « A RESTful chess service: Part 1 […]

  2. Dustin Says:

    is the final service live?

  3. Dave Cassel Says:

    Nope, not live yet. Actually, not written yet. Stay tuned. :)

Leave a Reply