<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?xml-stylesheet href="http://duncan-cragg.org/css/atom.css" type="text/css" ?>
<!-- Copyright (c) 2006 Duncan Cragg -->

<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
    <id>http://duncan-cragg.org/blog/</id>
    <title>What Not How - Posts tagged 'yaml'</title>
    <subtitle>Duncan Cragg on Declarative Architectures</subtitle>
    <author><name>Duncan Cragg</name></author>
    <logo>/favicon.gif</logo>
    <icon>/favicon.ico</icon>
    <rights>All content including photos and images by Duncan Cragg. Copyright (c) Duncan Cragg, your rights preserved: see /CXL.html</rights>
    <generator uri="http://www.djangoproject.com">A Django Production.</generator>
    <link rel="alternate" type="text/html" href="http://duncan-cragg.org/blog/" title="What Not How" />
    <link rel="self" type="application/atom+xml" href="http://duncan-cragg.org/blog/atom/yaml/" />

    <updated>2007-06-26T15:17:00Z</updated>


    <entry>
        <id>http://duncan-cragg.org/blog/post/how-ruby-can-enable-web-20-platform/</id>
        <title>How Ruby can enable the Web 2.0 Platform</title>
        <published>2007-06-26T15:17:00Z</published>
        
        <updated>2007-06-26T15:17:00Z</updated>
        
        <link rel="alternate" type="text/html" href="http://duncan-cragg.org/blog/post/how-ruby-can-enable-web-20-platform/" title="How Ruby can enable the Web 2.0 Platform" />
        
        <category term="django" />
        
        <category term="web2.0" />
        
        <category term="atom" />
        
        <category term="ajax" />
        
        <category term="yaml" />
        
        <category term="rest" />
        
        <category term="event-driven" />
        
        <category term="publishsubscribe" />
        
        <category term="architecture" />
        
        <category term="declarative" />
        
        <category term="socialsoftware" />
        
        <category term="strest" />
        
        <category term="app" />
        
        <category term="microformats" />
        
        <category term="scalability" />
        
        <category term="json" />
        
        <category term="openid" />
        
        <category term="redux" />
        
        <category term="ruby" />
        
        <summary type="xhtml">
            <div xmlns="http://www.w3.org/1999/xhtml">

<p>

<a href="http://www.oreillynet.com/pub/a/oreilly/tim/news/2005/09/30/what-is-web-20.html">Web 2.0&#39;s definition</a>
includes seeing the Web as an application platform. Which means it
is in competition with Java and .Net, and with SOA, for both local
and widely distributed applications.
</p><p>
If the Web is going to be a platform, the skills you need to learn
to program it are the core Web 2.0 technologies such as Ajax, JSON,
Atom, Microformats and OpenID.
</p><p>
And Ruby. This language, that&#39;s capturing the hearts of many Web 2.0
programmers, is ideal for easing the transition from the Java
and .Net platforms to the Web platform, as I will show.
</p><p>
Even if you&#39;re part of a big company that is generally immune to the
latest trends, the marriage of Ruby and the Web-as-platform may be
something to prepare for. It could even displace your SOA agenda...
 &#160; ...
</p>

            </div>
        </summary>
        <content type="xhtml" xml:space="preserve">
            <div xmlns="http://www.w3.org/1999/xhtml">

<p>
</p><div class="summary"><p>
<a href="http://www.oreillynet.com/pub/a/oreilly/tim/news/2005/09/30/what-is-web-20.html">Web 2.0&#39;s definition</a>
includes seeing the Web as an application platform. Which means it
is in competition with Java and .Net, and with SOA, for both local
and widely distributed applications.
</p><p>
If the Web is going to be a platform, the skills you need to learn
to program it are the core Web 2.0 technologies such as Ajax, JSON,
Atom, Microformats and OpenID.
</p><p>
And Ruby. This language, that&#39;s capturing the hearts of many Web 2.0
programmers, is ideal for easing the transition from the Java
and .Net platforms to the Web platform, as I will show.
</p><p>
Even if you&#39;re part of a big company that is generally immune to the
latest trends, the marriage of Ruby and the Web-as-platform may be
something to prepare for. It could even displace your SOA agenda...
</p></div><p>
Few would disagree that the Ruby language is riding the wave generated
by Ruby-on-Rails. In turn, Rails is riding the Web 2.0 wave, coming
as it does from underpinning the very Web 2.0 
<a href="http://www.37signals.com">37signals</a> 
product suite.  
</p><p>
Rails and Ruby have tapped into the tech Zeitgeist of friendly,
simple and powerful. The speed with which the Ruby and Rails
communities have delivered the key components of Web 2.0 is matched
by the speed at which 
<a href="http://radar.oreilly.com/archives/2007/05/state_of_the_co_10.html">Ruby and Rails books are leaving the shelves</a>.
</p><p>
What is the ideal platform of Web 2.0? Will it be Rails and Ruby?
Will Ruby ride the Web 2.0 wave into the mainstream in the same way
Java rode the Web 1.0 wave?
</p><p>
Well, here&#39;s the problem with that question: Web 2.0 is supposed to
be primarily about the <i>Web</i> itself as the platform, as 
<a href="http://www.oreillynet.com/pub/a/oreilly/tim/news/2005/09/30/what-is-web-20.html">explained first</a>
by Tim O&#39;Reilly and then by a thousand Web 2.0 vendors and industry
watchers after him.
</p><p>
Web-as-platform is not just vendor hype or pundit hand-waving.
Let&#39;s think about what O&#39;Reilly meant by that.
</p><p>&#160;</p><p>
<b>Web as Platform</b>
</p><p>
Web 2.0 is about making the Web more interactive, and thus able to
support applications where Java and .Net would once have been
considered the sole delivery platforms.
</p><p>
The fact that the technologies of the Web can be turned to this
use is a shift with far-reaching implications.
</p><p>
Broadly, the shift we are seeing is from the one-way, static
document delivery of Web 1.0 towards the two-way, dynamic data
exchange of Web 2.0.
</p><p>
This fundamental repurposing is delivering more complex, interactive
applications that work inside our browsers and which fully leverage
the benefits of online operation. 
</p><p>
Web 2.0 is bringing the user and their stuff <i>into</i> the very Web
that they hitherto only passively consumed.  This network-enablement
of the user in turn enables their <i>social</i> networking and their
shared creativity and self-expression. 
</p><p>
Web 2.0 has tapped into a deep human need - a fact reflected in the
vast traffic volumes and correspondingly vast valuations of Web 2.0
startups that we&#39;re currently seeing.
</p><p>
But Web 2.0 is not just for the startups: Enterprise Web 2.0 is
coming! The bigco.com site is going to be looking a little, well,
static and lifeless when compared to the new sites that are
springing up everywhere, and that most of BigCo&#39;s employees are
using. Further, BigCo can gain huge benefits from Web 2.0 approaches
empowering and connecting those employees on the Intranet. And that
Intranet is an ideal platform for deploying company-wide, interactive
applications.
</p><p>
This shift in the Web to two-way dynamic data is being powered by a
set of technologies that a Web platform programmer is going to have
to learn.
</p><p>&#160;</p><p>
<b>Web 2.0 Platform Technologies</b>
</p><p>
Anything that claims to be an application platform must support
data. Web 2.0 is above all the data Web. Web 2.0 is about
semantics, not free text and font sizes. Hence, it inevitably starts
with data-oriented formats such as 
<a href="http://en.wikipedia.org/wiki/XHTML">XHTML</a>, 
<a href="http://www.yaml.org/">YAML</a> and 
<a href="http://json.org/">JSON</a>.  In Web 2.0
more than ever, we talk about data not documents and about
separating data from its presentation.  CSS is big in Web 2.0, for
good reason (not just for gradient fills). Inside the page of a
self-respecting Web 2.0 application, you&#39;ll often find 
<a href="http://microformats.org/">Microformats</a> - again, 
semantics in the page: publishing concise data of widely-understood
standard formats. Some of those Microformats may be 
<a href="http://support.technorati.com/support/siteguide/tags">tags</a>, and in
Web 2.0 the simplest and most powerful semantics are those little
pivot points in Webspace.
</p><p>
Again, if you&#39;re going to be a general purpose platform, you need to
be able to fetch, update, notify and display that data.  Web 2.0
integration usually happens via JSON data structures and 
<a href="http://en.wikipedia.org/wiki/Representational_State_Transfer">REST</a>
interfaces (some of which, especially those based on 
<a href="http://atompub.org/">AtomPub</a>,
are true REST).  Following on from the data-like pages we serve to
browsers, come the data-like feeds we publish to feed readers and to
other applications.  After feeds, the core technology that gives
Web 2.0 its dynamism and interactivity is 
<a href="http://en.wikipedia.org/wiki/Ajax_(programming)">Ajax</a> and 
<a href="http://en.wikipedia.org/wiki/DHTML">DHTML</a>, and
increasingly 
<a href="http://en.wikipedia.org/wiki/Comet_(programming)">Comet</a>
(server push to the browser). The core technology
that gives Web 2.0 its users is increasingly 
<a href="http://openid.net/">OpenID</a>.
</p><p>
All of the above are open technologies. You can do Web 2.0 without
proprietary technologies, just like Web 1.0. Indeed, keeping to the
principles that made the Web successful is also essential to the
success of Web 2.0. The Web platform is the first application
platform that has to consider scalability and interoperability, and
will ignore them at its cost.  I have written before about open
data, use of standard data formats and using REST properly to avoid
creating unscalable, walled-garden sites. You don&#39;t need Flash or
SilverLight, you don&#39;t need vast amounts of custom Javascript, you
don&#39;t need function calls tying you to your servers.
</p><p>&#160;</p><p>
<b>Programming the Web 2.0 Platform</b>
</p><p>
So, we&#39;ve got the dynamic data that you&#39;d expect of a would-be
platform. But how to drive changes in those data? How do we
program the Web platform to animate all this data?
</p><p>
All Rails programmers will know the above technology list; it comes
with the territory. The Web 2.0 Platform can be very succesfully
powered by Rails and Ruby. Ruby and Rails make Web 2.0
applications simple and quick to program, addressing many of the
needs of simple Web 2.0 applications out of the box. There&#39;s little
doubt that Ruby and Rails will have a secure future riding the
Web 2.0 wave.
</p><p>
However, for many Web 2.0 applications, programming may not even be
necessary, at least not in the procedural or imperative style
programmers expect. 
</p><p>
Look back to the early 90&#39;s: &#39;Web 1.0&#39; made a whole class of
applications easy to write without programming: applications for
navigating information. You just wrote in HTML, declaratively.
</p><p>
Now look back at the long path of evolution of Java, through J2EE,
Spring, AOP, IoC, Domain Driven Design, POJOs. All trying to
achieve the simple goal of &#39;remove all that MVC and persistence
stuff and let us concentrate on business or domain objects&#39;. But
they never quite seemed to get it right. 
</p><p>
But then Rails comes along, and has succeeded by simple virtue of
concentrating on easy manipulation of the 
&#39;<a href="http://www.oreillynet.com/pub/a/oreilly/tim/news/2005/09/30/what-is-web-20.html?page=3">Intel Inside</a>&#39;
of Web 2.0 - data. 
</p><p>
It&#39;s reminiscent of the 
&#39;<a href="http://nakedobjects.org/wiki/Main_Page">Naked Objects</a>&#39;
approach to application building with minimal programming (just
business or domain code in POJOs that expose state into the GUI and
are transparently persisted). The 
<a href="http://ajaxian.com/archives/streamlined-naked-objects-for-the-web">Streamlined</a>
project takes Rails even further down this path. Rails&#39; nearest
competitor, <a href="http://www.djangoproject.com/">Django</a>,
has an admin interface that works in a similar way, automatically
generating edit pages based on the data model.
</p><p>
Web 2.0 is about data, about semantics. Web 2.0 is inherently
declarative.  So Web 2.0 applications can be written declaratively -
Web 2.0 mashups can be just wired together and their data animated
by business rules. A bit like programming spreadsheets. 
</p><p>
<a href="http://www.techcrunch.com/2007/03/02/5-ways-to-mix-rip-and-mash-your-data/">Teqlo</a>, 
<a href="http://www.techcrunch.com/2007/04/16/coghead-announces-17000-developers-building-applications-visually/">Coghead</a>, 
<a href="http://www.techcrunch.com/2007/03/02/5-ways-to-mix-rip-and-mash-your-data/">Pipes</a>, 
<a href="http://www.techcrunch.com/2006/03/11/dabbledb-online-app-building-for-everyone/">DabbleDB</a>, 
<a href="http://www.techcrunch.com/2007/06/19/new-site-jumps-into-the-application-creation-space/">LongJump</a>, 
<a href="http://www.techcrunch.com/2007/05/18/microsoft-launches-popfly-mashup-app-creator-built-on-silverlight/">Popfly</a>, 
<a href="http://www.techcrunch.com/2006/08/21/salesforce-dives-deep-into-google-adwords/">AppExchange</a> and
<a href="http://www.techcrunch.com/2006/04/30/wyaworks-app-builder-for-non-coders/">Wyaworks</a> 
are all examples of the different ways to program the new Web 2.0
platform without imperative code.
</p><p>
That&#39;s what we mean by Web-as-platform - not only is the underlying
programming language irrelevant, it will often not even be needed,
certainly for simple data manipulation applications and for many
simple mashups. Being RESTful gives you a massive head start in
this, of course.
</p><p>
While Rails is already in the game with its innate understanding of
Web 2.0 techniques and philosophies, Ruby itself has a huge amount
to offer the would-be declarative programmer, who is making the
transition to this new Web platform from their traditional Java
or .Net platform.  In particular, it is easy to write your domain
logic in a declarative style in Ruby: they call them &#39;DSLs&#39; these
days, but the idea is the same in most examples I&#39;ve seen.
</p><p>&#160;</p><p>
<b>Web 2.0 - The Web Redux</b>
</p><p>
Now, if you&#39;ve been following this blog, you&#39;ll know I have a
few opinions on 
<a href="http://duncan-cragg.org/blog/post/right-way-to-do-ajax-is-declaratively/">Declarative Web 2.0</a> and on
<a href="http://duncan-cragg.org/blog/post/distributed-observer-pattern-rest-dialogues/">patterns for programming REST</a>.
Essentially I argue that, if you want to play in the Web 2.0
platform game, you don&#39;t want to be writing screeds of Javascript
functions that call more functions on your servers. 
</p><p>
I recently presented some ideas along these lines at
the WWW2007 conference, entitled 
&#39;<a href="http://www2007.org/prog-Developers.php#saturday">The Micro Web: putting the Web back into Web 2.0</a>&#39;,
where I also showed a demo written in Python.
</p><p>
This approach combines my 
<a href="http://duncan-cragg.org/blog/post/distributed-observer-pattern-rest-dialogues/">Distributed Observer Pattern</a>
with Comet push to enable highly dynamic Web 2.0 applications to be
coded RESTfully and declaratively, with zero Javascript.  The
Distributed Observer Pattern offers a clean programming model for
animating the Web 2.0 dynamic-data technology set I described above. 
</p><p>
I believe the Observer Pattern is core to the way we&#39;ll be
programming when the Web 2.0 Platform hits mainstream.  It enables
the kind of event- and rule-driven programming that matches the
characteristics of the Web 2.0 dynamic data platform. As a 
further killer benefit, it also directly addresses the optimal
utilisation of multicore processors.
</p><p>
I am currently porting my Python implementation of this approach to
Ruby, in the
<a href="http://rubyforge.org/projects/redux/">Redux</a> 
project on Rubyforge.  Redux stands for &#39;Ruby Event-Driven Update
Exchange&#39;.  It uses the highly scalable
<a href="http://rubyforge.org/projects/eventmachine">EventMachine</a>
epoll-based event loop to power its event-driven architecture.
This will be essential when Redux is asked to scale up a 
Comet-based application.
</p><p>
Like Rails, Redux will be a Web (2.0) application framework, but
unlike Rails, it puts the Observer Pattern and event- and
rule-driven programming at its core. 
</p><p>
Redux&#39;s headline is &#39;Web 2.0 in-a-box&#39; or &#39;Naked Objects on the Web&#39;.
</p><p>&#160;</p><p>
<b>Conclusion</b>
</p><p>
If you&#39;re in BigCo, and are responsible for setting BigCo&#39;s
technical strategy, then train your Java devs up on Web 2.0 core
technologies such as Ajax, JSON, Atom, Microformats and OpenID.  
</p><p>
And fire up their enthusiasm by tapping into Ruby (perhaps via
JRuby) on your way to the Web 2.0 platform. 
</p><p>
Learn patterns for mashing and integrating. Learn about REST and
event- and rule-driven programming, including declarative DSLs.
</p><p>
When this Web platform hits BigCo, you will probably find that its
REST or ROA style make your SOA integration strategy look rather
complex and unweildy.
</p><p>
Check out the
<a href="http://duncan-cragg.org/blog/post/distributed-observer-pattern-rest-dialogues/">Distributed Observer Pattern</a>,
and download
<a href="http://rubyforge.org/projects/redux/">Redux</a>
when it&#39;s done (I&#39;ll let you know if you subscribe here!).
</p><p>
In 2007 and beyond, its the Web itself that&#39;s the platform, not
Java or .Net. But if you want to get there via a language-based
platform, Ruby could be the best way to transition to it.
</p><p>
<i>Note: Everything I said about Ruby and Rails applies equally in
technical terms to Python and Django, but regardless of the
significant benefits of the latter, Ruby and Rails have the Web 2.0
market and mindshare. I&#39;ll probably switch this blog from Django to
Redux sometime this year..</i>
</p><p>
<i>(c) 2007 Duncan Cragg</i>
</p><p>

</p>

            </div>
        </content>
    </entry>
    
    <entry>
        <id>http://duncan-cragg.org/blog/post/lighter-wins-2007/</id>
        <title>Lighter-than Wins in 2007</title>
        <published>2007-01-18T11:12:00Z</published>
        
        <updated>2007-01-18T11:12:00Z</updated>
        
        <link rel="alternate" type="text/html" href="http://duncan-cragg.org/blog/post/lighter-wins-2007/" title="Lighter-than Wins in 2007" />
        
        <category term="cyberspace" />
        
        <category term="architecture" />
        
        <category term="declarative" />
        
        <category term="web2.0" />
        
        <category term="yaml" />
        
        <category term="identity" />
        
        <category term="app" />
        
        <category term="microformats" />
        
        <category term="ajax" />
        
        <category term="rest" />
        
        <category term="atom" />
        
        <category term="json" />
        
        <category term="openid" />
        
        <category term="rajmo" />
        
        <summary type="xhtml">
            <div xmlns="http://www.w3.org/1999/xhtml">

<p>

What do all the MAJOR Web 2.0 technologies of 2007 have in
common? 
</p><p>
Let me list them first:
</p><pre>
    M.icroformats (including tags)
    A.jax (including Comet)
    J.SON (plus YAML)
    O.penID (plus SXIP, LID, Yadis)
    R.EST (including Atom, APP)
</pre><p>
What these technologies have in common is that they&#39;re
all <i>lighter</i> than their competitors:
</p><table class="two-col-table"><tr><td><p>Microformats </p></td><td><p> Lighter than the Semantic Web</p></td></tr>
<tr><td><p>Ajax </p></td><td><p> Lighter than Fat Client (!)</p></td></tr>
<tr><td><p>JSON </p></td><td><p> Lighter than XML</p></td></tr>
<tr><td><p>OpenID </p></td><td><p> Lighter than SAML/Liberty Alliance</p></td></tr>
<tr><td><p>REST </p></td><td><p> Lighter than SOA</p></td></tr>
</table><p>
 &#160; ...
</p>

            </div>
        </summary>
        <content type="xhtml" xml:space="preserve">
            <div xmlns="http://www.w3.org/1999/xhtml">

<p>
</p><div class="summary"><p>
What do all the MAJOR Web 2.0 technologies of 2007 have in
common? 
</p><p>
Let me list them first:
</p><pre>
    M.icroformats (including tags)
    A.jax (including Comet)
    J.SON (plus YAML)
    O.penID (plus SXIP, LID, Yadis)
    R.EST (including Atom, APP)
</pre><p>
What these technologies have in common is that they&#39;re
all <i>lighter</i> than their competitors:
</p><table class="two-col-table"><tr><td><p>Microformats </p></td><td><p> Lighter than the Semantic Web</p></td></tr>
<tr><td><p>Ajax </p></td><td><p> Lighter than Fat Client (!)</p></td></tr>
<tr><td><p>JSON </p></td><td><p> Lighter than XML</p></td></tr>
<tr><td><p>OpenID </p></td><td><p> Lighter than SAML/Liberty Alliance</p></td></tr>
<tr><td><p>REST </p></td><td><p> Lighter than SOA</p></td></tr>
</table><p>
</p></div><p>
I&#39;m reminded of Tim Bray&#39;s 
<a href="http://www.tbray.org/ongoing/When/200x/2004/01/03/TPM1">Technology Predictor Success Matrix</a>
and his appreciation of the 
<a href="http://www.tbray.org/ongoing/When/200x/2004/01/14/TPSM-8020">80:20 phenomenon</a>.
If hitting the sweet spot of achieving a lot with only a little
is the main test of potential, then these five Web 2.0
technologies are all set for success.
</p><p>
So it&#39;s no surprise to see Tim supporting
<a href="http://www.tbray.org/ongoing/When/200x/2006/06/07/Microformats">Microformats</a>
<a href="http://www.tbray.org/ongoing/When/200x/2006/01/08/No-New-XML-Languages">once or</a>
<a href="http://www.tbray.org/ongoing/When/200x/2005/10/06/Whats-Happening">twice</a>
and even
<a href="http://www.tbray.org/ongoing/When/200x/2006/12/21/JSON">JSON</a>,
in spite of his, um, XML background. He also understands and uses
<a href="http://www.tbray.org/ongoing/When/200x/2006/04/19/The-Cost-of-AJAX">Ajax</a>
and backs
<a href="http://www.tbray.org/ongoing/When/200x/2004/09/18/WS-Oppo">REST</a>
(in particular via <a href="http://www.tbray.org/ongoing/When/200x/2005/11/21/Atom-Status">Atom</a>).
Tim has not yet mentioned OpenID, instead referring to 
<a href="http://www.tbray.org/ongoing/When/200x/2006/04/28/SAML-Days">SAML</a> and 
<a href="http://www.tbray.org/ongoing/When/200x/2005/05/15/WS-Federation">Liberty Alliance</a>
(please don&#39;t be crass by leaving a comment speculating on the reason for this...).
</p><p>
These MAJOR Web 2.0 technologies should form the basis of
the two-way, interactive data Web or the Web-as-a-platform
vision that we&#39;ve all been promised.
</p><p>
However, they will need taking a little further this year, in
order to bring them closer together and to make this vision
happen in a seamless way.
</p><p>
A synergy between these 80:20 technologies can potentially
produce much more than just the &#39;next version of the Web&#39;, if
engineered well.
</p><p>
I have already discussed the 
<a href="http://duncan-cragg.org/blog/post/microformats-challenge-web-feeds-and-web-apis/">Subversive Microformat</a>,
I&#39;ve promoted
<a href="http://duncan-cragg.org/blog/post/right-way-to-do-ajax-is-declaratively/">Declarative Ajax</a>
and currently I&#39;m slowly working up to 
<a href="http://duncan-cragg.org/blog/post/getting-data-rest-dialogues/">Symmetric REST</a>.
</p><p>
Next up, I&#39;ll be asking you to consider a web of
<a href="http://www.google.com/search?q=json+microformat&amp;num=100">JSON Microformats</a>
and ways to merge
<a href="http://www.google.com/search?q=hcard+openid&amp;num=100">hCard and OpenID</a>
into active user personas - even avatars...
</p><p>
<i>I&#39;ll tag this acronym as &#39;<a href="http://technorati.com/tag/rajmo">rajmo</a>&#39;
instead of &#39;major&#39;, for obvious reasons.</i>
</p><p>

</p>

            </div>
        </content>
    </entry>
    
    <entry>
        <id>http://duncan-cragg.org/blog/post/excuse-me-did-you-say-web-services/</id>
        <title>Excuse me - did you say &#39;Web&#39; Services?</title>
        <published>2006-05-17T00:27:00Z</published>
        
        <updated>2006-05-17T00:27:00Z</updated>
        
        <link rel="alternate" type="text/html" href="http://duncan-cragg.org/blog/post/excuse-me-did-you-say-web-services/" title="Excuse me - did you say &#39;Web&#39; Services?" />
        
        <category term="architecture" />
        
        <category term="declarative" />
        
        <category term="web2.0" />
        
        <category term="yaml" />
        
        <category term="rest" />
        
        <category term="atom" />
        
        <summary type="xhtml">
            <div xmlns="http://www.w3.org/1999/xhtml">

<p>

Distributing an application over a network isn&#39;t just a case
of splitting it down a natural line and putting a network
in-between. What works in-process simply doesn&#39;t work so 
well across the wire.
</p><p>
And just calling such an Internet version of application and
process interfaces &#39;Web&#39; Services doesn&#39;t mean it has anything
at all to do with the Web, or that it in any way shares the
Web&#39;s scalability, flexibility and robustness.
</p><p>
Indeed, I claim that you cannot distribute without also 
&#39;inverting&#39;; you have to face what I call the 
&#39;Imperative-to-Declarative Inversion&#39;, if you really want a 
successful, scalable, distributed application.  
</p><p>
Declarative Architectures such as REST (i.e. the Web, and now
&#39;Web 2.0&#39;) dominate the broader Internet.
 &#160; ...
</p>

            </div>
        </summary>
        <content type="xhtml" xml:space="preserve">
            <div xmlns="http://www.w3.org/1999/xhtml">

<p>
</p><div class="summary"><p>
Distributing an application over a network isn&#39;t just a case
of splitting it down a natural line and putting a network
in-between. What works in-process simply doesn&#39;t work so 
well across the wire.
</p><p>
And just calling such an Internet version of application and
process interfaces &#39;Web&#39; Services doesn&#39;t mean it has anything
at all to do with the Web, or that it in any way shares the
Web&#39;s scalability, flexibility and robustness.
</p><p>
Indeed, I claim that you cannot distribute without also 
&#39;inverting&#39;; you have to face what I call the 
&#39;Imperative-to-Declarative Inversion&#39;, if you really want a 
successful, scalable, distributed application.  
</p><p>
Declarative Architectures such as REST (i.e. the Web, and now
&#39;Web 2.0&#39;) dominate the broader Internet.
</p></div><p>
Take a simple application: calendar events. Let&#39;s first see
what the Web Services approach is to distribution...
</p><p>
We&#39;ll start with an object-oriented calendar events class that
hides the data and gives us methods to read from and write to
it, plus some methods to add and subtract days, to calculate
the number of seconds till due, etc.  The calendar class
interface is public and its data is encapsulated and private.
</p><p>
Now let&#39;s put this calendar event class on the Internet.  We
run up a Web Service that makes our calendar event class look
much like it did before, with methods or, in fact, functions
exposed by an interface. We lose a bit of object-orientation,
but that is considered acceptable these days, after some 
bitter experiences with CORBA...
</p><p>
In fact, synchronicity is also frowned upon these days after
similar lessons of the past. So let&#39;s help our Web Service a
little by making it asynchronous.  We&#39;ll drop off our commands
and either come back every so often to see if they&#39;re done, or
wait for a callback to tell us so.  Instead of many synchronous
functions, we have message schemas describing jobs, along with
the needed data.  Results come back as messages, too.  The
public message interface still talks of actions and functions
that can be called or invoked. However, it acknowledges the
constraints of the network by running asynchronously and by
having coarser-grained functions: the messages are chunkier
now, perhaps called &#39;documents&#39;.
</p><p>
The difference with the distributed version is the noticable
lag in interaction and the demise of the service when
disconnected or under network outages. But it&#39;s acceptable on a
good LAN connection.
</p><p>
Now, look at the benefits. Our calendar events application can
be shared (very important for calendars). It&#39;s available and
accessible to other applications on the network. Someone else
can manage it, who are perhaps better at it than us. It can
be accessed regardless of operating system and programming
language.  A number of authorized users or clients can create,
manage, process calendar events. 
</p><p>
It may even be possible to <i>export</i> calendar events. The Web
Service might have getCalendarEvent(id), getCalendarEvents(date),
etc. request messages - and may return XML documents now that
it uses a chunkier, message- or document-based interface.  This
doesn&#39;t necessarily break encapsulation because the syntax of
the exposed data is considered part of the interface, with
standards, versioning, contracts, etc.
</p><p>
We&#39;re now pretty much up-to-date with the latest and/or best 
practice in the Web Services industry.  Rich, versioned
invocation interfaces (WSDL, Message Schemas), hidden or
encapsulated data.
</p><p>&#160;</p><p>
<b>&#39;Web&#39; Services??</b>
</p><p>
The above scenario is fine for small-scale, self-contained 
applications shared by a handful of regular clients.
</p><p>
But what if you actually want to publicise your calendar 
events?  How do you advertise them and share them somewhere; 
somewhere like the Web?
</p><p>
Unfortunately the model fails us now: hidden data = outside of 
the Web!
</p><p>
Hidden data means no URLs. So how do you pass around a 
generally-understood reference, not to the service, but to a 
calendar event <i>on</i> the service? How do you index it?  Google 
indexes pages, not services. How, indeed do you bookmark it?
</p><p>
Hidden data means no caches.  Web Services standards don&#39;t
concern themselves with cacheing.  Cacheing is implemented in
an ad-hoc manner because it&#39;s outside the model.
</p><p>
So scaling our calendar service for wide publishing 
can&#39;t be done with caches like it is on the Web (or by 
BitTorrent). It can only be done at the service operator, by 
adding fatter pipes and fatter machines.
</p><p>
This is where the &#39;Web&#39; of &#39;Web Services&#39; starts to look like a 
serious misnomer.  There&#39;s none of the scalability and 
interoperability of the Web, <i>because the data&#39;s hidden</i>!
</p><p>
You can&#39;t index it, bookmark it or advertise it; you can&#39;t 
cache it.
</p><p>
Clients of the &#39;Web&#39; Service may end up screaming to be able
to see their locked-up data and to break the rules of
encapsulation. To start to realise some of the proven
benefits of the Web itself, which is hugely scalable,
bookmarkable, indexable, linkable, cacheable.
</p><p>
Just having getCalendarEvent(id), etc. export functions
doesn&#39;t make you part of the Web - and the incentive to export
to a known MIME type and schema is low when the whole of the
rest of the interface is defined for this particular service.
</p><p>
Oh - and WS-Addressing and WS-Transfer may create a parallel
WS-Web, but it&#39;s not the one most of us will be using.
</p><p>&#160;</p><p>
<b>Public Data and Open Formats are OK!</b>
</p><p>
The Web has shown us that, in contrast to the hidden data of
object-oriented programming, <i>public data and open formats are
not only OK, they&#39;re incredibly desirable</i>.
</p><p>
On the Web, data replaces service as our &#39;public interface&#39;.
And data thereby tends towards standard, stable or open formats.
</p><p>
Our service interface to the calendar event objects can be
replaced by publicly-visible calendar event resources - perhaps
in the open <a href="http://microformats.org/wiki/hcalendar">hCalendar</a>
XML format. (You can choose YAML instead of XML if you want, 
and you can restrict access if you want - I mean &#39;public&#39; or 
&#39;open&#39; data in principle.)
</p><p>
These calendar events are each given a URL and we tell everyone 
what to expect them to look like.  The layout of the data is
now our interface, and we have to apply the same rules of 
standards, versions, etc. that applied to our service 
interface.
</p><p>
They may be fetched using GET, and updated using POST.  The
data derivatives, such as time-till-due, can be added to
our open format, retrieved by a separate query URL, or simply
calculated by the client given the basic information.  Many
people may be authorised to edit them via POST, including 
adding and subtracting days or moving the time forward an 
hour.
</p><p>
Perhaps they could be &#39;Atomised&#39;, using the Atom Publishing 
Protocol to read and update them and an Atom feed for when
events become due or for when they&#39;ve been updated, etc.
</p><p>&#160;</p><p>
<b>Due Diligence</b>
</p><p>
Naturally, before jumping headlong into such a Web-enabled 
world, we must show due diligence over the costs of this 
approach. 
</p><p>
The main cost as seen by object-oriented programmers is that
they have lost the ability for the class or application to
change the internal data format or representation of calendar
events without users seeing anything different in the
application or object interface. 
</p><p>
Of course, if at some point the data <i>is</i> exposed (whether
exporting or serializing an object), then the need for
versioning thwarts this benefit anyway in practical terms.
Indeed, <i>whatever</i> is public needs to be controlled, agreed
and versioned, whether it&#39;s our new data interface or the old
service interface. We&#39;ve just moved the constraint over.
</p><p>
Now, the data we&#39;re talking about exposing is not that inside
some low-level library which has nothing to do with the domain
of calendar events itself. Object-oriented tenets, and the
Abstract Data Types that preceded them, undoubtedly have a
value at these lower levels, where function-based APIs are
ubiquitous and programmers need to leave themselves some
breathing room behind the API to improve the implementation.
</p><p>
No, calendar events are a <i>domain</i> concept, not an implementation 
concept.  Unlike users of implementation classes, domain users
do care about the basic structure of their domain entities. 
</p><p>
Indeed, users <i>only</i> fully understand &#39;what&#39;, not &#39;how&#39;; they
need to talk in terms of tangible things first, then the 
evolutions and constraints of those things second. They may 
never, and arguably should never, understand the mapping from
those domain concepts that they understand into the threads and 
processes that programmers understand.
</p><p>
That&#39;s why there&#39;s so much business analysis that goes straight 
into database design, so much business analysis that goes 
straight into user interface design, so much domain analysis 
that goes into ontologies and message schemas.  Business or domain 
level data will always be openly discussed: there&#39;s no reason 
not to expose and constrain domain data structures. 
</p><p>
In fact, some of the key features of object-oriented 
programming map perfectly well to a purely data-oriented 
analysis.  Inheritance, &#39;Duck Typing&#39;, Polymorphism, and even 
forms of data Encapsulation are all possible at the domain data 
level. This is the subject of another article, however...
</p><p>&#160;</p><p>
<b>The Inversion</b>
</p><p>
Now that our calendar event data is opened, the data has become 
more important than the application.  The importance of our 
shared data is underlined by its acquiring a URL: a universal 
handle on it.
</p><p>
You could even see the application as &#39;animating&#39; the data from 
within (you only see the changes to the data, not how it 
happened, which tool was used client-side or server-side).
</p><p>
We have gone from public process wrapper around hidden state to 
public state animated by hidden process.
</p><p>
<i>This is the Imperative-to-Declarative Inversion.</i>
</p><p>
And moving stuff to the Internet is one of the quickest ways 
to feel the Force of Inversion!  By joining the Web community,
we get the benefits of bookmarkable, indexable, linkable,
scalable and cacheable calendar events.
</p><p>
The fact is, the Internet is driven by data and events, not 
service interfaces.  Distributed systems must face the 
Imperative-to-Declarative Inversion if they want to join
the community of widely-deployed, scalable and successful
systems that run over the Internet.  
</p><p>
Imperative, Service-Oriented Architectures, &#39;Web&#39; Services and 
SOAP will always be limited to small-scale deployments sold by 
the vendor consortia.
</p><p>
Declarative Architectures and REST will continue to dominate
the broad Internet.
</p><p>

</p>

            </div>
        </content>
    </entry>
    
</feed>

