Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

The Restlet Framework, Part II

1,082 views

Published on

More on restlet, using the restlet-contactservice example system.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

The Restlet Framework, Part II

  1. 1. The Restlet Framework, Part II: restlet-contactservice Philip Johnson Collaborative Software Development Laboratory Information and Computer Sciences University of Hawaii
  2. 2. Agenda <ul><li>Restlet Concepts: </li></ul><ul><ul><li>Operations: </li></ul></ul><ul><ul><ul><li>GET, PUT, DELETE </li></ul></ul></ul><ul><ul><li>Representations: </li></ul></ul><ul><ul><ul><li>XML </li></ul></ul></ul><ul><li>Restlet-DateService: </li></ul><ul><ul><li>Download distribution </li></ul></ul><ul><ul><li>Command line usage </li></ul></ul><ul><ul><li>build.xml </li></ul></ul><ul><ul><li>The server-side code </li></ul></ul><ul><ul><li>The client-side code </li></ul></ul><ul><ul><li>JUnit tests + Jacoco </li></ul></ul><ul><ul><li>Building the jars </li></ul></ul>
  3. 3. In our last episode <ul><li>Restlet-timeservice </li></ul><ul><ul><li>Only implements GET </li></ul></ul><ul><ul><li>Data passed is simple strings </li></ul></ul><ul><ul><li>Uses only the core restlet jar file. </li></ul></ul>
  4. 4. A contact service <ul><li>Server supports addition, deletion, and retrieval of &quot;contacts&quot;. </li></ul><ul><li>Contacts are objects with the following fields: </li></ul><ul><ul><li>First Name </li></ul></ul><ul><ul><li>Last Name </li></ul></ul><ul><ul><li>Info </li></ul></ul><ul><ul><li>Unique ID </li></ul></ul><ul><li>The system represents Contacts two ways: </li></ul><ul><ul><li>As Java classes </li></ul></ul><ul><ul><li>As XML </li></ul></ul>
  5. 5. System structure <ul><li>org.hawaii.contactservice.server </li></ul><ul><ul><li>Server-specific code (in server jar file) </li></ul></ul><ul><li>org.hawaii.contactservice.client </li></ul><ul><ul><li>Client-specific code (in client jar file) </li></ul></ul><ul><li>org.hawaii.contactservice.common </li></ul><ul><ul><li>Code for both client and server (in both jars) </li></ul></ul>
  6. 6. Playing with the system <ul><li>Using jar files: </li></ul><ul><ul><li>Run server jar file in one command shell </li></ul></ul><ul><ul><li>Send/retrieve contact data using client jar file in another shell. </li></ul></ul><ul><li>Using ant commands: </li></ul><ul><ul><li>Compile, run unit tests, see coverage, build jar files. </li></ul></ul><ul><li>Using Eclipse: </li></ul><ul><ul><li>Inspect code, invoke unit tests. </li></ul></ul>
  7. 7. On to the demo.

×