Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Building an SDK for your API
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jørn Wildt  
View profile  
 More options Oct 3 2012, 1:11 am
From: Jørn Wildt <j...@fjeldgruppen.dk>
Date: Wed, 3 Oct 2012 07:11:20 +0200
Local: Wed, Oct 3 2012 1:11 am
Subject: Re: [api-craft] Building an SDK for your API

> yes I know if all web APIs were all hypermedia we'd only need one client

SDK per language, and that assuming we had a standard for hypermedia. But I
digress...

I have actually taken that approach in my current work - exposing a case
file management system as a REST services.

The idea is to have a generic HTTP (C#) client that works with the REST
idioms as first class citizens of the API - HTTP verbs are methods, it
understands hypermedia, and it works with the appropriate media types
directly in code. The only thing left for a dedicated service SDK is the
definition of link relations and classes that represent the wire format,
such that representations can easily be worked with directly from code.

Let me give an example ...

The generic client is "Ramone" (see
http://soabits.blogspot.dk/2012/04/introducing-ramone-c-library-for-w...
the other entries on the blog).

The SDK defines "const" values for link relations:

class MySDK
{
  public const string CaseFileLinkRel = "mynamespace/casefile";
  public const string AddDocumentLinkRel = "mynamespace/adddoc";

}

The SDK defines classes that represent the wire format:

class MySDK_CaseFile
{
  public long ID;
  public string Title;
  public string Description;

}

The SDK defines media codecs (see
http://soabits.blogspot.dk/2012/04/ramone-media-types-and-codecs.html) for
transforming between the wire format and the SDK classes. Ramone has
built-in support for JSON and XML (and HTML) transformations, so often this
is not required.

The service is assumed to present a service document at a well known URL
and the generic client can GET this and use the SDK defined link relations
to lookup the hyper media elements on the service document (see
http://soabits.blogspot.dk/2012/04/ramone-consuming-hyper-media-rest....).

From here the generic client just "follows its nose" using hyper media and
the SDK defined classes.

/Jørn


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.