<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>WOA</title><link>http://hinchcliffe.org/category/12.aspx</link><description>WOA</description><managingEditor>Dion Hinchcliffe</managingEditor><dc:language>en-US</dc:language><generator>.Text Version 0.95.2004.102</generator><item><dc:creator>Dion Hinchcliffe</dc:creator><title>12 Things You Should Know About REST and WOA</title><link>http://hinchcliffe.org/archive/2008/04/08/16627.aspx</link><pubDate>Tue, 08 Apr 2008 09:41:00 GMT</pubDate><guid>http://hinchcliffe.org/archive/2008/04/08/16627.aspx</guid><wfw:comment>http://hinchcliffe.org/comments/16627.aspx</wfw:comment><comments>http://hinchcliffe.org/archive/2008/04/08/16627.aspx#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://hinchcliffe.org/comments/commentRss/16627.aspx</wfw:commentRss><trackback:ping>http://hinchcliffe.org/services/trackbacks/16627.aspx</trackback:ping><description>&lt;p&gt;There have been a number of interesting tracts written lately about that increasingly popular topic in the world of SOA and Web services: &lt;a title="" href="http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm" &gt;REST&lt;/a&gt;.  In particular, the one that is circulating around social bookmarking sites and SOA blogs the most in the last month is Stefan Tilkov's excellent &lt;a href="http://www.infoq.com/articles/tilkov-rest-doubts"&gt;Addressing Doubts about REST&lt;/a&gt;.  The article tackles the continuing skepticism that SOA practioners have had about the integration approach that has become the dominant one on the Web and is now making significant inroads in the enterprise (more on my findings on enterprise adoption of REST here soon).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Key SOA Trend:&lt;/strong&gt; As of March 2008, leading industry analysts -- such as &lt;a href="http://apsblog.burtongroup.com/2008/03/looking-for-soa.html"&gt;Anne Thomas Manes&lt;/a&gt; -- &lt;a href="http://blogs.zdnet.com/service-oriented/?p=1075"&gt;are concluding that &lt;/a&gt; "SOA is not working in most organizations."&lt;/p&gt;
&lt;p&gt;Compellingly, Stefan goes far beyond the simple and often misleading &lt;a title="" href="http://www.w3.org/TR/soap/" &gt;SOAP&lt;/a&gt; vs. REST debates and makes a number of excellent points about the REST approach ranging from encapsulation and transaction boundaries to documentation and tool support.  But what struck me most is that these largely technical concerns, while very important, still don't strike directly to the heart of what makes REST, and &lt;a href="http://hinchcliffe.org/archive/2008/02/27/16617.aspx"&gt;Web-Oriented Architecture&lt;/a&gt; in general, so significant to the practice of effective large scale software integration and composition.  Specifically, the more I look at working examples of large scale SOA on the Web, the more I'm aware of the fundamentally different mindset and approach that are used by those that have an urgent business need to achieve deep levels of integration between many customers and trading partners.&lt;/p&gt;
&lt;p style="text-align:center;"&gt;&lt;img alt="Integration Models in Software - Structured, Object-Oriented, Service-Oriented (SOA), and Web-Oriented (WOA)" title="Integration Models in Software - Structured, Object-Oriented, Service-Oriented (SOA), and Web-Oriented (WOA)" src="http://hinchcliffe.org/img/integration-software-models.png"/&gt;&lt;/p&gt;
&lt;p&gt;So what are the big differences between traditional SOAP-based, top-down SOA and lightweight, bottom-up WOA?  In the end, it's as much architectural and philosophical as it is technical.  I'll also be clear and note that while successful large-scale SOA on the Web tends to favor REST, REST drives many of the concepts described below, rather than promoting them explicitly.  In other words, REST resides at the core of Web-Oriented Architecture, which in turn describes a set of related approaches for creating a robust and bustling network ecosystem of loosely cooperating entities that typically compete for consumption via "architecture of the fittest."  Here are some of the key things we've learned over the last half-decade that REST has been used widely to build WOAs:&lt;/p&gt;
&lt;h2&gt;12 Things You Should Know About REST and WOA&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;REST posits an interconnected information ecosystem, not an isolated set of point Web services.&lt;/strong&gt; REST services are (usually) XML resources that are deeply linked together using URIs (via connectors in REST parlance) into a tapestry thousands and thousands of other Web resources.  This is the model used by the Web itself, which uses the same model (thousand and thousands of HTML resources deeply linked with URLs).  The key concept here is that REST resources can be linked with other Web resources made by the same, or entirely different, providers.  If you build a REST Web service and publish it, it's highly likely that in a short while you'll be a referenced resource in another REST service.  While this sort of data transparency seems in direct opposition to widely cherished beliefs in the software development community around concepts like encapsulation and separation of implementation from interface (aka &lt;a href="http://en.wikipedia.org/wiki/Information_hiding"&gt;information hiding&lt;/a&gt;), it turns out that the "side effects" of this kind of transparent information architecture are many, varied, and usually highly desirable.  The Web has taught us that publicly visible deep links are enormously important to system architecture, even as important as the data itself, enabling vital scenarios like discovery, search, analytics, transparency, participation, increased consumption, high levels of scalability, and well, robust ecosystems of participating components that can openly consume (and sometimes operate) on this data.  As a final note, REST services can in fact still completely separate interface and implementation while at the same time prescribing a specific set of interaction scenarios.&lt;/li&gt;
&lt;li&gt;&lt;div style="
  border: solid 1px #000;
  background-color: #FAF8CC;
  margin-left: 10px;
  margin-top; 5px;
  width: 210px;
  font-size: 1.3em;
  padding-right: 5px; 
  padding-bottom: 10px;
  padding-left: 9px;
  padding-top: 5px;
  float: right;"&gt;&lt;em&gt;"...the interconnected galaxy of data itself is now the central construct that is consumed and operated upon by network components."&lt;/em&gt;
&lt;/div&gt;
&lt;strong&gt;A focus on &lt;em&gt;Design for Consumption&lt;/em&gt; instead of &lt;em&gt;Design for Integration&lt;/em&gt;.&lt;/strong&gt; While some SOA traditionalists might disagree, there is a tendency to focus excessively on the imaginary integration point, or seams, of an SOA using the traditional &lt;a href="http://en.wikipedia.org/wiki/WS-I_Basic_Profile"&gt;WS-I Basic Profile&lt;/a&gt; world and I've had long conversations in the SOA community about tools for schema conversion, data translation and mapping, and other complicated scenarios to make two endpoints talk effectively.  In this view, both sides of the conversation must have the same exact lens on how to approach the integration process, or agree to disagree.  I've called this the "tyranny of SOAP's mustUnderstand flag" and this, combined with the fact that you almost always had to have the same programming language and Web service toolkit at the exact same revisions on each side of the conversation, it results in practice in surprisingly low levels of practical interoperability.  Traditional SOA is designed, by intent, to diverge and fragment both because of the design of SOAP but also the proliferation of dozens of heavyweight WS-* standards that put a very heavy consumption tax on the conversation.  The XML Schemas (or XSD) used in &lt;a title="" href="http://www.w3.org/TR/wsdl" &gt;WSDL&lt;/a&gt; have also turned out to be a rather poor choice for meaningful descriptions of information that pass across integration points.  This is in sharp relief to the world of REST and WOA where extremely simple standards ensure that whatever programming language and toolkit is being used, as long as it can process simple HTTP and XML, can interoperate quickly and easily while referencing the services API documentation.  In other words, WOA enables integration between anything that can process the Web while SOA enables integration only between the (increasingly rarified) stacks standards and protocols that a given traditional Web service endpoint supports.  Thus REST posits a world of integrating entities containing an almost infinite diversity in participants that couple well and scale best because of extreme simplicity and very low barriers to consumption.  In contrast, there are only a handful of SOA toolkits that have the levels of sophistication to handle the fuller vision of heavyweight SOA, and unless you're using them, you can't come to their party.  Finally, another way to look at this is that REST is near the top of the &lt;a href="http://web2.socialcomputingmagazine.com/tolerance_and_experience_continuums.htm"&gt;tolerance continuum&lt;/a&gt; and thus will always be significantly more open, inclusive, and egalitarian from a consumption perspective.  If maximizing opportunities for integration is your goal, the right approach for you should be clear.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;REST security is egalitarian and is as secure as the Web itself.&lt;/strong&gt; Some theorists will raise the concern that using protocols such as HTTPS to secure REST is like using a single blunt instrument to solve a delicate and sophisticated set of problems.  In practice, the protocol that has successfully protected the majority of e-commerce transactions on the Web is good enough for most applications.  If different or more sophisticated means are needed, you can enable them as well, but it's clear that the large SOA practitioners on the Web are &lt;em&gt;not&lt;/em&gt; adopting standards like WS-Security.  For example, Amazon's popular &lt;a href="http://www.amazon.com/S3-AWS-home-page-Money/b/ref=sc_fe_l_2?ie=UTF8&amp;node=16427261&amp;no=3440661&amp;me=A36L942TSJ2AJA"&gt;S3 service&lt;/a&gt; uses simple, straightforward &lt;a href="http://www.ietf.org/rfc/rfc2104.txt"&gt;HMAC-SHA1 signatures&lt;/a&gt; to handle the authentication of each and every request to its REST API.  Balancing security with ease of consumption requires a careful tightrope walk when it comes to successful software integration and the security solutions for Web services being using on a large scale today are &lt;em&gt;not&lt;/em&gt; the ones we expected 5 years ago.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Service interaction directly by the client is a first class citizen in WOA.&lt;/strong&gt;  You might be reading this and thinking it's a no-brainer.  But client consumption is a surprisingly slippery subject in the world of traditional SOA.  For one thing, many SOA architects still refrain from thinking of the application client as a place where services are consumed directly, at least as a primary architectural concern.  The client in this view can be the browser, mobile device, native application, or whatever is being used.  However, the rise of rich user interfaces as well as the &lt;a href="http://blogs.zdnet.com/Hinchcliffe/?p=106"&gt;mashup software development model&lt;/a&gt; has driven the requirement for many Web services to be accessible directly from the client as a first order design concern.  However, this is where traditional SOA has had significant issues.  SOAP, the fundamental SOA protocol, does not have direct support in any of today's Web browsers making direct consumption problematic for even simple SOA services, and quite difficult for WS-* style services.  Even worse, the &lt;a href="http://hinchcliffe.org/archive/2007/12/23/16592.aspx"&gt;latest new rich Internet application platforms&lt;/a&gt; such as Adobe's Flex, which are have become true software development environments in their own right , often have surprisingly poor support even for such important standards as XML.  That's not to say that adapters, bridges, proxies, and other solutions can't be applied to existing SOAs to project them into the client erna.  But all of these bring their own architectural tradeoffs and needless (and expensive) complexity including more layers of data mapping, translation, and run-time performance.  Like other fundamental protocols such as RSS and ATOM, which are directly consumable by virtually all clients today, the very best SOAs make service consumption by the client a first class citizen and its services highly consumable in any rich Internet application, Web mashup, mobile device, or from wherever it needs to be accessed.  This is key aspect of WOA's Design for Consumption, like &lt;a href="http://en.wikipedia.org/wiki/Design_for_manufacturability"&gt;Design for Manufacturing&lt;/a&gt; did for a generation of engineering processes and directly enables many important new scenarios we are looking for in software integration and composition today.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Service contracts are simpler and suppler in a REST model.&lt;/strong&gt; Coming from a formal software engineering background, I myself was on the fence on whether the lack of a traditional interface contract actually inhibits the high volume consumption of REST services, which as we've discussed, is supposed to be one of its great strengths.  This is one area where traditional SOA appears strong on its face, using WSDL to describe and elaborate on the precise nature of the methods, structures and data types being passed back over the integration point.  While the topic of the &lt;a href="http://hinchcliffe.org/archive/2005/05/10/215.aspx"&gt;impedance between most programming languages and service contract formats&lt;/a&gt; is beyond the scope of this discussion, suffice to say that we've learned over time that WSDL generally encourages tools to be &lt;em&gt;far too finicky&lt;/em&gt; about a service contract and tends to create a brittleness that doesn't need to be there.  I've &lt;a href="http://hinchcliffe.org/archive/2006/08/05/8489.aspx"&gt;written about&lt;/a&gt; minimal surface area dependencies for Web services before and it turns out that the everyday pragmatic consumption of REST is just not hindered by lack of machine readable contracts.  For a variety of reasons, this tends to encourage a dependency on just the parts of the service begin used, and not the entire service.  While the formal computer science crowd will have concerns about building reliable systems on top of services that change over time and lack formalized, machine consumable contracts, the reality is that in an environment that increasingly seems to be heading for a much higher number of informal services produced by a much higher number of sources, the lack of formal contracts is increasingly a feature.  In fact, &lt;em&gt;contract by example&lt;/em&gt; is sufficient for most applications, although mature offerings meant for transactional use do tend to have a formal API description, just not always machine readable.  The early industry SOA assumption that most users of Web services would only consume them when aided by sophisticated tools has not been borne out on the Web.  In fact, the world of ad hoc integration via mashups has further shown this not to be an issue.  However, solutions such as WADL &lt;a href="http://www.infoq.com/news/2007/03/WADL"&gt;seem to be gaining currency&lt;/a&gt; when you absolutely need a contract for a REST service, though most developers I know using REST are more than content to just interact with the service itself or use a wrapper library that is provided by the service creator or the community that's grown around the SOA or API itself.&lt;br/&gt;&lt;br/&gt;&lt;a href="http://hinchcliffe.org/archive/2005/06/06/308.aspx"&gt;&lt;img border="0" alt="Checking a Web service contract before invocation" title="Checking a Web service contract before invocation" src="http://hinchcliffe.org/img/sim.jpg"/&gt;&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;&lt;div style="text-align:center;"&gt;&lt;strong&gt;Figure 1: All Web services and REST resources have a contract, implicit or explicit.&lt;/strong&gt;&lt;/div&gt;&lt;br/&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;REST strongly complements traditional SOA, if you must have it.&lt;/strong&gt;  Though increasingly, you don't have to have it.  REST generally has much better consumption scenarios, is faster, more reliable, and more likely to be usable by those on the other end of the network conversation.  Wrapping SOAP and other SOA-style services in REST is a workable solution, depending on what you're doing.  Heavyweight service-orientation is at the bottom of the tolerance continuum and can make sense of a specific set of requirements, but chances are that REST will give you most flexibility, options, and uptake.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;REST and WOA enables and does not violate the principles of service-orientation.&lt;/strong&gt; Thomas Erl, one of the leading SOA thinkers in the industry, has identified &lt;a href="http://www.soaprinciples.com/p3.asp"&gt;eight principles of service-orientation&lt;/a&gt; that are generally agnostic of the technology used to implement a SOA while directly supporting the reported benefits of a workable service-oriented approach including easier interoperability, high levels of reuse, more flexibility in design, and so on.  These principles include &lt;em&gt;abstraction&lt;/em&gt;, &lt;em&gt;loose-coupling&lt;/em&gt;, &lt;em&gt;service-contract&lt;/em&gt;, &lt;em&gt;reusability&lt;/em&gt;, &lt;em&gt;autonomy&lt;/em&gt;, &lt;em&gt;statelessness&lt;/em&gt;, &lt;em&gt;discoverability&lt;/em&gt;, and &lt;em&gt;composability&lt;/em&gt;.  All SOA implementations tend to comply with or violate these principles to a varying degree either intentionally or unintentionally depending on their requirements and other vagaries.  In this way, each SOA implementation has countless accumulated design decisions built into it that embody the architects', implementors', and vendors' net assumptions for the best way to realize the services that comprise that SOA.  REST and WOA bring their own unique emphasis around what important in a service landscape, but critically, these do not violate a single of the essential architectural principles of service-orientation and often enables them unique and powerful ways.  I'll explore these individually as I am able in upcoming posts since the statelessness and service-contract principles are very interesting areas for many SOA implementors to understand in a REST world.&lt;/li&gt;
&lt;li&gt;&lt;div style="
  border: solid 1px #000;
  background-color: #FAF8CC;
  margin-left: 10px;
  margin-right; 5px;
  margin-top; 5px;
  width: 210px;
  font-size: 1.3em;
  padding-top: 5px;
  padding-right: 5px; 
  padding-bottom: 10px;
  padding-left: 9px;
  float: right;"&gt;&lt;strong&gt;Industry Perspective&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;Enterprise IT and SOA experts David Linthicum and Dana Gardner have recently weighed in on WOA on both &lt;a href="http://weblog.infoworld.com/realworldsoa/archives/2008/04/woa_vs_soa.html"&gt;Infoworld&lt;/a&gt; and &lt;a href="http://blogs.zdnet.com/Gardner/?p=2631"&gt;ZDNet&lt;/a&gt;.
&lt;/div&gt;&lt;strong&gt;We have reached a possibly final state of deconstruction between data and function. &lt;/strong&gt;  I only say final since the Web is increasingly having the last word when it comes to the largest and most successful examples of just about any type of system you can describe and we don't see anything emerging beyond it.  And Web has an intrinsic model that is exerting a &lt;a href="http://web2.socialcomputingmagazine.com/hackingwebnetworkeffect.htm"&gt;network effect&lt;/a&gt; of its very own; if one builds something now that doesn't align closely with the grain of the Web then it will get largely sidelined until it is somehow woven into it.  In other words, build a Web service that's not Web-oriented and chances are good it will stagnate.  But build one that's Web-oriented and thousands of people will likely beat a path to your door (there are &lt;a href="http://web2.socialcomputingmagazine.com/running_an_online_business_profitably_in_the_web_20_era.htm"&gt;other success factors here of course&lt;/a&gt;, such as having best in class data).  But there's a very big discussion lurking here with the essential idea is that we've nearly come full circle from the days of object-orientation where objects were code that was very tightly coupled to the data it operated upon.  At the time, it was an architectural concept, not just for local information hiding.  We moved from there to distributed stateful objects, then distributed stateless objects, then components, network services, and many other models.  Services and code, however, tended to have the upper hand overall and mostly stood in front of the data or the database.  But we've undergone a thorough inversion of this model because of &lt;a href="http://web2.socialcomputingmagazine.com/the_web_20_zeitgeist_2006_edition.htm"&gt;the growth of Web architecture&lt;/a&gt; and the interconnected galaxy of data itself is now the central construct that is consumed and operated upon by network components (code running on servers and clients).  This is a very different worldview that we have had in most of the traditional software industry, but the Web itself has essentially trumped the conversation and provided us with what appears to be the most workable model yet for the architecture of highly federated systems and composite applications.  And this new lens is very Web-oriented.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;REST drives WOA but WOA extends beyond REST.&lt;/strong&gt;  I realize that WOA isn't a fully accepted industry term yet, but I do favorite it to terms like &lt;a href="http://alexbarnett.net/blog/archive/2006/11/04/REST-Web-Services-and-ROA.aspx"&gt;resource-oriented architecture (ROA)&lt;/a&gt;.  WOA does indeed start with REST but also encompasses and intentionally extends into other, closely related models for designing and distributing composite systems and services.  A good example is the rise of the Web widget as one of the newer and more interesting "component models" for enabling distribution and consumption of REST-based services.  The &lt;a href="http://code.google.com/apis/maps/"&gt;Google Maps widget&lt;/a&gt; is one pre-eminent example of how WOA goes well beyond simple REST and describes a complete and integrated "package" for a WOA capability that offers an open API via Javascript which provides deep access to remote Web services.  All this and it's also in a nice and clean browser-side API that even includes best-of-breed visual functionality.  In this architectural worldview, you take a much broader perspective on opening up and offering services that provides delivery all the way to the "last inch" and gives developers data and functionality in a format that allows an SOA to be consumed in the simplest and lowest barrier fashion.  The reward for Google has been one of the highest rates of uptake within 3rd party composite Web applications (aka mashups) of any API on the Web.  The SOA model here is infused with the latest open Web-based user interface approaches to the degree that even a default presentation reference model, ready for production, is included as part of the SDK.  That's as a complete, holistic, and pragmatic a view of SOA as you're likely to see since the most useful and productive consumption models in service interaction are emphasized while at the same time tightly aligning with the architectural and application model of the Web.  This is what WOA at its finest can represent.  Off the shelf WOA components like this are springing up and being used all over the Web (tens of thousands of them can be found on &lt;a href="http://widgetbox.com"&gt;Widgetbox&lt;/a&gt; and the &lt;a href="http://www.google.com/ig/directory?synd=open"&gt;Google Gadgets directory&lt;/a&gt;), but are very hard to find in a traditional SOA environment.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;REST is deeply infused into the fabric of the Web today.&lt;/strong&gt;  Not only is every single hosted Web page presently in existence already a read-only REST Web service (in REST parlance, transferring the representation of the state of the page via HTTP using the GET verb), but the latest and most influential Web standards, such as the highly regarded Atom Publishing Protocol, are inherently REST-based as well.  Thus the overwhelming majority of pure data Web services on the Web today are REST-based, particularly the several hundred million RSS endpoints that are currently live right now.  I've heard multiple times the story of how an enterprise switched from SOAP-based services to open syndication models for example, because many more tools support simple data pulls over HTTP, never mind the other advantages we've already seen above.  We are just not seeing that sort of organic uptake and pervasive adoption with traditional SOA technologies.  That is not only because of the aforementioned network effect but it also takes into account the very important lessons that we've learned from the Web.  And one paramount lesson, as we'll see, is not controlling the other side of the conversation, which is one the last big pieces of the WOA picture.  Which is....&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;REST enables an inversion of control that drives adoption and integration.&lt;/strong&gt;  This is somewhat similar to the &lt;a href="http://hinchcliffe.org/archive/2005/02/24/183.aspx"&gt;inversion of control&lt;/a&gt; we see in things like dependency injection, in that the more direct control we give up over the integration process, the most integration we get because we've enabled the scenarios for it out in the "cloud" of the network.  In a very similar way that the hyperlink itself -- and the URI in REST -- allows anyone external to the linked resource to connect information together, without a finger being lifted by the originating resource, the REST model allows what some call outside-in integration with the potential of almost entirely allowing integration to happen entirely external to the integrated system.  While you might be thinking that surely our SOA approaches up until now have enabled this, the practice has been creating an escalating stairway of barriers to hurdle:  You must process all protocols layered in the SOAP envelope to participate, you must have a contract in WSDL, there's a strong preference for information in XML, you should use the same programming language/platform as the service provider to avoid translation bugs, and so on.  These and many other requirements impose a great deal of unnecessary control on both sides of the conversation but particularly on the consumption side.  We seem to be learning that the very best models for integration impose as little control as possible.  REST informs us that we must have a common representation of state, but it could be XML, or JSON, or images, or video.  But beyond that, we are not constrained as long as the representation will fit over HTTP.  And in this way, control over integration is inverted to the consumer of the service, who can engage in a thousand new scenarios not possible when all the aforementioned constraints are made.  REST can set Web sites, businesses, applications, and every other silo you imagine as free as we know how to do it.  As simple as possible, but no simpler and thus the network can integrate itself and we can achieve the advantages of pull instead of push, fluidity instead of impedance, a bazaar of consumption instead of a cathedral of integration.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;REST and WOA can handle systems of arbitrary complexity and size.&lt;/strong&gt; The systems built today from Amazon's Web services and many others show that hundreds of thousands of customers can integrate effectively and operate simultaneous on the &lt;a href="http://web2.socialcomputingmagazine.com/is_web_20_the_global_soa.htm"&gt;Global SOA&lt;/a&gt; and run their businesses using REST and WOA.  This is the "my Web site is bigger than your enterprise" realization that is making enterprises look hard at what's actually working on the greater Web.  REST and WOA are not just ready for prime-time, they &lt;em&gt;are&lt;/em&gt; prime-time.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;There are literally dozens of models for building services to connect systems together.  However, HTTP is at the core of many of the more promising ones, including REST.  Here's &lt;a href="http://web2.socialcomputingmagazine.com/creating_open_service_apisthat_last_and_anyone_can_use.htm"&gt;an overview of the most common service models&lt;/a&gt; for SOA today.&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;However, many readers of this article are doubtless still wondering if REST and WOA are really the end-all, be-all for service-oriented architectures.  For now, we're seeing it as one of the best available options despite a great deal of work yet to figure out how to apply it fully to the world of the enterprise.  Is it ideal for every single type of application and scenario?  Of course not. Your mileage will vary entirely depending on your requirements and your understanding of how REST deeply informs system architecture.  However, it's increasingly emerging on the short list for those integrating systems of even the very largest size and complexity as well as down to the simplest and most nimble application.  We've also learned a lot about the strengths and its weaknesses of this Web services model, however, as a fundamental part of the Web (since REST is nothing more than HTTP applied to data), REST along with WOA is the model that underpins many of the largest and most successful networks (and SOAs) in history.&lt;/p&gt;
&lt;p&gt;Finally, I'll be &lt;a href="https://www1.gotomeeting.com/register/773770787"&gt;delivering a complimentary Webinar&lt;/a&gt; on this subject matter next week, on Thursday, April 17th, to present the full scope of WOA and how it can be used to drive adoption, better business outcomes, and make SOA work in the enterprise.  I do hope you attend.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;What are your concerns? What do you think REST is capable or incapable of doing for your applications.  Please share your story below in comments.&lt;/em&gt;&lt;/p&gt;
&lt;p style="text-align:center;"&gt;&lt;a href="https://www1.gotomeeting.com/register/773770787"&gt;&lt;img border="0" src="http://hinchcliffe.org/img/soa_webinar_graphic_ad.png"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src ="http://hinchcliffe.org/aggbug/16627.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Dion Hinchcliffe</dc:creator><title>What Is WOA? It's The Future of Service-Oriented Architecture (SOA)</title><link>http://hinchcliffe.org/archive/2008/02/27/16617.aspx</link><pubDate>Wed, 27 Feb 2008 21:37:00 GMT</pubDate><guid>http://hinchcliffe.org/archive/2008/02/27/16617.aspx</guid><wfw:comment>http://hinchcliffe.org/comments/16617.aspx</wfw:comment><comments>http://hinchcliffe.org/archive/2008/02/27/16617.aspx#Feedback</comments><slash:comments>7</slash:comments><wfw:commentRss>http://hinchcliffe.org/comments/commentRss/16617.aspx</wfw:commentRss><trackback:ping>http://hinchcliffe.org/services/trackbacks/16617.aspx</trackback:ping><description>&lt;p&gt;The need for businesses to open up their silos of information and internal capabilities to their internal customers has become an &lt;a href="http://blogs.zdnet.com/Hinchcliffe/?p=77"&gt;increasingly pressing issue&lt;/a&gt; as organizations strive to increase operational efficiencies and innovate more effectively with existing resources in the business and technical climate of early 2008.  And in the last couple of years, as exposing uniquely powerful sets of data to online business partners has moved into the mainstream in the form of &lt;a href="http://hinchcliffe.org/archive/2008/01/10/16613.aspx"&gt;open Web APIs&lt;/a&gt;, opening up our IT systems across the Internet has become a competitive imperative as well.  Unfortunately, despite two decades of experiments in heavyweight software engineering (the alphabet soup of EAI, SOA, ESB) for solving these types integration problems, we've seen relatively marginal improvements for most implementors despite heavy investments by businesses large and small.  In short, integration between the systems running our business still isn't happening at the levels we need.  However in the last several years, promising developments from the Web are pointing a way to a better model that seems to overcome many of the adoption and effectiveness issues of traditional SOA and is gaining wider adoption yearly (&lt;em&gt;see sidebar below, right&lt;/em&gt;).&lt;p&gt;

&lt;p&gt;Most of us would agree that we still can't easily get access to the data and the systems we need to in order to get our daily work done.  Workers still spend a great deal of time copying and pasting data between their various applications, data is batched and then exported and imported between IT systems around the world millions of times per day, and information just isn't getting to the places that we want it to without unacceptable amounts of manual labor.  Even though &lt;a href="http://webservices.xml.com/lpt/a/1292"&gt;Service-Oriented Architecture (SOA)&lt;/a&gt; initiatives around the world have the right goals, most efforts have fallen profoundly short of our desired levels of integration and improved business agility.&lt;/p&gt;
&lt;p align="center"&gt;&lt;img src="http://hinchcliffe.org/img/woa_soa_visual.png" alt="WOA REST Web 2.0 SOA Convergence Visualization"/&gt;&lt;/p&gt;

&lt;p&gt;However, the news isn't all bad, the fascinating story is that there is a place today where the deep integration of our systems and information on a large scale has largely been solved and is a foregone conclusion in most cases.  And that place is at the leading-edge of the World-Wide Web, sometimes referred to as Web 2.0.  This success story has taken a while however and it's also managed to &lt;a href="http://blogs.zdnet.com/Hinchcliffe/?p=135"&gt;fly under the radar of most enterprise architects and IT vendors&lt;/a&gt; in the process.  The left-hand turn that Web services took early on in the Internet story (circa 1999-2000) with &lt;a title="" href="http://www.w3.org/TR/soap/" &gt;SOAP&lt;/a&gt;, &lt;a title="" href="http://www.w3.org/TR/wsdl" &gt;WSDL&lt;/a&gt;, UDDI, and WS-I Basic Profile turned out to be definitely &lt;em&gt;not&lt;/em&gt; the right answer for the vast majority of integration scenarios (we'll see why below), despite the continued prevalence of these approaches today in most enterprises.&lt;/p&gt;

&lt;p&gt;In contrast, the vast living laboratory of the Web has provided a singularly different answer, than has a fundamentally different focus though it remains a close cousin to traditional SOA.  This much more Web-oriented approach is something that many have called Web-Oriented Architecture (WOA) and is based on the immense tensile strength of the World Wide Web itself and its underlying architectural fundamentals.  And it's based on the basic concepts and rich outcomes that have made the Web far and away the largest open network on the planet as well as the &lt;a href="http://web2.socialcomputingmagazine.com/is_web_20_the_global_soa.htm"&gt;largest SOA presently in existence.&lt;/a&gt;  At the leading end of this is the &lt;a hef="http://web2.socialcomputingmagazine.com/the_web_20_mashup_ecosystem_ramps_up.htm"&gt;Web mashups story&lt;/a&gt; with &lt;a href="http://blogs.zdnet.com/Hinchcliffe/?p=106"&gt;enterprise mashups&lt;/a&gt; being one of the major improvements to the IT landscape that WOA is heralding.&lt;/p&gt;

&lt;p&gt;So to loosely paraphrase a famous line from history, I come to praise SOA, not to bury it.  In the process I hope to explain WOA as simply as I can.  This is still important because WOA just isn't standard fare yet for discussion in many IT circles while it's something that folks that build online services out on the globally scalable consumer Web increasingly take for granted.  There are few vendors (though growing) that have lined up behind this pragmatic, effective, efficient, and highly popular approach, further limiting the body of formal knowledge and support available to practitioners who want to transplant this profoundly useful and simple way of connecting our systems together.&lt;/p&gt;

&lt;p&gt;&lt;img style="padding-left: 11px;" align="right" src="http://blogs.zdnet.com/images/restwoa.jpg"/&gt;You may have noticed I've left &lt;em&gt;"easy"&lt;/em&gt; out of my lists of adjectives describing WOA.  And that's because I don't believe it's easy to set aside the last decade of evolving mindsets, habits, investments, tools, and skill sets for a better alternative, no matter how compelling or promising.  And WOA is more than just a way of building Web services, it's also an ecosystem mindset and as such can at times be less accessible to non-system thinkers, particularly if said alternative is not well documented in the industry.  And though significant headway has been made recently, particularly with an excellent spate of books such as Sum Ruby's superb &lt;a href="http://www.oreilly.com/catalog/9780596529260/"&gt;RESTful Web Services&lt;/a&gt;, the grassroots, emergent nature of WOA has not lent itself well to extensive formal documentation.  Despite the improvements in the available literature, I still find that a succinct, direct, and complete explanation of WOA is lacking and here's my attempt to boil it down to the essential principles.  I then contrast it with traditional SOA so that the differences and similarities are clearly highlighted.  Here's what I've come up with:&lt;/p&gt;

&lt;h2&gt;What is WOA? The Basic Tenets&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Information in a WOA is represented in the form of &lt;em&gt;resources&lt;/em&gt; on the network and are accessed and manipulated via the protocol specified in the URI, typically HTTP.&lt;/li&gt;
&lt;li&gt;Every resource on the network can located via a globally unique address known as a Universal Resource Identifier or URI complying with &lt;a href="http://tools.ietf.org/html/rfc3986"&gt;RFC 3986&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Resources are manipulated by HTTP verbs (GET, PUT, POST, DELETE) using a technique known as &lt;a href="http://en.wikipedia.org/wiki/Representational_State_Transfer"&gt;Representational State Transfer&lt;/a&gt; or &lt;a title="" href="http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm" &gt;REST&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Manipulation of network resources is performed solely by &lt;em&gt;components&lt;/em&gt; on the network (essentially browsers and other Web servers).&lt;/li&gt;
&lt;li&gt;Access to resources must be layered and not require more than local knowledge of the network.&lt;/li&gt;
&lt;li&gt;It is the responsibility of the components to understand the representations and valid state transitions of the resources they manipulate.&lt;/li&gt;
&lt;li&gt;The &lt;a href="http://hinchcliffe.org/archive/2005/05/16/231.aspx"&gt;service contract&lt;/a&gt; of WOA resources is implicit; it's the representation that is received.&lt;/li&gt;
&lt;li&gt;WOA resources contain embedded URIs that build a larger network of granular representative state (i.e. order resources contain URLs to inventory resources).&lt;/li&gt;
&lt;li&gt;WOA embodies Thomas Erl's &lt;a href="http://hinchcliffe.org/archive/2005/08/27/1817.aspx"&gt;essential Principles of SOA&lt;/a&gt;, though in often unexpected ways (such as having a contract, albeit implicit).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;WOA Implementation Guidelines&lt;/h2&gt;

&lt;p&gt;The basic tenets above paints a picture of a galaxy of nearly infinite granular information resources integrated into a deeply interconnected set of dynamic connections that can be processed individually for a given task, in part (for integrated applications), or as a whole (such as enabling a comprehensive directory or search engine of all data and metadata.)  In other words, the Web model provides a single, open, and unified information architecture that is consistent, easily consumed, extremely scalable, securable, very reusable, resilient, and highly federated.  The Web itself is the single largest example of this and increasingly, enterprises are adapting their existing IT systems and legacy silos to this model, discovering the advantages of this ecosystem model for information resources and enterprise architecture.&lt;/p&gt;

&lt;strong&gt;&lt;a href="http://web2.socialcomputingmagazine.com/a_timeless_way_of_building_software.htm"&gt;Read an exploration&lt;/a&gt; of why SOA and Web 2.0 both reflect two aspects of a "timeless way of building software".&lt;/strong&gt;

&lt;p&gt;But the basic tenets previous list are at the architectural level.  How does an SOA practitioner ensure they are implementing a WOA model as they build WOA Web services and resource-enable existing services and IT systems.  Here are the key guidelines to be aware of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Every WOA resource should have the same unambiguously and globally unique URI on the local (SOA) network as well as the World Wide Web.&lt;/li&gt;
&lt;li&gt;In general, URIs should be descriptive of the resource to the extent possible.  For example, &lt;em&gt;http://domain.com/blogs/feeds/sruby.atom&lt;/em&gt; is strongly preferrable to &lt;em&gt;http://domain.com/resources/12345678&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;The type of resource representation (XHTML, XML, MP3, AVI, etc.) should be encoded in the URI itself.  Using the .xml extension at the end of a URI is a common convention, for example.&lt;/li&gt;
&lt;li&gt;A set of resources of a particular type should expose all known URIs in some manner (a WOA resource that provides granular, paged navigation for example) to enable linking, discovery, enumeration, browsing, and consumption in general.&lt;/li&gt;
&lt;li&gt;Query string parameters are generally not considered part of the URI possibly excepting resources that represent algorithmic or functional outputs. Move query strings to the URI whenever possible.&lt;/li&gt;
&lt;li&gt;Encourage URI self-reliance by limiting information that is communicated via HTTP headers when it can be moved to the URI.  The Web cannot propagate header information, but links can.&lt;/li&gt;
&lt;li&gt;Resources should link to related resources via embedded URIs instead of making local copies.  This is the core of the &lt;a href="http://en.wikipedia.org/wiki/Hypermedia"&gt;hypermedia&lt;/a&gt; concept that makes the Web and WOA provide its unique capabilities.&lt;/li&gt;
&lt;li&gt;WOA resources must careful to preserve &lt;a href="http://en.wikipedia.org/wiki/Idempotent"&gt;idempotency&lt;/a&gt; for state transition consistency.&lt;/li&gt;
&lt;/ul&gt;

&lt;strong&gt;&lt;a href="http://hinchcliffe.org/archive/2006/08/05/8489.aspx"&gt;Read a write-up&lt;/a&gt; of how to design a loosely coupled and highly resilient WOA/Client with minimum dependencies and best practices.&lt;/strong&gt;

&lt;h2&gt;The major differences between traditional SOA and WOA&lt;/h2&gt;

&lt;p style="padding-right: 5px;"&gt;&lt;div style="
  border: solid 1px #000;
  background-color: #FAF8CC;
  margin-left: 5px;
  width: 210px;
  font-size: 1.05em;
  padding: 6px;
  float: right;"&gt;&lt;div align="center"&gt;&lt;strong&gt;Is WOA really the future of SOA?&lt;/strong&gt;&lt;/div&gt;&lt;br/&gt;Here are some key datapoints on WOA adoption and trends:&lt;br/&gt;&lt;ul&gt;&lt;li&gt;The majority of new Web services on the open Web (which is the largest SOA in existence) are now released in the form of either simple XML over HTTP or REST and not based on traditional SOA approaches.  &lt;em&gt;Source:&lt;/em&gt; API survey of ProgrammableWeb listings.&lt;/li&gt;&lt;li&gt;Creating any basic Web page automatically creates a simple read-only WOA Web service.  Bonus points if you're using XHTML.  This highlights an absolutely key fact: The Web &lt;strong&gt;is&lt;/strong&gt; WOA and competing Web service models, even if superior, would have a very tough time gaining similar adoption (and have been trounced on the greater Web.)&lt;/li&gt;&lt;li&gt;The latest Web development platforms, such as Ruby on Rails, have already decided to deprecated SOAP and expose REST Web sevices for all apps by default.&lt;/li&gt;&lt;li&gt;Amazon famously tested the popularity of REST/WOA versus SOAP and the vast majority of customers (tens of thousands) chose the REST/WOA flavor.&lt;/ul&gt;&lt;/div&gt;One of the more helpful ways of understanding WOA is to see how it's different than SOA since there is considerable overlap between these two models of using the network to integrate, interoperate, and collaborate.  While both approaches leverage HTTP, self-describing data formats such as XML, are concerned about the use of open standards, and can be used to build systems of arbitrary complexity, much of the similarity ends there.  Here are some of the most significant contrasts between the two approaches:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SOAs tend to have a small and well-defined set of endpoints through which many types of data and data instances can pass.  WOAs tend to have a very large and open-ended number of endpoints; one for each individual resource.  Not an endpoint for each type of resource, but a URI-identified endpoint for each and every resource instance.&lt;/li&gt;
&lt;li&gt;Traditional SOA builds a messaging layer above HTTP using SOAP and providing unique and sometimes prohibitive constraints to the Web developer, while WOA finds HTTP and related transfer mechanisms to be the ideal layer of abstraction for most applications.&lt;/li&gt;
&lt;li&gt;SOA was designed from the top-down by vendors to be tool friendly, while WOA was emerged form the bottom up from the Web naturally and has the best support in simple procedural code and an XML parser.&lt;/li&gt;
&lt;li&gt;SOA uses WS-Security and other sophisticated standards for security, while WOA tends to just use HTTPS.&lt;/li&gt;
&lt;li&gt;SOA must contend with the vagaries of XML Schemas for service contracts, while WOA largely ignores the issue and lets Web services naturally represent whatever formats are desired.&lt;/li&gt;
&lt;li&gt;Traditional SOA is fairly cumbersome to consume in the browser and in mashups while WOA is extremely easy to consume just about anywhere.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I should close by emphasizing that I enjoy and use traditional SOA technologies like SOAP, WSDL, and XSD frequently.  But as more and more of the consumer Web moves to a more Web-oriented model, the evidence continues to mount that approaches based on WOA are easier to implement, scale better, and result in much greater uptake and usage scenarios.  Traditional SOA is facing a crises of identity at this point, particularly given fairly lackluster results for most, and WOA may just be the prescription we need to make SOA deliver the robust outcomes that we were formerly expecting of it.  Especially read the article I wrote last year (below in the reading section on eleven new ideas for SOA architects) to show the promise of and a new vision for user-controlled SOA and other aspects that WOA enables and that traditional SOA tends to constrain.&lt;/p&gt;

&lt;p&gt;Other vital reading on the convergence and evolution of SOA, WOA, and Web 2.0:&lt;/p&gt;
&lt;ul&gt;
 &lt;li&gt;&lt;a href="http://www.intertwingly.net/blog/2006/08/08/WOA-vs-ROA"&gt;WOA versus ROA by Sam Ruby&lt;/a&gt;
 &lt;li&gt;&lt;a href="http://blogs.zdnet.com/Hinchcliffe/?p=107"&gt;The story of Web 2.0 and SOA continues&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href="http://hinchcliffe.org/archive/2007/01/20/12675.aspx"&gt;Eleven Emerging Ideas for SOA Architects in 2007&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href="http://edgeperspectives.typepad.com/edge_perspectives/2006/04/soa_versus_web_.html"&gt;SOA Versus Web 2.0? by John Hagel&lt;/a&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;em&gt;Note: I reserve the next few days to clean up and revise this article.  In the meantime, please share your SOA vs. WOA stories and opinions below.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; ZDNet's Joe McKendrick provides some coverage of these ideas in a &lt;a href="http://blogs.zdnet.com/service-oriented/?p=1072"&gt;new post&lt;/a&gt;.&lt;/p&gt;&lt;img src ="http://hinchcliffe.org/aggbug/16617.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Dion Hinchcliffe</dc:creator><title>Creating Open Web APIs: Exploring REST and WOA in Rails 2.0</title><link>http://hinchcliffe.org/archive/2008/01/10/16613.aspx</link><pubDate>Thu, 10 Jan 2008 17:27:00 GMT</pubDate><guid>http://hinchcliffe.org/archive/2008/01/10/16613.aspx</guid><wfw:comment>http://hinchcliffe.org/comments/16613.aspx</wfw:comment><comments>http://hinchcliffe.org/archive/2008/01/10/16613.aspx#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://hinchcliffe.org/comments/commentRss/16613.aspx</wfw:commentRss><trackback:ping>http://hinchcliffe.org/services/trackbacks/16613.aspx</trackback:ping><description>&lt;img style="padding-left: 10px; padding-top: 5px;" align="right" src="http://hinchcliffe.org/img/onlineplatformplay.png"&gt;&lt;p&gt;In my &lt;a href="http://blogs.zdnet.com/Hinchcliffe/?p=157"&gt;recent 2008 predictions&lt;/a&gt; for the future of Web services and open APIs for enterprise applications, I said that we'd finally see a large scale movement to newer, lightweight Web-based models for opening up our software systems and integrating them together.   In other words, heavyweight SOA has finally fallen out of favor and lightweight SOA -- sometimes known as &lt;a href="http://blogs.zdnet.com/Hinchcliffe/?p=43"&gt;Web-Oriented Architcture (WOA)&lt;/a&gt;, is in.&lt;/p&gt;
&lt;p&gt;However, this sea change has long since taken place on the Web and this year will see best practices in this area take another major step forward as we'll examine below.  The recent &lt;a href="http://blogs.zdnet.com/Hinchcliffe/?p=107"&gt;convergence of the Web, SaaS, SOA&lt;/a&gt;, and other approaches has also made the boundaries between our architectures and systems increasingly intertwine and blur. As part of this evolution, we have also watched the gains that successful firms like Amazon and Facebook have made by opening up their products on the Web.  And strategically, as an industry, we've begun to find it a lot smarter to think in terms of &lt;a href="http://www.web2journal.com/read/170768.htm"&gt;reusable, interconnected open platforms&lt;/a&gt; instead of single-play software applications.  Along this journey, we have begun a major return to the roots of the globally linked structure of the Web.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The rest of this post consists of two sections.  One conceptual and one technical:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
   &lt;li&gt;The &lt;a href="#issues_and_motivations"&gt;issues around and motivations&lt;/a&gt; for the move to new Web development platforms and architectures.&lt;/li&gt;
   &lt;li&gt;A &lt;a href="#rails_rest_api_walkthrough"&gt;tutorial and walkthrough of how to use Rails&lt;/a&gt; to rapidly implement Web apps with open &lt;a title="" href="http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm" &gt;REST&lt;/a&gt; APIs.&lt;/li&gt;
&lt;/ul&gt;
&lt;a name="issues_and_motivations"&gt;&lt;h2&gt;The next generation of Web development platforms and open APIs&lt;/h2&gt;&lt;/a&gt;
&lt;p&gt;The daily reinforcement and continuous growth in the fundamental power of HTTP and URL link structure, which is directly driving the Web's overall &lt;a href="http://web2.socialcomputingmagazine.com/web_20s_real_secret_sauce_network_effects.htm"&gt;network effect&lt;/a&gt;, has starting giving rise to a new generation of software architects and product designers. This generation has grown up deeply influenced by it and they tend to think about the creation of software in novel, new, highly Web-oriented ways.  Though the classical software industry has a long and proud heritage of its own around methodologies, architectural approaches, and design patterns -- proven in the crucible of real-world implementations of years past -- in this decade the Web has managed to exert its own unique, irresistible, and pervasive influence on virtually all aspects of producing software.  For example, agile processes have been pushed to the limit and beyond by the forces imposed by the realities of the &lt;a href="http://blogs.zdnet.com/Hinchcliffe/?p=15"&gt;Perpetual Beta&lt;/a&gt;.  And the scale of even average sized applications on the Web are now the largest we've ever seen.  The absolute necessity of cost-effective operations and the marketplace requirements of embracing the &lt;a href="http://blogs.zdnet.com/Hinchcliffe/?p=130"&gt;new business models for Web 2.0 applications&lt;/a&gt; -- including advertising, user generated content, and rich user experiences -- have also changed the fundamental technical and commercial ground rules for success.  As a whole, these changes have been driving a need for new software platforms that are explicitly designed to help us efficiently produce scalable, compelling online applications while also addressing the reality of modern-day Web apps.&lt;/p&gt;
&lt;img style="padding-left: 10px;" align="right" src="http://hinchcliffe.org/img/weblanguagecomparison1.png"/&gt;&lt;p&gt;Many of us who have to create the next generation of Web applications have been taking a hard look at the new platforms that have been created for the modern era of very large-scale networked software applications.  And I'll be very clear here: While a great many of the old ideas and techniques in software development are as applicable today as they were ten years ago, there are also an whole new set of constraints and enablers for which we have to be very good at optimizing.  As the Web begins its 2nd major wave of maturity -- and depending on who you listen to -- there is a considerably less tolerance for older, inefficient methods for developing Web applications; vigorous online competition for marketshare and increasingly online-savvy businesses have a much better sense of what is possible and how much it should cost and when it should be delivered.&lt;/p&gt;
&lt;p&gt;These factors as a whole have pushed us into a new era of productivity-oriented platforms that started years ago with languages like Tcl and Perl and quickly moved on to Python, PHP, Ruby.  Ultimately we ended up where we are today, with advanced, highly-efficient frameworks for these languages such as Ruby on Rails and CakePHP.  These tools now let us create Web applications literally &lt;em&gt;10 to 20 times&lt;/em&gt; more efficiently than the general purpose language platforms of the 20th century, and with both traditional software engineering as well as new Web 2.0 best practices already built in.  These improvements have only spurred what can only be called a "radical" movement in the software business, which started with open source software (the peer production of software) starting in the 90s, and where we have arrived, with a dramatic departure from the way we used to look at software languages and platforms in terms of how vertical a software development platform could be before it lost general appeal.&lt;/p&gt;
&lt;p&gt;These new efficiency gains and vertical focus, however, are almost exclusively aimed at the twins goals of developer productivity and good design.  These are both admirable and important goals since programmer time always been one of the leading costs in producing software.   Software applications also spend most of their lifetimes in maintenance mode and clean application architectures from the outset can greatly facilitate updates and revisions.  However, over the same time frame, the run-time efficiency of our programming environments, partially obscured by a little help from &lt;a href="http://www.useit.com/alertbox/980405.html"&gt;Moore's Law and Nielsen's Law&lt;/a&gt;, has been in a major decline. This has been largely intentional, when it comes to supporting improved developer productivity, or entirely unfortunate, such as the general failure of the software industry to &lt;a href="http://hinchcliffe.org/archive/2005/01/10/148.aspx"&gt;figure out how to help software designers fully leverage&lt;/a&gt; the now ubiquitous generation of multi-core processors.&lt;/p&gt;
&lt;img style="padding-left: 10px;" align="right" src="http://hinchcliffe.org/img/weblanguagecomparison2.png"/&gt;&lt;p&gt;Out of all this there has grown a distinct and growing tension between the need to rapidly and inexpensively produce quality software and the requirement for it to scale cost-effectively to millions of users.  The simple fact is, which you can readily see in the &lt;em&gt;Hard Metrics&lt;/em&gt; diagram to the right, is that the previous generation of programming languages and platforms is up to 40x faster than what many of would prefer to use today to develop Web applications.  Yet the more you go to the left on both diagrams, the more that programming platform becomes extremely expensive and time-consuming to develop with. Why is this?  There are two primary reasons.&lt;/p&gt;
&lt;p&gt;One is that the more popular, older programming languages tend to be relatively low level and general purpose and were designed for a different, older set of constraints.  This has given us baggage that is often not very applicable to the modern Web-based world.  Second, we've become very good at understanding the idioms and "syntactic sugar" that makes developers more productive for Web development and we've put that into the latest generation of programming languages and Web frameworks.  Unfortunately, the combined newness of these new Web development platforms and their preference for coding time efficiency in favor of run-time efficiency has conspired to make the results they produce relatively slow and resource inefficient compared to what is potentially possible.  Newness in this case is also a kind of performance tax since we just haven't had enough time learning how to make these new platforms perform well at run-time, similar to early versions of &lt;a title="Java" href="http://java.sun.com" &gt;Java&lt;/a&gt; before the advent of the Just-In-Time (JIT) compiler.  Fortunately, efforts like &lt;a href="http://rubydotnet.googlegroups.com/web/Home.htm"&gt;Ruby .NET&lt;/a&gt; have made some notable headway in this space recently, but are not commonplace yet.&lt;p&gt; 
&lt;p&gt;The intent of the rest of this article is to explore the new release of Ruby on Rails 2.0 and examine it in the context of the trends above.  The ultimate 10 million dollar question in the Web development platform arena is: Are the developer productivity benefits, including the embodiment of many current Web application best practices, that are conferred by new generation Web development platforms like Rails worth their cost in terms of operational efficiency?  Increasingly, whether you're a corporate IT executive or a programmer at an Internet startup, you're going to be facing this difficult decision when you choose your target platform.  Questions like "&lt;em&gt;is it worth 5x-10x the programmer time to get run-time efficient software?&lt;/em&gt;",  or "&lt;em&gt;should I just increase the investment in more processor cores and bandwidth in the data center?&lt;/em&gt;" will keep you up at night.  Making the wrong choice has potentially serious long-term consequences in terms of what it will ultimately take to maintain and operate your application.  A programming platform's implications for operations are particularly pronounced since Web apps require more operational resources on the server-side the larger they grow, unlike traditional, installed stand-alone applications.&lt;/p&gt;
&lt;p&gt;One way of thinking about the problem is that it's almost never a good idea to bet against significant improvements in computing and network bandwidth.  So far we've not yet seen much to indicate that large, regular improvements won't continue for the foreseeable future.  Another is assuming that a platform should be used in a slavishly monolithic fashion for an entire application.  In fact, as an insightful interview with Alex Payne, a lead developer of one of most well-known Rails success stories, &lt;a href="http://twitter.com"&gt;Twitter&lt;/a&gt;, shows it often makes sense to move the slowest parts of the app into something faster. This is such a common situation in software development that it's long been codified as the &lt;a href="http://hinchcliffe.org/archive/2005/01/11/150.aspx"&gt;Alternate Hard/Soft Layers pattern&lt;/a&gt;.  And while these two considerations alone will go a long way towards helping one decide which direction to take, one must also look to where the industry is going as a whole.  The new productivity-oriented platforms are here to stay and adopting strategies to use their strengths effectively while being proactive in addressing their weaknesses, is the best route to success with 21st century Web applications.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Where's the interface? REST doesn't have a contract description language and essentially uses &lt;a href="http://en.wikipedia.org/wiki/Duck_typing"&gt;duck typing&lt;/a&gt;.  &lt;a href="http://hinchcliffe.org/archive/2006/08/05/8489.aspx"&gt;Read about best practices for WOA/Client development&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;So all of these issues form the lens through which we must look at the modern Web 2.0 applications arena.  But let's take an actual look at what we're talking about here.  How efficient can these new development platforms really be?  And do they are actually encourage us down the right paths in term of modern best practices in the Web 2.0 era?  Let's validate this by actually building, hands-on, an entire Web application using one of these new productivity-oriented programming platforms, specifically using the newly released &lt;a href="http://weblog.rubyonrails.org/2007/12/7/rails-2-0-it-s-done"&gt;Ruby on Rails 2.0&lt;/a&gt;.  Those following along will need a little bit of technical skill, but you'll see that these new platforms are tremendously efficient from a developer perspective.  In fact, we'll have an application up and running in literally a few minutes after you get your Rails 2.0 environment installed.&lt;/p&gt; 
&lt;h2&gt;Building a WOA-compliant Web Application in Rails 2.0&lt;/h2&gt;
We're about to get our hands on Rails 2.0 and build a complete data-driven Web application.  But first we have to understand a little bit about REST and WOA since that's the "return to the roots of the Web" story I alluded to in the beginning.  Nick Gall originally coined the term WOA, which &lt;a href="http://ironick.typepad.com/ironick/2006/08/sam_ruby_thinks.html"&gt;he defines for us here&lt;/a&gt;.  It's also called a resource-oriented architecture, but at the core of both conceptions is an approach called REST, which &lt;a href="http://hinchcliffe.org/archive/2005/02/12/171.aspx"&gt;I've previously defined with specifics&lt;/a&gt; for those of you not familiar with it.  But the key idea is that REST is just a way of using the fundamental protocol of the Web, the Hypertext Transport Protocol (HTTP), to exchange information with anyone else on the Web.  REST treats the information on the Web as URL-addressable resources, which includes traditional Web pages but also pure data including XML, video, and audio.  REST, which is really  just a style of using HTTP, leverages the architecture of the World Wide Web in a natural, organic manner.  In other words, REST is the best way we currently know of to open up our Web applications to the rest of the world, an approach I have called the &lt;a href="http://blogs.zdnet.com/Hinchcliffe/?p=35"&gt;Global SOA&lt;/a&gt; in the past.&lt;/p&gt;
&lt;p&gt;In contrast to object-oriented models for software, or the procedural models used by traditional Web services such as SOAP, REST only uses four methods, those built into HTTP itself: GET, POST, PUT, and DELETE,  which themselves operate on data resources located at URI endpoints located on Web servers holding the data (typically a relational database under the covers).  Consequently, REST applications tend to have a much larger (and transparent) set of surface area dependencies directly on sets of addressable Web data instead of on bundles of procedural methods through which XML schema instances are passed.&lt;/p&gt;
&lt;p&gt;Since platforms like Rails embody many of our latest ideas about how best to develop for the Web, it should come as little surprise that the principle creator of Rails, David Heinemeier Hansson, recently observed that the latest release of Rails consists mainly of "&lt;em&gt;a slew of improvements to the RESTful lifestyle&lt;/em&gt;."  One of the most remarkable things about Rails is how it pays more than lip service to this essential resource-oriented view of the Web.  As you shall see, since open APIs are one of the hot topics in the Web applications business at the moment, it's nice to know that every Rails app automatically gets its very own RESTful API.  So, let's see this for ourselves...&lt;/p&gt;
&lt;a name="rails_rest_api_walkthrough"&gt;&lt;h2&gt;Building an Open Web API in Rails 2.0&lt;/h2&gt;&lt;/a&gt;
&lt;h2&gt;Step 1: Getting on Rails 2.0&lt;/h2&gt;
&lt;p&gt;To explore developing a Rails 2.0 app and creating/using its open Web API, you'll need to install four pieces of software on your test computer.&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Install the Ruby programming language.&lt;/strong&gt;  Version 1.8.6 is highly recommended.  Here are links to the &lt;a href="http://rubyforge.org/frs/?group_id=167"&gt;Ruby Windows installer&lt;/a&gt;, &lt;a href="http://hivelogic.com/articles/ruby-rails-mongrel-mysql-osx/"&gt;Mac OS 10.4 instructions&lt;/a&gt;.  Ruby is already installed standard on 10.5 (Leopard).&lt;p/&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Use the Ruby Gems updater&lt;/strong&gt; from a command-line or terminal session to pull in Rails 2.0 from over the Internet:&lt;br/&gt;&lt;br/&gt;
&lt;code&gt;gem install rails -y&lt;/code&gt;&lt;br/&gt;&lt;br/&gt;
You'll know you did this right if the output of the command:&lt;br/&gt;&lt;br/&gt;&lt;code&gt;rails --version&lt;/code&gt; is:&lt;br/&gt;&lt;br/&gt;&lt;code&gt;Rails 2.0.2&lt;/code&gt; or higher.  Warning: If you have an earlier version of Rails installed, it will be upgraded automatically.&lt;p/&gt;&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Install a database of your choice&lt;/strong&gt;.  &lt;a href="http://dev.mysql.com/downloads/"&gt;MySql&lt;/a&gt; or &lt;a href="http://www.postgresql.org/download/"&gt;Postgres&lt;/a&gt; are recommended but even SQL Server or Oracle will work just fine, though you will probably have to install their Gems separately.  Rails is for designing database-driven Web apps so make sure write down your user account and password for the database. Make sure you've created a named database instance.  Don't worry about application tables for now, we'll have Rails take care of that for us later.&lt;p/&gt;&lt;/li&gt;
   &lt;li&gt;&lt;strong&gt;Connect the database to your Rails application.&lt;/strong&gt; First we create a skeleton app and then we'll tell it about our database instance.  Note: Getting the database connection information and credentials right after you install everything is often the hardest part about getting Rails up and running.&lt;br/&gt;&lt;br/&gt;
First, let's create the skeleton application we're going to be using for the rest of our work.  Go to a local directory of your choice and type the following from a command line:&lt;br/&gt;&lt;br/&gt;
&lt;code&gt;rails railsapp&lt;/code&gt;&lt;br/&gt;&lt;br/&gt;
This will lay down the entire application structure for a Rails app, including a built-in Web server, WEBrick.&lt;p/&gt;
Inside &lt;code&gt;railsapp&lt;/code&gt; there will be a &lt;code&gt;config&lt;/code&gt; directory with a file called &lt;code&gt;database.yml&lt;/code&gt;.  Open it in your favorite editor and fill out the &lt;code&gt;development:&lt;/code&gt; section of the file with your database credentials and save it.&lt;p/&gt;
Start WEBrick in a separate command-line instance by typing the following, and be prepared to stop and start it occasionally as certain application changes are made:&lt;br/&gt;&lt;br/&gt;
&lt;code&gt;cd railsapp&lt;/code&gt;&lt;br/&gt;
&lt;code&gt;ruby script/server&lt;/code&gt;&lt;p/&gt;&lt;/li&gt;
   &lt;li&gt;&lt;strong&gt;Download &lt;a href="http://curl.haxx.se/download.html"&gt;cURL&lt;/a&gt;, a command line HTTP invoker.&lt;/strong&gt;  Put it in a path you can reach from your command line instance.  We'll be using cURL to simulate a RESTful Web API client and invoke our Web application's REST API upon a data resource we've previously created via as a user the HTML interface we've built in Rails.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Now we're ready to start development and testing of our Rails 2.0 application.  Keep WEBrick running in one command line window so you can see its debug output (it will show you all the HTTP requests that go back and forth), and have another command line in the &lt;code&gt;railsapp&lt;/code&gt; directory ready to invoke various Rails commands.&lt;/p&gt;
&lt;h2&gt;Creating Our Open Web Application in Rails 2.0&lt;/h2&gt;
&lt;p&gt;For the purposes of this demonstrator, we're going to build a very simple employee tracking application in Rails.  We're going to use the newer syntax in Rails for easy creation of a full Web application with employee record creation, viewing, updating, and deletion.  Rails will even create the database tables for us, all the user interface screens (albeit they will be unstyled), unit tests, and even a complete RESTful API, our final end goal.&lt;/p&gt;
&lt;p&gt;Astonishingly, we're going to create all of this using only two short commands at the command-line.  You'll see why Rails is one of the most productive Web development platforms available and this step in particular shows some of the radical ease of use that Rails proponents (myself included) are consistently impressed with.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step 1:  Create the basic employee tracking application&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Rails use a well-designed &lt;a href="http://en.wikipedia.org/wiki/Model-view-controller"&gt;Model-View-Controller architecture&lt;/a&gt; and in our first command, were going to ask it to create all three items for us for our employee tracking database as well as matching unit tests and cross-platform database scripts.  To keep it simple, we're only going to track two fields for the employee: their name and their extension.  You are welcome to add additional fields but will have to deal with the additional fields in the steps below.&lt;/p&gt;
&lt;p&gt;In the &lt;code&gt;railsapp&lt;/code&gt; directory, type the following command:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;ruby script/generate scaffold emp name:string extension:integer&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;You will see a lot of output showing the files that the Rails framework creates to handle the employee data we've just specified.  The command itself invoked the &lt;code&gt;generate&lt;/code&gt; facility of Rails to create a new scaffold for a model called 'emp' which has two fields, an employee name typed as a text string and an extension typed as an integer.  A scaffold is an initial, working application skeleton with basic functionality including database persistence and a matching set of HTML forms for the CRUD.&lt;/p&gt;
&lt;p&gt;Now, believe it or not, the employee tracking application is now mostly finished, the only thing we need to do it to update the database so that it has the schema for the employee records.  You can use Rails' &lt;code&gt;rake&lt;/code&gt; facility to get this done.  This will require that you have correctly set up your &lt;code&gt;database.yml&lt;/code&gt; file, and you will have to debug any connection issues to get this step to work.  To migrate our employee model, named 'emp' to the database, type the following in the &lt;code&gt;railsapp&lt;/code&gt; directory:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;rake db:migrate&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Now, you can run the application by going to the emps directory on the WEBrick instance.  Note that &lt;code&gt;emp&lt;/code&gt; as been pluralized automatically by rails, so our applications is located at the &lt;code&gt;emps&lt;/code&gt; endpoint.  To access our new Rails 2.0 Web app, point your browser to:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;http://localhost:3000/emps&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;You should see the listing screen of the employee tracking database that looks like the one below:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://hinchcliffe.org/img/emps1.jpg"/&gt;&lt;/p&gt;
&lt;p&gt;Click on &lt;em&gt;New emp&lt;/em&gt; to create a new employee, and enter the data as seen below (aside: Roy Fielding is co-inventor of HTTP and the person who created the &lt;a href="http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm"&gt;original vision around REST&lt;/a&gt;), and click on &lt;em&gt;Create&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://hinchcliffe.org/img/emps2.jpg"/&gt;&lt;/p&gt;
&lt;p&gt;The data entered is then transmitted from the browser to the server and stored in the back-end database. You can then view it, destroy it, or add more employees with the user interface that was generated for us by Rails.&lt;/p&gt;
&lt;p&gt;We've now completed a simple but fully functional Rails application from beginning to end.  But what we've come here to see is the fully RESTful open Web API that was created for us along the way.  For this we'll need to use cURL to issue the API calls via HTTP to simulate another online program integrating live with our Web application.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step 2a:  Invoke the REST API to GET the employee resources&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Now we're going to exercise all the HTTP verbs on our open Web API to see how it works.  The diagram below shows the overall lifecycle of a REST-based resource using our &lt;code&gt;emp&lt;/code&gt; example.  The good news is that Rails automatically offers URL addressable resources for all the data in a Rails Web application.  This access can be controlled and channeled as needed but it's open by default for whichever views already have visual access via HTML forms.  This means Rails developers get a RESTful API for their applications simultaneously as they develop their user interface.&lt;/p&gt;
&lt;div style="text-align:center;"&gt;&lt;img src="http://hinchcliffe.org/img/restinteractionvisual.png"/&gt;&lt;/div&gt;
&lt;p&gt;Let's go ahead use the REST API to pull the data for the employee that we added above.  We'll use the handy HTTP utility, cURL, to interact with the Rails application via HTTP.  Note that the URL we'll use now has the '.xml' extension added to it.  This tells Rails that we're trying to access the XML representation of the resource instead of using the HTML user interface (in other words, we're playing the role of a program instead of a human user.)&lt;/p&gt;
&lt;p&gt;&lt;code&gt;curl http://localhost:3000/emps.xml&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Enter the text above in a local command-line or shell with the cURL binary in the execution path. You should see output that looks similar to the following below.  It's an XML representation of the employee data in list format, pulled fresh from the server via the REST API, with the &lt;code&gt;emps&lt;/code&gt; tag as the enclosing list structure holding individual &lt;code&gt;emp&lt;/code&gt; instances.&lt;/p&gt;
&lt;p&gt;&lt;pre class="yb"&gt;
&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;lt;emps type="array"&amp;gt;
  &amp;lt;emp&amp;gt;
    &amp;lt;created-at type="datetime"&amp;gt;2008-01-11T01:02:53+01:00&amp;lt;/created-at&amp;gt;
    &amp;lt;extension type="integer"&amp;gt;1234&amp;lt;/extension&amp;gt;
    &amp;lt;id type="integer"&amp;gt;1&amp;lt;/id&amp;gt;
    &amp;lt;name&amp;gt;Roy Fielding&amp;lt;/name&amp;gt;
    &amp;lt;updated-at type="datetime"&amp;gt;2008-01-11T01:02:53+01:00&amp;lt;/updated-at&amp;gt;
  &amp;lt;/emp&amp;gt;
&amp;lt;/emps&amp;gt;
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;It's idiomatic in Rails to use the &lt;code&gt;id&lt;/code&gt; attribute as the primarily key for application data.  In fact, this convention is required for a lot of the magic in Rails to happen automatically and the &lt;code&gt;rake&lt;/code&gt; migration way back in Step 1 already took care of adding this column to the database for us.  That means we can use the &lt;code&gt;id&lt;/code&gt; as the final addition of our employee resource URIs for updating, getting, and deleting individual employee resources.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step 2b:  Update an employee resource through the REST API via PUT&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Let's go ahead and update Roy Fielding's phone extension through the REST API.  Since we can tell from the employee list above that Roy's &lt;code&gt;id&lt;/code&gt; is '1', we can use that to let the API know which record we'd like to update.  You only have to send two parts of the resource in the API call, the &lt;code&gt;id&lt;/code&gt; and the attributes we'd like to update.&lt;/p&gt;
&lt;p&gt;Create a file called &lt;code&gt;put.xml&lt;/code&gt; with the following contents:&lt;/p&gt;
&lt;p&gt;&lt;pre class="yb"&gt;
&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;lt;emp&amp;gt;
  &amp;lt;extension type="integer"&amp;gt;5678&amp;lt;/extension&amp;gt;
  &amp;lt;id type="integer"&amp;gt;1&amp;lt;/id&amp;gt;
  &amp;lt;name&amp;gt;roy fielding&amp;lt;/name&amp;gt;
&amp;lt;/emp&amp;gt;
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Invoke cURL with the following parameters to actually update the phone extension in the resource on the server (and consequently in the database.)  The -H parameter sets the header so that Rails knows that an XML representation of the resource is being sent to it.  -T makes the HTTP invocation a PUT operation, and the URL of the resource is http://localhost:3000/emps/1.xml where the number 1 corresponds to the &lt;code&gt;id&lt;/code&gt; of the resource:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;curl -v -H "Content-Type: application/xml; charset=utf-8" -T put.xml http://localhost:3000/emps/1.xml&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step 2c:  Add an employee resource through the REST API via POST&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Now we'll add a new employee to our application over the network using the REST API.  This employee will be Tim Berners-Lee, so we'll create another XML file called &lt;code&gt;post.xml&lt;/code&gt; that looks like the following:&lt;/p&gt;
&lt;p&gt;&lt;pre class="yb"&gt;
&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;lt;emp&amp;gt;
  &amp;lt;extension type="integer"&amp;gt;1212&amp;lt;/extension&amp;gt;
  &amp;lt;name&amp;gt;Tim Berners-Lee&amp;lt;/name&amp;gt;
&amp;lt;/emp&amp;gt;
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;To send this via a POST operation through the REST API using cURL, issue the following on the command line.  The &lt;code&gt;--data-ascii&lt;/code&gt; parameter identifies the file to send via HTTP to our REST API.  Because the resource does not yet exist, the URL is the base of the resource type, http://localhost:3000/emps.  Rails conveniently returns the XML representation of the added resource so the &lt;code&gt;id&lt;/code&gt; generated on the server for the newly added record can be obtained in the client without a second call to the server.  Add Tim Berners-Lee to our employee tracking application via the API:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;curl -v -H "Content-Type: application/xml; charset=utf-8" --data-ascii @post.xml http://localhost:3000/emps.xml&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;A browse of the employees list via cURL or the employee tracking apps Web forms will see that Tim Berners-Lee has now been added to the application, including the database, via the REST interface.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step 2d:  Delete an employee resource through the REST API via DELETE&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Now we'll go ahead and remove Roy Fielding from the database using our REST API.  This process is straightforward and uses the HTTP verb DELETE.  You can issue this via cURL using the following command:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;curl --request DELETE http://localhost:3000/emps/1.xml&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;You can now verify through the employee tracking Web forms that Roy Fielding's employee record has been permanently removed from the database.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;We've seen how Rails 2.0 makes it enormously simple to create a database-driven Web application, expose it via a REST API, and manipulate it via a REST-capable client in a clean, no-nonsense manner.  Developing similar capability in C++, Java, or .NET environments is currently much more difficult.  What you see above however, is only the beginning; Rails 2.0 has added a lot of other support for more sophisticated uses of REST and HTTP.  I'll cover these in one of my upcoming posts as soon as I am able.  The key point here is that the next generation of Web application platforms puts almost staggering amounts of power in the hands of the average Web developer while providing powerful capabilities like properly formed REST APIs automatically.  This further puts the latest best practices for Web apps into places it wouldn't otherwise happen.  Open APIs will help power the next generation of online success stories and for this and other reasons, Rails should be on the short list for those considering new Web development efforts.  That is, only if they are prepared to do what's necessary to address Ruby's and Rails' shortcomings in run-time performance.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Still trying to exactly understand why Rails is such a compelling option? &lt;a href="http://web2.socialcomputingmagazine.com/ruby_on_rails_11_web_20_on_rocket_fuel.htm"&gt;Read an analysis&lt;/a&gt; of why platforms like Rails are a major improvement over previous generations of Web application platforms.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If you have any trouble getting the code to work, please contact me at &lt;a href="mailto:dion@hinchcliffeandco.com"&gt;dion@hinchcliffeandco.com&lt;/a&gt;.&lt;/p&gt;&lt;img src ="http://hinchcliffe.org/aggbug/16613.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Dion Hinchcliffe</dc:creator><title>The state of RIA moves forward: Ajax, Silverlight, and JavaFX</title><link>http://hinchcliffe.org/archive/2007/12/23/16592.aspx</link><pubDate>Sun, 23 Dec 2007 15:33:00 GMT</pubDate><guid>http://hinchcliffe.org/archive/2007/12/23/16592.aspx</guid><wfw:comment>http://hinchcliffe.org/comments/16592.aspx</wfw:comment><comments>http://hinchcliffe.org/archive/2007/12/23/16592.aspx#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>http://hinchcliffe.org/comments/commentRss/16592.aspx</wfw:commentRss><trackback:ping>http://hinchcliffe.org/services/trackbacks/16592.aspx</trackback:ping><description>&lt;img align="right" src="http://hinchcliffe.org/img/ria_masterclass.002.png"&gt;&lt;p&gt;I've just returned from Europe after delivering our new three day masterclass on Web 2.0 combined with the very latest in Rich Internet Application techniques for Web application development. We tried to create a highly innovative learning event that covered the latest in Internet design patterns and business models while at the same time tying tightly it with execution at the architecture and technology level.  After covering Ajax fundamentals and then adding in an injection of the very latest cutting edge RIA technologies from Microsoft and Sun, I believe we delivered one of the most leading-edge, fast-moving, and educational three days of high concept and hands-on Web application development.&lt;/p&gt;
&lt;p&gt;Delivering on this vision required a serious review of the latest alpha and beta code drops for Silverlight 1.1/2.0 and JavaFX as well as a deep dive into ASP .NET Ajax.  We found that these RIA platforms and frameworks are really starting to get ready for prime time even in their "under construction" state.  The capabilities that are germinating in these new platforms are fascinating and are clearly poised to move the RIA industry state-of-the-art forward significantly.  This is the story of what we learned along the way...&lt;/p&gt;
&lt;p&gt;Lately, we've been struck by the challenge in the magnitude of the diversity in knowledge that must be acquired and mastered before one can deliver online offerings that are successful, much less highly competitive.  The Web is currently the world's the best place to create and offer an online software product and lack of potent RIA approaches were one of the key missing ingredients that held back the potential of genuine online software applications.  Furthermore, the real upside potential of the Web is scale and more scale to a readily accessible audience of many hundreds of millions of potential users.  The delivery models are now just about here while the audience and demand continues to grow (SaaS, or Software-as-a-service, is on target to be the dominant software model by 2011/2012.)&lt;/p&gt;
&lt;p&gt;The challenge currently is creating RIA applications that can deliver in terms of a competitive user experience while still enabling the other key aspects of Web apps that drive their success.  These key aspects including ensuring a strong &lt;a href="http://web2.socialcomputingmagazine.com/web_20s_real_secret_sauce_network_effects.htm"&gt;network effect&lt;/a&gt;, turning the Web app into an reusable 3rd party platform via open APIs, avoiding the various standard issues with RIAs (loss of SEO, poor GUI conventions, significant reductions in page views, etc.) and last but far from least, a workable long-term business model beyond tons of unmonetized traffic.&lt;/p&gt;
&lt;p&gt;&lt;img align="right" src="http://hinchcliffe.org/img/ria_masterclass.001.png"&gt;The masterclass itself included a half-day of heavy duty Web 2.0 principles and then 2.25 days of intensive RIA study.  The Web 2.0 portion focused on the main principles as originally espoused by O'Reilly Media when they defined the term and which also forms of the backbone of our popular strategic &lt;a href="http://web20university.com"&gt;Web 2.0 University&lt;/a&gt; courses.  We then consistently tied back the strategic principles to the discussions of the various RIA approaches (Ajax, Silverlight, and JavaFX), such as discussing &lt;a href="http://blogs.zdnet.com/Hinchcliffe/?p=80"&gt;widget delivery models&lt;/a&gt; for RIAs and organizing Web applications around a true Web-Oriented Architecture (WOA) with granular URLs/URIs and creating an applications public and private APIs in &lt;a title="" href="http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm" &gt;REST&lt;/a&gt; or JSON form.  In formal Web 2.0 terms, this is the &lt;em&gt;Lightweight Programming and Business Models principle&lt;/em&gt;, which can really help technical folks begin to map the overarching ideas to specific patterns and practices.  We also had a good group of experienced developers as students, most with some RIA experience, which allowed us to really kick the tires on these technologies.  Finally, we also said we'd create RIA scorecard at the end of the course to see how capable the class as a whole found these various RIA technologies for building Web 2.0 apps.  So far so good...&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Web-Oriented Architecture (WOA) in support of RIA architectures was a fundamental concept that we revisited repeatedly in the masterclass.  Read an &lt;a href="http://blogs.zdnet.com/Hinchcliffe/?p=27"&gt;intro to WOA&lt;/a&gt; as well as our &lt;a href="http://hinchcliffe.org/archive/2006/08/05/8489.aspx"&gt;conception of WOA/Client.&lt;/a&gt;&lt;/strong&lt;/p&gt;
&lt;p&gt;The four RIA models that we covered and compared in-depth were 1) "bare metal" Ajax (without the assistance of a framework or library, 2) &lt;a href="http://asp.net/ajax/"&gt;ASP .NET Ajax&lt;/a&gt;, 3) &lt;a href="http://silverlight.net"&gt;Silverlight 1.0 and 1.1/2.0&lt;/a&gt;, and 4) Sun's &lt;a href="http://www.sun.com/software/javafx/index.jsp"&gt;JavaFX&lt;/a&gt;.  Given that &lt;a href="http://ajaxpatterns.org"&gt;AjaxPatterns.org&lt;/a&gt; currently lists over &lt;a href="http://ajaxpatterns.org/Frameworks"&gt;200 Ajax frameworks&lt;/a&gt;, picking the Ajax framework for the course came down to the practicality of time and we selected ASP .NET Ajax from Microsoft since we were already going to have the development tools in place for Silverlight, which are almost identical to the ones used for ASP .NET Ajax.  Some of you will ask why we didn't cover Flex or Flash, and the answer is mostly that we didn't have a request for it in this course.  We will be adding a &lt;a href="http://www.adobe.com/products/flex/"&gt;Flex and &lt;a href="http://openlaszlo.org"&gt;OpenLaszlo&lt;/a&gt; section shortly to this and bring it out to four total days that will cover the full gamut of the major ways to design and build an RIA.&lt;/p&gt;
&lt;h2&gt;Comparing and Contrasting Pure Ajax, ASP .NET Ajax, Siliverlight and JavaFx&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;img align="right" src="http://hinchcliffe.org/img/ria_masterclass.003.png"&gt;&lt;p&gt;&lt;strong&gt;Pure Ajax&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Not for the faint of heart, building a Rich Internet Application with plain nuts-and-bolts Ajax requires fairly good working knowledge of a slew of browser technologies including the Document Object Model, JavaScript, DHTML techniques, XmlHttpRequest, timer management, CSS, and Web services/SOA/WOA.  While the most compact and high performance result can come out of this, most Web developers will be looking for at least some assistance to elide browser differences, provide a component model and useful components, and handle plumbing, infrastructure, and assist in debugging, which is still in a largely deplorable state in browsers, despite advances such as &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/1843"&gt;Firebug&lt;/a&gt;.  Pure Ajax has a lot of draw however, since it's based on 100% open standards and does not tie you to anyone else's code or to any vendors or organizations (other than standards bodies.)  We had everyone build a "bare metal" Ajax application based on the &lt;a href="http://www.google.com/webhp?complete=1&amp;hl=en"&gt;Google Suggest concept&lt;/a&gt; to see what it's like to develop an RIA using only the capabilities that are built into every common browser today, and no external code, utilities, or libraries.  Most attendees felt this model was going to work best for embedded apps but that it required a lot of effort.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;ASP .NET Ajax&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;A powerhouse of an Ajax framework that I've been &lt;a href="http://hinchcliffe.org/archive/2005/09/18/2192.aspx"&gt;writing about&lt;/a&gt; for a few years now, this framework brings a distinctively Microsoft flavor to the Ajax arena.  Although ASP .NET Ajax has a competent set of controls and even a full Javascript base class library, the strength of this framework is that it's designed to solve some of the tougher issues in building dynamic applications that are fed by server-side APIs.  The UpdatePanel is the "crown jewel" of the ASP .NET Ajax framework (&lt;a href="http://dotnetslackers.com/articles/atlas/The_UpdatePanel_opened_what_happens_behind_the_scenes.aspx"&gt;a good overview here&lt;/a&gt;) that is so compelling that it even has its &lt;a href="http://dotnetslackers.com/articles/ajax/BookReviewAspNetAjaxUpdatePanelControl.aspx"&gt;own book&lt;/a&gt; on the subject.  The essential job of the UpdatePanel?  Specifically, handling the complexity of managing the updates of the visual elements of an Ajax application that are bound to remote Web services.  However, despite the rich functionality designed specifically to simplify the Ajax development process, the GUI editor for ASP .NET Ajax in Visual Studio 2008 is somewhat confusing for the new user and is one of the minor disappointments in an otherwise excellent Ajax product.  ASP .NET Ajax is fairly egalitarian in terms of browser support and the applications it generates run on most major browsers.  For the masterclass, we did an in-depth overview of the platform and built an application that used the UpdatePanel.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;img align="right" src="http://hinchcliffe.org/img/ria_masterclass.004.png"&gt;&lt;p&gt;&lt;strong&gt;Silverlight 1.0 and 1.1/2.0&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Microsoft has been working for years on a Flash competitor that will provide developers with a large set of options for developing capable and compelling RIAs.  While Siliverlight 1.0 only had basic capability in terms of simple animation and media support using Javascript as the primary scriptiong language, Siliverlight 1.1/2.0 (now officially version numbered as 2.0 &lt;a href="http://blogs.msdn.com/tims/archive/2007/11/29/silverlight-1-1-is-now-silverlight-2-0.aspx"&gt;a few weeks ago according to Tim Sneath&lt;/a&gt;) is a completely different animal.  Silverlight 2.0 offers a complete .NET common language run-time in the browser including managed versions of Javascript and Python that will compile to binary on client and run extremely quickly.  Obviously, by supporting Python (and Ruby as well, though not in the current alpha distribution) in the client, Silverlight's CLR in the browser now also support the Dynamic Language Runtime (DLR), making Silverlight have the richest support for RIA client-side languages currently available.  Of course, sporting a lightweight version of .NET and its libraries comes at some cost, particularly download and installation time, but it's surprising at how much they fit into a relatively small footprint that comes in at only a few megabytes.  Combine that will some of the neatest RIA apps I've seen (visit a few of these &lt;a href="http://blogs.msdn.com/tims/archive/2007/07/07/from-a-to-z-50-silverlight-applications.aspx"&gt;50 different Silverlight demo apps&lt;/a&gt;), and Silverlight is well positioned to offer high performance RIAs that provides the broadest set of developer choices as well as potential creative inputs.  Because it will ultimately support so many languages, libraries and code can be reused from a much broader source than has been possible before in RIAs.  Silverlight also has incredible tool support with nearly seamless integration fo Visual Studio 2008 for developers and Expression Blend 2 for designers, which can operate on the same files depending on what you work on: the code or the creative parts of a Silverlight application.  In the course, students used Visual Studio 2008 and Expression Blend 2 December Beta to create controls and applications.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;img align="right" src="http://hinchcliffe.org/img/ria_masterclass.005.png"&gt;&lt;p&gt;&lt;strong&gt;JavaFX&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Far from being left out of the emerging RIA story, Sun has created a very interesting new entry in the RIA space. Designed to leverage the full breadth and depth of the extremely mature and robust &lt;a title="Java" href="http://java.sun.com" &gt;Java&lt;/a&gt; platform, JavaFX is a scripting language that doubles as a declarative programming model.  With the express goal of making it significantly easier to create Rich Internet Applications than it is now with current Java technologies, JavaFX offers some serious productivity-oriented features including: A highly efficient Model-View-Controller (MVC) data binding construct in the scripting language itself, declarative event triggers for assertions and CRUD, and even some cutting edge features such as extents (a notation to let you see all class instances of a certain type) and other mechanisms that will give one some concerns about the sacrifice of long-term code maintenance to the altar of code efficiency, but it's a pretty well thought-out model.  You can see some of the &lt;a href="https://openjfx.dev.java.net/downloads.html#demos"&gt;JavaFX&lt;/a&gt; demo applications here.  For the masterclass, we examined an existing JavaFX application and explored how easy it was to declaratively modify the view of the RIA by changing the data model as well as add new features, triggers, and data bindings.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
While highly efficient Web development platforms have emerged in recent years -- such as the &lt;a href="http://web2.socialcomputingmagazine.com/ruby_on_rails_11_web_20_on_rocket_fuel.htm"&gt;rise of Ruby on Rails&lt;/a&gt; -- to show how much improvement there is to make to our often too general purpose programming environments, it's fascinating to see that the latest approaches, particularly Silverlight and JavaFX have explicit strategies that both focus on productivity-orientation as well as leveraging the vast existing sets of code, tools, and talent.  Declarative approaches are the clearly favored here too, and though procedural coding is also fully supported in ASP .NET Ajax, Silverlight, and JavaFX, much of what RIAs need in terms of design fits extremely well with the declarative model that harkens all the way back to HTML, which forms the pure Ajax duo of XHTML (declarative structure) and JavaScript (application behavior.)&lt;/p&gt;
&lt;p&gt;All in all, the state of the RIA is clearly getting ready to take a major stride forward in 2008 while the options for design Web 2.0 applications with RIA technologies continues to expand significantly.  The RIA scorecard that the inaugural class created showed there all four options have strengths in different areas with Silverlight currently taking the highest overall score.&lt;/p&gt;
&lt;p&gt;Note: For those of you that would like to hold a Web 2.0 Apps RIA Masterclass at your facility or attend one our public deliveries in 2008, &lt;a href="mailto:info@web20university.com"&gt;please contact us&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;Help form a picture of the state of the RIA industry&lt;/h2&gt;
&lt;p&gt;Please take 60 seconds of your time and participate in the RIA survey below so we can get a sense of where things are going in the RIA industry.  Only participants (and the subscribers to the Hinchcliffe Advisory) will get a copy of the data, so it's worth your time, plus you can get a free subscription. Survey closes on January 31st, 2008 and the results will be issued in February.&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;a href="http://www.surveymonkey.com/s.aspx?sm=MFCsXmnW43O1W8jKam_2fSzA_3d_3d"&gt;&lt;img border="0" src="http://hinchcliffe.org/img/ria_survey.007.png"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src ="http://hinchcliffe.org/aggbug/16592.aspx" width = "1" height = "1" /&gt;</description></item></channel></rss>