<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>RESTful Exploration</title>
  <id>http://wwatson.me</id>
  <updated>2011-10-01</updated>
  <author>
    <name></name>
  </author>
  <entry>
    <title>HATEOAS as Pictures</title>
    <link rel="alternate" href="http://wwatson.me/2012/02/10/hateoas-as-pictures/"/>
    <id>http://wwatson.me/2012/02/10/hateoas-as-pictures/</id>
    <published>2012-02-10</published>
    <updated>2012-02-10</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;h1&gt;HATEOAS as State Machines&lt;/h1&gt;

&lt;p&gt;HATEOAS (Hypermedia As The Engine Of Application State) is an essential part of REST.  The &lt;strong&gt;application state&lt;/strong&gt; part leads some to explain REST and HATEOAS using state machines.  While this is technically correct, I really don&amp;rsquo;t like the idea of explaining REST as a state machine.  People&amp;rsquo;s eyes glaze over immediately when you merely &lt;em&gt;say&lt;/em&gt; state machine.  The argument roughly goes like this:&lt;/p&gt;
</summary>
    <content type="html">&lt;h1&gt;HATEOAS as State Machines&lt;/h1&gt;

&lt;p&gt;HATEOAS (Hypermedia As The Engine Of Application State) is an essential part of REST.  The &lt;strong&gt;application state&lt;/strong&gt; part leads some to explain REST and HATEOAS using state machines.  While this is technically correct, I really don&amp;rsquo;t like the idea of explaining REST as a state machine.  People&amp;rsquo;s eyes glaze over immediately when you merely &lt;em&gt;say&lt;/em&gt; state machine.  The argument roughly goes like this:&lt;/p&gt;

&lt;p&gt;1) If I make real applications with REST, then I must use state machines&lt;br/&gt;
2) I have made real applications without using state machines&lt;br/&gt;
3) Therefore I can make real applications without REST&lt;/p&gt;

&lt;p&gt;State machines seem to be looked at as impractical by many for design purposes.  While I don&amp;rsquo;t know if I agree with this statement, I think there is a need to explain things to people who hold the above argument.&lt;/p&gt;

&lt;h1&gt;HATEOAS as Pictures&lt;/h1&gt;

&lt;p&gt;Explaining HATEOAS as pictures seems more helpful to me.  Imagine taking a picture of a small college administrative office.  In the office there is a bunch of applications from students on the desk in the inbound folder.  Right next to the inbound folder there are two folders labeled outbound-accepted and outbound-rejected.  Also on the desk is an official course listing along with a rolodex labeled &amp;ldquo;Professors&amp;rdquo;.&lt;/p&gt;

&lt;p&gt;In that picture you have a significant amount of information about the college.  There is a small problem here though.  What can trigger the adding of a new application into an inbound or outbound folder?  That might be someone bringing in an application letter.  What is it that triggers a new rolodex entry?  Most likely a new professor joining the staff.  Even though we can envision these actions, it&amp;rsquo;s hard to see these events in pictures.&lt;/p&gt;

&lt;h1&gt;HATEOAS events&lt;/h1&gt;

&lt;p&gt;One simple thing you can do is ask yourself &amp;ldquo;What all could &lt;em&gt;cause&lt;/em&gt; a change in this picture?&amp;rdquo;, and list what you find.  Notice I said what can &lt;em&gt;cause&lt;/em&gt; a change, not what changes.  You already have everything that actually changes explicitly in the picture.&lt;/p&gt;

&lt;p&gt;Once you have a list of causes (or you could call these &amp;lsquo;events&amp;rsquo; or &amp;lsquo;transitions&amp;rsquo;) and a list of entities (you can call these &amp;lsquo;resources&amp;rsquo;) in the picture, you can start making a true RESTful API.  For every entity (resource) you&amp;rsquo;ll have a bunch of causes (transitions) that apply to it.  You can arrange these like so:
​&lt;/p&gt;

&lt;table style="horizontal-align:middle"class="table table-striped table-bordered table-condensed"&gt;
  &lt;tr&gt;
    &lt;th style="text-align:center"colspan="6"&gt;Event&lt;/th&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;th&gt;&lt;/th&gt;
    &lt;th&gt;&lt;/th&gt;    
    &lt;th&gt;New &lt;br&gt; Application&lt;/th&gt;    
    &lt;th&gt;New &lt;br&gt; Professor&lt;/th&gt;
    &lt;th&gt;Accept &lt;br&gt; Letter&lt;/th&gt;
    &lt;th&gt;Reject &lt;br&gt; Letter&lt;/th&gt;
  &lt;/tr&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style="vertical-align:middle" rowspan="5"&gt;&lt;b&gt;Entity&lt;/b&gt;&lt;/td&gt;
      &lt;td&gt;&lt;b&gt;Inbound Box&lt;/b&gt;&lt;/td&gt;
      &lt;td&gt;Inbound &lt;br&gt; Increased&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;
      &lt;td&gt;Inbound &lt;br&gt; Decreased&lt;/td&gt;     
      &lt;td&gt;Inbound &lt;br&gt; Decreased&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;     
      &lt;td&gt;&lt;b&gt;Outbound Box - Accepted&lt;/b&gt;&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;  
      &lt;td&gt;&lt;/td&gt;       
      &lt;td&gt;Outbound -&lt;br&gt; Accepted &lt;br&gt; Increased&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;     
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;b&gt;Outbound Box - Rejected&lt;/b&gt;&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;
      &lt;td&gt;Outbound -&lt;br&gt; Rejected &lt;br&gt; Increased&lt;/td&gt;     
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;b&gt;Rolodex&lt;/b&gt;&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;
      &lt;td&gt;Rolodex &lt;br&gt; Increased&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;  
      &lt;td&gt;&lt;/td&gt;            
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;


&lt;p&gt;Each column of that table is a picture.  For instance, after a new application event happens, the inbound box will have a certain look, so will the outbound boxes, and even the rolodex.  This is the case even though nothing but the inbound box can be affected by the new application event.  Those other entities continue to exist so this still makes for a coherent picture.&lt;/p&gt;

&lt;p&gt;All you have to do from here is transcribe your pictures into html and http.  How do we do this?  Well here is a representation of an inbox with the &amp;ldquo;new application&amp;rdquo;, &amp;ldquo;Accept Application&amp;rdquo;, and &amp;ldquo;Reject Application&amp;rdquo; events embedded inside of it:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;!-- Representing a list of college applications --&amp;gt;
&amp;lt;div id="Inbox"&amp;gt;
  &amp;lt;a rel="new-application" href="..." 
      title="Create new application"&amp;gt;New Application&amp;lt;/a&amp;gt;
  &amp;lt;ul class="all"&amp;gt;
    &amp;lt;li&amp;gt;
      &amp;lt;span class="student-application"&amp;gt;John Smith's application&amp;lt;/span&amp;gt;
      &amp;lt;a rel="accept" href="..." title="Reject John's application"&amp;gt;Accept&amp;lt;/a&amp;gt;
      &amp;lt;a rel="reject" href="..." title="Accept John's application"&amp;gt;Reject&amp;lt;/a&amp;gt;
    &amp;lt;/li&amp;gt;
    &amp;lt;li&amp;gt;
      &amp;lt;span class="student-application"&amp;gt;Jane Smith's application&amp;lt;/span&amp;gt;
      &amp;lt;a rel="accept" href="..." title="Reject Jane Smith's application"&amp;gt;Accept&amp;lt;/a&amp;gt;
      &amp;lt;a rel="reject" href="..." title="Accept Jane Smith's application"&amp;gt;Reject&amp;lt;/a&amp;gt;
    &amp;lt;/li&amp;gt;
  &amp;lt;/ul&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The above html represents the idea of a list of applications (the inbox), and what you can do with that list (the events affecting the inbox).  In this example you have the ability to add to the list (new application), or decrease the list (accepting or rejecting a list moves the application out of the inbox and into an outbox).  The entities translate into html blocks, while the events translate into link relations.&lt;/p&gt;

&lt;h1&gt;What does all of this mean?&lt;/h1&gt;

&lt;p&gt;It means you can design applications in many ways according to what you need.  It also means that there is no need to write REST off because it has a constraint that requires the use of state machines.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>REST and HTTP Part 6</title>
    <link rel="alternate" href="http://wwatson.me/2011/10/24/rest-and-http-part-6/"/>
    <id>http://wwatson.me/2011/10/24/rest-and-http-part-6/</id>
    <published>2011-10-24</published>
    <updated>2011-10-24</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;p&gt;If you&amp;rsquo;ve been following along so far, you&amp;rsquo;ll note that REST is &lt;strong&gt;not&lt;/strong&gt; HTTP.  It is also &lt;strong&gt;not&lt;/strong&gt; the verbs of HTTP (GET, PUT, POST, or DELETE).  You should know by now that REST contains the &lt;em&gt;principles&lt;/em&gt; that &lt;em&gt;guided&lt;/em&gt; HTTP.  REST helped the HTTP standard describe how a well defined web server should behave&amp;hellip;&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;If you&amp;rsquo;ve been following along so far, you&amp;rsquo;ll note that REST is &lt;strong&gt;not&lt;/strong&gt; HTTP.  It is also &lt;strong&gt;not&lt;/strong&gt; the verbs of HTTP (GET, PUT, POST, or DELETE).  You should know by now that REST contains the &lt;em&gt;principles&lt;/em&gt; that &lt;em&gt;guided&lt;/em&gt; HTTP.  REST helped the HTTP standard describe how a well defined web server should behave.&lt;/p&gt;

&lt;p&gt;The Fielding dissertation highlights how REST relates to HTTP mostly by way of its mismatches with HTTP.  REST was used to identify problems and to compare solutions to those problems according to the requirements of the web.  The early HTTP implementations were changed to more directly adhere to the REST architecture represented in the final HTTP 1.1 standard.&lt;/p&gt;

&lt;p&gt;Many of the problems with early HTTP outlined in the REST paper were due to a lack of self
describing messages.  If you recall from &lt;a href="/2011/10/13/rest-constraints-part-5/"&gt;our previous discussion&lt;/a&gt;, the requirement for messages to be self describing is one of the interface constraints within REST.&lt;/p&gt;

&lt;p&gt;There were several mismatches of REST with the early implementations of HTTP.  Early http lacked full URLs (with hostname), had no way to layer MIME types, and had no way to signal the end of a message.  It also conflated the parsing of headers with the parsing of header contents, had no content negotiation, could not differentiate authoritative from non-authoritative responses, and in some situations had problems with matching responses to requests altogether.  These were for the most part corrected in HTTP 1.1 which was standardized in 1996.&lt;/p&gt;

&lt;p&gt;In HTTP 1.1 however, there are still some mismatches.  URIs and cookies can and are abused to the point of obscuring messages.  Mandatory extensions for headers violate self descriptiveness as well.  Sometimes control data and other metadata can be intermingled.  MIME is also inefficient when describing the media-type because it was designed for mail not hypermedia.&lt;/p&gt;

&lt;p&gt;Nevertheless, REST helped HTTP become the primary protocol for web component communication and is unique in that it is designed specifically to manipulate resources via representation transfer.  REST redefined what a resource meant within the context of HTTP.  Sending representations, usually implemented in HTML, became the way to manipulate the resource on the remote server.  REST also helped HTTP avoid extensions that would limit HTTP&amp;rsquo;s scalability.  Some of these extensions where MGET/MHEAD, write (PUT) caching, various persistent connection solutions, and some http versioning solutions.  At the same time it helped guide other unimplemented solutions like using self describing messages to implement HTTP&amp;rsquo;s versioning scheme and the implementation of caching.&lt;/p&gt;

&lt;p&gt;&lt;img src="/images/RESTandHTTP.png" alt="Fielding Dissertation Overview" /&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>REST Constraints Part 5</title>
    <link rel="alternate" href="http://wwatson.me/2011/10/13/rest-constraints-part-5/"/>
    <id>http://wwatson.me/2011/10/13/rest-constraints-part-5/</id>
    <published>2011-10-13</published>
    <updated>2011-10-13</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;p&gt;Previously, we talked about the role of properties when evaluating architectures for &lt;a href="/2011/10/08/network-applications-part-3/"&gt;network-based applications&lt;/a&gt;.  We also talked about the paper&amp;rsquo;s working definition of architectural elements such as &lt;a href="/2011/10/05/architecture-methodology-part-2/"&gt;components&lt;/a&gt; along with the &lt;a href="/2011/10/10/web-requirements-part-4"&gt;requirements of the web&lt;/a&gt;.  Now we will use that knowledge to understand the paper&amp;rsquo;s definition of REST architecture as a set of constraints&amp;hellip;&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;Previously, we talked about the role of properties when evaluating architectures for &lt;a href="/2011/10/08/network-applications-part-3/"&gt;network-based applications&lt;/a&gt;.  We also talked about the paper&amp;rsquo;s working definition of architectural elements such as &lt;a href="/2011/10/05/architecture-methodology-part-2/"&gt;components&lt;/a&gt; along with the &lt;a href="/2011/10/10/web-requirements-part-4"&gt;requirements of the web&lt;/a&gt;.  Now we will use that knowledge to understand the paper&amp;rsquo;s definition of REST architecture as a set of constraints.&lt;/p&gt;

&lt;p&gt;According to the REST dissertation, a &lt;strong&gt;constraint&lt;/strong&gt; is a rule that induces one or more &lt;a href="http://en.wikipedia.org/wiki/Ilities"&gt;software architecture properties&lt;/a&gt;.  A group of constraints is called a style.  The REST style is a group of six major constraints that induce the various properties needed for the Web.  In order for an
architecture to be deemed a REST architecture, it &lt;em&gt;must&lt;/em&gt; satisfy all of these constraints.&lt;/p&gt;

&lt;p&gt;The first major constraint is the &lt;strong&gt;client-server constraint&lt;/strong&gt;.  The client-server constraint is based on a principle in software known as the &lt;em&gt;separation of concerns&lt;/em&gt;.  It simply requires the existence of a client component that sends requests and a server component that receives requests. After receiving a request the server may also issue a response to the client.  An example of the client-server constraint is the separation of the user interface of a banking application into a client from the request-handling logic which would reside on the bank&amp;rsquo;s servers.  The properties induced by the client-server constraint are portability, evolvability, and scalability.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;layered system constraint&lt;/strong&gt; defines a REST architecture as hierarchical layers of components, limited to communication with their immediate neighbors.  Similar to the client-server constraint, this constraint improves simplicity by separating concerns.  It also improves extensibility by using layers as a mechanism to isolate
legacy components.  Scalability is increased by providing the capacity for intermediary
components that act as caches or load balancers.  The trade off with this constraint is
reduced performance from the increased levels of indirection associated with multiple layers.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;stateless communication constraint&lt;/strong&gt; requires every request to contain all of the information needed to interpret that request.  This increases visibility, reliability, scalability, but also decreases performance because of the larger messages required for stateless communication.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;caching constraint&lt;/strong&gt; states that a REST architecture must have some mechanism for labeling messages as cacheable or non-cacheable.  This gives a client or intermediary
component permission to cache and reissue a message which increases efficiency, scalability, and performance.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;code on demand constraint&lt;/strong&gt; is an optional constraint.  Code on demand allows a client to download and execute code from a server.  This allows the client functionality to be extended after initial deployment of the application.  This has an effect on simplicity as well, because it promotes the reduced coupling of features.  Scalability is also increased by virtue of the server off-loading work onto the clients.  The trade off is the reduced visibility generated by the code itself, which is hard for an intermediary to interpret.  With this constraint being optional, the preferences of different organizations are served by allowing them the flexibility to deploy only when the trade-offs of deployment are worth it.&lt;/p&gt;

&lt;p&gt;At a high level the &lt;strong&gt;uniform interface constraint&lt;/strong&gt; basically means the interface for a component needs to be generic as possible.  This increases evolvability, simplicity, and visibility but has the side effect of reducing efficiency given the nature of generic data.  More specifically, the uniform interface constraint is defined by four interface sub-constraints, each of which warrant their own discussion.&lt;/p&gt;

&lt;h3&gt;Resources and Representations&lt;/h3&gt;

&lt;p&gt;In order to understand the interface sub-constraints, it is necessary to understand the idea of a resource.  The dissertation says a &lt;strong&gt;resource&lt;/strong&gt; is any information that can be named.  It also says a resource is a conceptual mapping to a set of entities.  In both cases a resource is always a &lt;em&gt;concept&lt;/em&gt;, never a concrete thing.  An example of a resource
is &lt;em&gt;the current weather in Austin, TX&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;representation&lt;/strong&gt; is a sequence of bytes and the description of those bytes.  Less formally, a representation is one form of a resource.  An example of a representation is &lt;em&gt;an html page with an embedded doppler radar PNG image of the current weather in Austin, TX&lt;/em&gt;.&lt;/p&gt;

&lt;h3&gt;Uniform Interface sub-constraints&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Resource identification&lt;/strong&gt; is one of the four interface constraints which basically requires the same authority whom maintains the reference to a resource to also be responsible for preserving meaning of that resource.  The idea here is the creator of a resource will be the best agent for naming that resource.  This promotes links to resources that don&amp;rsquo;t change over time even if the representations for those resources change.&lt;/p&gt;

&lt;p&gt;The second interface constraint states that &lt;strong&gt;resources must be manipulated via representations&lt;/strong&gt;.  A client has no access to a resource directly, it can only send and receive representations from the server.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;self descriptive message&lt;/strong&gt; is the third interface constraint.  It states all messages must include &lt;em&gt;metadata&lt;/em&gt; which describe the meaning of the message.  This means the methods used to invoke the message must be standard and agreeable between the client, the server, and the intermediaries in between.  This constraint is also related to the stateless
constraint in that no state on the server is permitted when interpreting a message.&lt;/p&gt;

&lt;p&gt;Hypermedia as the engine of application state, otherwise known as the &lt;strong&gt;hypermedia constraint&lt;/strong&gt;, is the last and probably most often overlooked constraint in the REST dissertation.  Simply put, the steps in a REST architecture must be invoked through &lt;a href="http://en.wikipedia.org/wiki/Hypermedia"&gt;hypermedia&lt;/a&gt;. More specifically, in order for an application&amp;rsquo;s process to move a step, it must invoke that next step from a reference inside the current representation.  The next step should &lt;em&gt;not&lt;/em&gt; be determined from somewhere outside of the currently received representation.  For example, if the current representation is an html document, the next legal steps would be links in that html document.&lt;/p&gt;

&lt;p&gt;The &lt;a href="/2011/10/24/rest-and-http-part-6"&gt;next article&lt;/a&gt; will talk more in depth about how these constraints relate to each other and how they are implemented in the HTTP protocol.&lt;/p&gt;

&lt;p&gt;&lt;img src="/images/RESTConstraints.png" alt="Fielding Dissertation Overview" /&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Web Requirements Part 4</title>
    <link rel="alternate" href="http://wwatson.me/2011/10/10/web-requirements-part-4/"/>
    <id>http://wwatson.me/2011/10/10/web-requirements-part-4/</id>
    <published>2011-10-10</published>
    <updated>2011-10-10</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;p&gt;The requirements of the web are on a different scale than any other application to date.  Even calling the web an
application sounds weird, because so many people use and contribute to it.  Even so, the Fielding dissertation calls&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;The requirements of the web are on a different scale than any other application to date.  Even calling the web an
application sounds weird, because so many people use and contribute to it.  Even so, the Fielding dissertation calls
the web the worlds largest distributed application.  As such, it has unique requirements for its domain.&lt;/p&gt;

&lt;p&gt;In addition to the broad &lt;a href="/2011/10/08/network-applications-part-3/"&gt;requirements&lt;/a&gt; needed by network applications, the Fielding dissertation brings attention to four key &lt;em&gt;domain-specific&lt;/em&gt; requirements for the web.  The web must have a &lt;strong&gt;low barrier of
entry&lt;/strong&gt; for newcomers, be extremely &lt;strong&gt;extensible&lt;/strong&gt;, support &lt;strong&gt;distributed hypermedia&lt;/strong&gt;, and be &lt;strong&gt;internet-scale&lt;/strong&gt;.  Any architecture designed for the web, such as REST, is designed to obtain these requirements by choosing the appropriate trade-offs accordingly.&lt;/p&gt;

&lt;p&gt;When it comes to the web it&amp;rsquo;s hard not to think of its large scale nature.  When you connect something as big as the web
into one unified system numerous challenges arise.  When thinking of the web as a whole, the enormous load of traffic stands out as an almost insurmountable challenge to software.  From the perspective of an individual software component, a  design that serves 50 simultaneous connections may work for some levels of popularity but most certainly not others.  A more subtle problem is the competing and sometimes political goals accompanying different organizations that want their underlying software to cooperate.  The web is a large decentralized authoring platform that must also allow for the various authors with different levels of trust to fail without breaking other parts of the system.  This is what the paper calls the internet-scale requirement.&lt;/p&gt;

&lt;p&gt;Loosely related to the internet-scale requirement is the requirement for extensibility.  With a large user and author
base, the desired content will change over time almost assuredly.  When the requirements change for some portion
of the system that portion will need to change without breaking everything else.&lt;/p&gt;

&lt;p&gt;A low barrier of entry was needed to increase adoption of the proposed HTTP standard.  The paper maintains that hypermedia was chosen because of its simple nature concerning authoring and its compatibility with search services.  Hypermedia could also be made to span multiple locations.  Having hypermedia&amp;rsquo;s controlling information, such as when to cache, in remote locations facilitated user-perceived performance and served the internet-scale requirement as well.  Given the relatively large size of distributed hypermedia messages, the web&amp;rsquo;s architecture needed to be designed for large, coarse grained messages.&lt;/p&gt;

&lt;p&gt;Using the network-based application and web requirements as the context, my &lt;a href="/2011/10/13/rest-constraints-part-5/"&gt;next article&lt;/a&gt; will finally review the REST architecture itself.&lt;/p&gt;

&lt;p&gt;&lt;img src="/images/WebRequirements.png" alt="web requirements" /&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Network Applications Part 3</title>
    <link rel="alternate" href="http://wwatson.me/2011/10/08/network-applications-part-3/"/>
    <id>http://wwatson.me/2011/10/08/network-applications-part-3/</id>
    <published>2011-10-08</published>
    <updated>2011-10-08</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;p&gt;If you have been following along in my previous articles about &lt;a href="http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm"&gt;Roy Fielding&amp;rsquo;s REST Dissertation&lt;/a&gt;, you should have a &lt;a href="/2011/10/01/rest-dissertation-overview-part-1/"&gt;very high level understanding&lt;/a&gt; of the paper as well as a grasp on his &lt;a href="/2011/10/05/architecture-methodology-part-2/"&gt;view of architecture&lt;/a&gt;.  In this article I&amp;rsquo;ll go over the paper&amp;rsquo;s concept of a network application while highlighting its unique challenges&amp;hellip;&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;If you have been following along in my previous articles about &lt;a href="http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm"&gt;Roy Fielding&amp;rsquo;s REST Dissertation&lt;/a&gt;, you should have a &lt;a href="/2011/10/01/rest-dissertation-overview-part-1/"&gt;very high level understanding&lt;/a&gt; of the paper as well as a grasp on his &lt;a href="/2011/10/05/architecture-methodology-part-2/"&gt;view of architecture&lt;/a&gt;.  In this article I&amp;rsquo;ll go over the paper&amp;rsquo;s concept of a network application while highlighting its unique challenges.&lt;/p&gt;

&lt;p&gt;Software is often given categorizations such as network software or application software.  The paper makes a clear distinction between those two types, and then denotes a third type of software.  &lt;a href="http://en.wikipedia.org/wiki/Application_layer"&gt;Network software&lt;/a&gt; is defined as any software that moves bits over a connection without knowing what those bits are.  &lt;a href="http://en.wikipedia.org/wiki/Application_software"&gt;Application software&lt;/a&gt;, on the other hand, takes into account the overall goals of a user.  A &lt;strong&gt;network-based application&lt;/strong&gt; would be software that takes into account the goals of a user &lt;em&gt;and&lt;/em&gt; is mindful of how its bits move over the network.  The REST dissertation concentrates on the network-based application domain.&lt;/p&gt;

&lt;p&gt;There are almost always consequences in the form of trade-offs (compromises) when obtaining an architectural property.  This characteristic makes architecture evaluation very elusive when coupled with a large number of desirable properties, as is the case with network-based applications.  There are twelve architectural properties that are used to compare trade-offs between architectural styles in the paper.  The following is a brief description of them.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/Computer_performance"&gt;Performance&lt;/a&gt;, particularly user-perceived performance, is revisited often throughout the paper.  Some of the most prominent constraints, e.g. &lt;a href="http://en.wikipedia.org/wiki/Stateless_server"&gt;statelessness&lt;/a&gt;, in the REST architecture were done for performance reasons.  Statelessness also addresses the problem of partial failure and &lt;a href="http://en.wikipedia.org/wiki/Reliability_engineering"&gt;reliability&lt;/a&gt;, which is a among the most &lt;a href="http://labs.oracle.com/techrep/1994/smli_tr-94-29.pdf"&gt;significant challenges&lt;/a&gt; in network based software.  &lt;a href="http://en.wikipedia.org/wiki/Scalability"&gt;Scalability&lt;/a&gt; is closely tied to performance in a network application because you want to be able to reap greater performance when adding more resources.  This is especially important when considering Internet-scale applications which can have unanticipated load.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/Separation_of_concerns"&gt;Simplicity&lt;/a&gt; and modifiability are needed to understand the application as a whole, and to be able to change it once it is deployed.  In a system that can be deployed to more than tens of thousands of servers, stopping the system in order to &lt;a href="http://www.esi.nl/publications/darwin/ercim2006.pdf"&gt;evolve&lt;/a&gt; or &lt;a href="http://en.wikipedia.org/wiki/Extensibility"&gt;extend&lt;/a&gt; it would be inefficient and probably futile.  With a large user-base, it&amp;rsquo;s more practical to let some users &lt;a href="http://www.lirmm.fr/~beniere/StageM2/tibermacine.pdf"&gt;customize&lt;/a&gt; a service on the client side.  Still others may need to &lt;a href="http://martinfowler.com/articles/injection.html#CodeOrConfigurationFiles"&gt;configure&lt;/a&gt; a server side component to point to a new sub-component.  Optimally, it is desirable for components to be &lt;a href="http://en.wikipedia.org/wiki/Reusability"&gt;reusable&lt;/a&gt; &lt;em&gt;without&lt;/em&gt; modification, in the same environment, for new purposes.  If the &lt;a href="http://en.wikipedia.org/wiki/JavaScript"&gt;code&lt;/a&gt; can be used in a &lt;em&gt;different&lt;/em&gt; environment, it is said to be &lt;a href="http://en.wikipedia.org/wiki/Software_portability"&gt;portable&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Visibility allows the application to play nice with the network.  With high visibility, &lt;a href="http://en.wikipedia.org/wiki/Squid_(software)"&gt;components&lt;/a&gt; can be made to assist with caching and therefore performance.  This is because the messages sent between components are easily accessible (hence visible) to intermediaries on the network.  Firewalls are network components that benefit from visibility in an application&amp;rsquo;s architecture by increasing security through inspection of messages.&lt;/p&gt;

&lt;p&gt;Together these properties form the basis for comparing network-based application architecture styles.  In the future I&amp;rsquo;ll revisit these properties individually while reviewing some of the more notable styles in the paper.  In my &lt;a href="/2011/10/10/web-requirements-part-4"&gt;next article&lt;/a&gt; we will take a look at the requirements for the web.&lt;/p&gt;

&lt;p&gt;&lt;img src="/images/NetworkApplications.png" alt="Fielding Dissertation Overview" /&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Architecture Methodology Part 2</title>
    <link rel="alternate" href="http://wwatson.me/2011/10/05/architecture-methodology-part-2/"/>
    <id>http://wwatson.me/2011/10/05/architecture-methodology-part-2/</id>
    <published>2011-10-05</published>
    <updated>2011-10-05</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;p&gt;In my previous &lt;a href="/2011/10/01/rest-dissertation-overview-part-1/"&gt;post&lt;/a&gt;, I gave a high level overview of Roy Fielding&amp;rsquo;s dissertation on Architectural Styles and the Design of Network-based Software Architectures (more commonly known as the REST thesis).  In the paper a heady definition of architecture is put forward in which it must, among other things, be a &lt;em&gt;run-time&lt;/em&gt; description.  An architecture is &lt;em&gt;not&lt;/em&gt; the organization of source code in text files.  It also is not what you wish your run-time to be.  It is a description of an actual application at run-time.  This is in contrast to a &lt;em&gt;style&lt;/em&gt; which is a group of &lt;em&gt;constraints&lt;/em&gt; that induce &lt;em&gt;properties&lt;/em&gt;.  Styles, constraints, and properties are used to give a novel description of &lt;em&gt;components&lt;/em&gt;.  Together these concepts are used to abstract away unneeded details while focusing on desired affects in a system.  I&amp;rsquo;ll try to lift some simplified definitions of these concepts from the paper and put them here&amp;hellip;&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;In my previous &lt;a href="/2011/10/01/rest-dissertation-overview-part-1/"&gt;post&lt;/a&gt;, I gave a high level overview of Roy Fielding&amp;rsquo;s dissertation on Architectural Styles and the Design of Network-based Software Architectures (more commonly known as the REST thesis).  In the paper a heady definition of architecture is put forward in which it must, among other things, be a &lt;em&gt;run-time&lt;/em&gt; description.  An architecture is &lt;em&gt;not&lt;/em&gt; the organization of source code in text files.  It also is not what you wish your run-time to be.  It is a description of an actual application at run-time.  This is in contrast to a &lt;em&gt;style&lt;/em&gt; which is a group of &lt;em&gt;constraints&lt;/em&gt; that induce &lt;em&gt;properties&lt;/em&gt;.  Styles, constraints, and properties are used to give a novel description of &lt;em&gt;components&lt;/em&gt;.  Together these concepts are used to abstract away unneeded details while focusing on desired affects in a system.  I&amp;rsquo;ll try to lift some simplified definitions of these concepts from the paper and put them here.&lt;/p&gt;

&lt;p&gt;In the paper&amp;rsquo;s methodology, &lt;em&gt;elements&lt;/em&gt; are comprised of &lt;strong&gt;components&lt;/strong&gt;, &lt;strong&gt;connectors&lt;/strong&gt;, and &lt;strong&gt;data&lt;/strong&gt;.  A component is simply a transformer of data.  A connector describes what glues the components together.  Data is transformed by components, and transferred through connectors.  If you are familiar with &lt;a href="http://en.wikipedia.org/wiki/Component_Object_Model"&gt;COM&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/Distributed_Component_Object_Model"&gt;DCOM&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/Corba"&gt;CORBA&lt;/a&gt;, or other component descriptions notice how the concept of data therein is usually absent or only vaguely described.  This has important implications if the data being transferred through the system has a significant impact on the system.  This fact is revisited throughout the paper specifically when talking about &lt;em&gt;self describing messages&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;An architectural &lt;strong&gt;style&lt;/strong&gt; is a grouping of constraints on elements (components/connectors/data) that induce properties.  A &lt;strong&gt;property&lt;/strong&gt; (also known as a quality or attribute) is a desirable (or tolerable level of an) &amp;lsquo;&lt;a href="http://en.wikipedia.org/wiki/List_of_system_quality_attributes"&gt;ility&lt;/a&gt;&amp;rsquo;.  Some examples of an ility would be extensibility, evolvability, or performance.  A &lt;strong&gt;constraint&lt;/strong&gt; produces a property in the system.  An example of a constraint would be adhering to the principle of separation of concerns, thereby separating the user interface from business logic, in order to increase maintainability, evolvability, and possibly &lt;a href="http://www.infoq.com/news/2011/10/GUI-Less-Windows"&gt;security&lt;/a&gt;.  A software engineer can take a style&amp;rsquo;s constraints along with their respective properties and compare them to a run-time to see if it matches.  A style can also be compared to other styles by using constraints and properties as a ubiquitous language to discuss architecture.  Comparing the design trade-offs makes explicit the hard choices between architecture styles.&lt;/p&gt;

&lt;p&gt;When focusing on a style (at least in a network application) it is useful to concentrate on one of three &lt;em&gt;views&lt;/em&gt; of that style.  A &lt;strong&gt;view&lt;/strong&gt; is a perspective of an implemented style.  A &lt;em&gt;processing&lt;/em&gt; or &lt;em&gt;component view&lt;/em&gt; would focus on how data is transformed in a component.  A &lt;em&gt;data view&lt;/em&gt; concentrates on the forms of data while abstracting away how and where the data is transformed.  A &lt;em&gt;connection view&lt;/em&gt; highlights &lt;a href="http://en.wikipedia.org/wiki/State_(computer_science)"&gt;state&lt;/a&gt; as well as interactions between components.&lt;/p&gt;

&lt;p&gt;In order to evaluate a design for any architecture you must first decide on the type of application (and therefore that application&amp;rsquo;s &lt;a href="http://en.wikipedia.org/wiki/Functional_requirement"&gt;functional requirements&lt;/a&gt;).  This limits the categories of architectures being considered.  For instance, a text file editor usually doesn&amp;rsquo;t need to be network aware and therefore doesn&amp;rsquo;t need a network based architecture.  After the application domain is determined, the &lt;a href="http://en.wikipedia.org/wiki/Ilities"&gt;non-functional requirements&lt;/a&gt; or properties need to be made explicit.  An example would be an application service that starts with 10 requests per second but is expected to grow to eventually receive 10000 hits per second.  This application would have a non-functional requirement of scalability.&lt;/p&gt;

&lt;p&gt;Each one of these concepts deserves its own article so I&amp;rsquo;ll revisit them later.  In my &lt;a href="/2011/10/08/network-applications-part-3/"&gt;next post&lt;/a&gt; I&amp;rsquo;ll go over the paper&amp;rsquo;s view on network applications and the implications of networks on software architecture.&lt;/p&gt;

&lt;p&gt;&lt;img src="/images/SoftwareArchitectureMethodology.png" alt="Fielding Dissertation Overview" /&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>REST Dissertation Overview Part 1</title>
    <link rel="alternate" href="http://wwatson.me/2011/10/01/rest-dissertation-overview-part-1/"/>
    <id>http://wwatson.me/2011/10/01/rest-dissertation-overview-part-1/</id>
    <published>2011-10-01</published>
    <updated>2011-10-01</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;p&gt;Roy Fielding&amp;rsquo;s dissertation &amp;ldquo;&lt;a href="http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm"&gt;Architectural Styles and the Design of Network-based Software Architectures&lt;/a&gt;&amp;rdquo; is one of the most often referenced (but not-so-often read) technical papers concerning software in recent years.  Saying the content in the paper is influential is an understatement, because it is the underlying motivation for the &lt;a href="http://en.wikipedia.org/wiki/Http"&gt;HTTP protocol&lt;/a&gt; and the web itself.  The one thing I have not seen while perusing books or blogs about RESTful services is a break down of the &lt;em&gt;actual dissertation&lt;/em&gt;.  I&amp;rsquo;ve therefore decided to focus some time on re-reading the paper while making &lt;a href="http://en.wikipedia.org/wiki/Mind_map"&gt;mind maps&lt;/a&gt; to help me improve my understanding of it&amp;hellip;&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;Roy Fielding&amp;rsquo;s dissertation &amp;ldquo;&lt;a href="http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm"&gt;Architectural Styles and the Design of Network-based Software Architectures&lt;/a&gt;&amp;rdquo; is one of the most often referenced (but not-so-often read) technical papers concerning software in recent years.  Saying the content in the paper is influential is an understatement, because it is the underlying motivation for the &lt;a href="http://en.wikipedia.org/wiki/Http"&gt;HTTP protocol&lt;/a&gt; and the web itself.  The one thing I have not seen while perusing books or blogs about RESTful services is a break down of the &lt;em&gt;actual dissertation&lt;/em&gt;.  I&amp;rsquo;ve therefore decided to focus some time on re-reading the paper while making &lt;a href="http://en.wikipedia.org/wiki/Mind_map"&gt;mind maps&lt;/a&gt; to help me improve my understanding of it.&lt;/p&gt;

&lt;p&gt;My goal is to dissect the &lt;em&gt;whole&lt;/em&gt; paper, not just the parts about REST, in a way understandable to programmers with about 5 years of experience.  One thing that stands out in the paper is that it&amp;rsquo;s mostly about architecture.  This is interesting to me because I have rarely seen this talked about in the REST blogs.  There could very well be something we are missing in the paper that would help shed light on the &lt;em&gt;why&lt;/em&gt; and &lt;em&gt;when&lt;/em&gt; (to use) of REST.&lt;/p&gt;

&lt;p&gt;At a high level, Roy Fielding surveys the state of the art in software architectur