| --- |
| layout: post |
| title: Restful Objects |
| date: '2011-08-03T13:02:38+00:00' |
| permalink: restful_objects |
| --- |
| <span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; line-height: 19px; ">
|
| <p>Now that we have our <a title="Apache Isis 0.1.2 (incubating) Released" href="http://danhaywood.com/2011/07/18/apache-isis-0-1-2-incubating-released/" data-mce-href="http://danhaywood.com/2011/07/18/apache-isis-0-1-2-incubating-released/">first release of Apache Isis</a> out of the door, I've been spending some time on <a title="Restful Objects" href="http://restfulobjects.org/" data-mce-href="http://restfulobjects.org/">Restful Objects</a>, which forms the basis of the <a title="Apache Isis JSON Viewer" href="http://incubator.apache.org/isis/viewer/json/index.html" data-mce-href="http://incubator.apache.org/isis/viewer/json/index.html">JSON viewer</a> within Isis.</p>
|
| <p>The idea of Restful Objects is to provide a standard, generic RESTful interface for domain object models, exposing representations of their structure using JSON and enabling interactions with domain object instances using HTTP GET, POST, PUT and DELETE.</p>
|
| <p><img class="mceWPmore mceItemNoResize" title="More..." src="http://danhaywood.wordpress.com/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" data-mce-src="http://danhaywood.wordpress.com/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" style="border-top-width: 1px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; border-style: initial; border-color: initial; border-top-style: dotted; border-top-color: #cccccc; display: block; width: 792px; height: 12px; margin-top: 15px; margin-right: auto; margin-bottom: 0px; margin-left: auto; background-image: url(http://danhaywood.wordpress.com/wp-includes/js/tinymce/plugins/wordpress/img/more_bug.gif); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; background-position: 100% 0%; background-repeat: no-repeat no-repeat; " />The <a title="Restful Objects" href="http://restfulobjects.org/" data-mce-href="http://restfulobjects.org/">Restful Objects</a> website is a place where the specification will be documented as it evolves, and if you take a look through the spec as it stands you may realize that it's very much based on the idea of a domain model as envisaged by naked objects. That is:</p>
|
| <ul>
|
| <li>the start page provides links to the set of registered services/repositories</li>
|
| <li>from these services, references to domain object instances can be obtained</li>
|
| <li>each domain object has properties, collections and actions</li>
|
| <li>the usual business rules (hiding, disabling and validating) are supported</li>
|
| <li>actions (idempotent or non-idempotent) can be invoked</li>
|
| </ul>
|
| <p>More generally, you'll see that all the representations are fully self-describing, opening up the possibility of generic viewers to be implemented if required, eg in languages such as HTML5/Ajax, Flex, Silverlight etc etc.</p>
|
| <p>Alternatively, the representations can be consumed directly by a bespoke application.</p>
|
| <p>One of the nice things about this specification is that it is completely language-independent. As you might expect, I'll be implementing this specification through the Isis JSON viewer, and using that implementation to refine the spec. In addition Richard Pawson is hoping to commit to working on a similar implementation for <a title="Naked Objects MVC" href="http://nakedobjects.net/" data-mce-href="http://nakedobjects.net">Naked Objects MVC</a> (he's a co-author on the Restful Objects site).</p>
|
| <p>And, if you know of or are the author of another naked objects-style framework, eg written in Ruby or Python, and the idea of Restful Objects interests you, then I'd love to hear from you.</p></span> |