<?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 'publishsubscribe'</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/publishsubscribe/" />

    <updated>2007-10-05T11:22:00Z</updated>


    <entry>
        <id>http://duncan-cragg.org/blog/post/google-micro-conference/</id>
        <title>Google Micro Conference</title>
        <published>2007-10-05T11:22:00Z</published>
        
        <updated>2007-10-05T11:22:00Z</updated>
        
        <link rel="alternate" type="text/html" href="http://duncan-cragg.org/blog/post/google-micro-conference/" title="Google Micro Conference" />
        
        <category term="web2.0" />
        
        <category term="atom" />
        
        <category term="ajax" />
        
        <category term="rest" />
        
        <category term="event-driven" />
        
        <category term="publishsubscribe" />
        
        <category term="p2p" />
        
        <category term="architecture" />
        
        <category term="declarative" />
        
        <category term="app" />
        
        <category term="microformats" />
        
        <category term="scalability" />
        
        <category term="json" />
        
        <category term="openid" />
        
        <category term="microweb" />
        
        <category term="google" />
        
        <summary type="xhtml">
            <div xmlns="http://www.w3.org/1999/xhtml">

<p>

Last night&#39;s 
<a href="http://osjam.truemesh.com/">Google London Open Source Jam</a>
(also <a href="http://www.red-bean.com/ospowiki/LondonOpenSourceJam05Talks">here</a>)
was on the subject of the &#39;Web&#39; (didn&#39;t they invent that? Oh no,
that was Microsoft).
</p><p>
This event has been getting better and better each time I&#39;ve
attended. There were some very interesting lightning talks held
together with a tight structure and plenty of chance to chat,
drink cold Leffe and eat cold pizza. And nick [<i>transatlantic
translation: &#39;steal&#39;</i>] the 
<a href="http://www.greenandblacks.com/uk/productdetails.php?pageid=27&amp;cid=6&amp;pid=11">Green &amp; Black&#39;s chocolate</a>.
</p><p>
An ideal Micro Conference...
 &#160; ...
</p>

            </div>
        </summary>
        <content type="xhtml" xml:space="preserve">
            <div xmlns="http://www.w3.org/1999/xhtml">

<p>
</p><div class="summary"><p>
Last night&#39;s 
<a href="http://osjam.truemesh.com/">Google London Open Source Jam</a>
(also <a href="http://www.red-bean.com/ospowiki/LondonOpenSourceJam05Talks">here</a>)
was on the subject of the &#39;Web&#39; (didn&#39;t they invent that? Oh no,
that was Microsoft).
</p><p>
This event has been getting better and better each time I&#39;ve
attended. There were some very interesting lightning talks held
together with a tight structure and plenty of chance to chat,
drink cold Leffe and eat cold pizza. And nick [<i>transatlantic
translation: &#39;steal&#39;</i>] the 
<a href="http://www.greenandblacks.com/uk/productdetails.php?pageid=27&amp;cid=6&amp;pid=11">Green &amp; Black&#39;s chocolate</a>.
</p><p>
An ideal Micro Conference...
</p></div><p>
I arrived late (it starts at 6pm) and spent some time catching up with
<a href="http://www.flickr.com/photos/92443667@N00/1488471991/in/set-72157602268864450/">ex-Thoughtworks colleagues</a>,
so I missed Dion &quot;Ajaxian&quot; Almaer&#39;s 
<a href="http://www.slideshare.net/dion/future-of-web-apps-google-gears">Google Gears slideset from FOWA</a>.  
Go there now and check it out.
</p><p>
Thus the first talk I saw
was a nifty piece of widgetry by Steven Goodwin called 
<a href="http://www.bluedust.com/minerva/">WARP</a>. In WARP, interacting with a page of
&#39;applets&#39; changed the URL to encode those applets&#39; current state. If
you link to the current page, it will always show that state.
Very long URLs, you can imagine. None of that fancy Ajax stuff.
RESTful, dare I say. Nice API server-side for unpacking your
applet params. 
</p><p>
A trip to the lavatories [<i>transatlantic translation:
&#39;restroom&#39;/&#39;bathroom&#39;</i>] revealed that they are, indeed, doing that
<a href="http://googletesting.blogspot.com/2007/01/introducing-testing-on-toilet.html">Testing in the Toilet</a>
project in Google. It works, too! I learned something. Other intelligence on
Google&#39;s Inner Workings include confirmation of the beanbags and of
the high quality, free grub to which I have already alluded.
</p><p>
A nice bloke from Yahoo! (<a href="http://kid666.com/blog">Tom Hughes-Croucher</a>:
another spy?) came along to sell his idea that, in the
collaborative world of open-minded hackers, we who run websites
could help each other with our 404s. If I get a 404, I use the
referrer link to tell you, via some RESTful POST, that your link to
me is bust (assuming I don&#39;t intend to fix it myself).
</p><p>
I think the world is a little more selfish, so you need to decide
who hurts more - the site who sends their visitors to a dead-end,
or the site delivering that dead-end to a new visitor. I suspect
the latter, by a small margin, as it&#39;s not exactly a nice welcome.
So it&#39;s up to them to let the new visitor down more gently, and to
notify the publisher of the broken link with little or no cost to
them. For example, a really sociable 404-ing site could just
redirect the hapless visitor back to the referring page, adding
&#39;?broken=links&#39; to the URL - hopefully to be picked up by log
scanning scripts at the referring site.
</p><p>
Next up, <a href="http://duncan-cragg.org/">yours truly</a> taking 
<a href="http://www2007.org/prog-Developers.php#saturday">yet another chance</a>
to promote his excellent 
<a href="http://the-u-web.org">Micro Web</a> thingy. 
Couple of people asked about it afterwards - including that nice
chap from Yahoo! Also, a smart - and nice - chap called Toby 
(<a href="http://www.thetobe.com/">this one?</a>) got me into a deep discussion
on imperative vs. event-driven vs. state-driven programming. He was
apparently an old-timer like me, as he was able to engage in
dewy-eyed Functional Programming recollections. I managed to give
out about four full colour printouts about the
<a href="http://the-u-web.org">Micro Web</a>, 
and to collect some good calling cards.
</p><p>
However, <a href="http://joe.truemesh.com">Joe Walnes</a>, even a pint down in
the pub afterwards, still refused to sign up for Micro Web duties.
This in spite of over three years of intensive lobbying, including
eight months of me working Trojan-horse-like in his kitchen, on The 2005
Implementation.
</p><p>
Another ex-Thoughtworks colleague, 
<a href="http://www.pubbitch.org/blog">Simon Stewart</a>
took yet another chance to promote his promising
<a href="http://code.google.com/p/webdriver/">Webdriver</a> thingy. And a very
interesting project it is becoming. Still needs more work - on IE
support, etc - but I&#39;ll probably be using it in my new job at the
<a href="http://www.ft.com">Financial Times</a>.
</p><p>
Another ex-Thoughtworks colleague, 
<a href="http://abc.truemesh.com/">Chris Matts</a> took a chance to promote
his and Andy Pols&#39; interesting new
<a href="http://demo.pols.co.uk/dream/">Dream Machine</a> thingy.
Perhaps a bit like <a href="http://www.cambrianhouse.com">Cambrian House</a> - you put 
your dreams and ideas into it and people expand on them.
Chris is a natural on-stage - and even used the age-old trick of
promising lots of money for no effort, to get our attention at the start.
</p><p>
All I could come up with for the <a href="http://the-u-web.org">Micro Web</a>
was &#39;Cheaper, Wider, Faster&#39;...
</p><p>&#160;</p><p>
<i>Updated: added reference to Dion Almaer, details about WARP, swapped in the 
picture of TWers that I was waiting for and fixed a minor blunder thanks to that 
ever-sharp ThoughtWorker,  
<a href="http://dan.bodar.com/">Dan Bodart</a>..</i>

</p>

            </div>
        </content>
    </entry>
    
    <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/distributed-observer-pattern-rest-dialogues/</id>
        <title>The Distributed Observer Pattern | The REST Dialogues</title>
        <published>2007-06-20T22:42:00Z</published>
        
        <updated>2007-06-20T22:42:00Z</updated>
        
        <link rel="alternate" type="text/html" href="http://duncan-cragg.org/blog/post/distributed-observer-pattern-rest-dialogues/" title="The Distributed Observer Pattern | The REST Dialogues" />
        
        <category term="architecture" />
        
        <category term="declarative" />
        
        <category term="strest" />
        
        <category term="publishsubscribe" />
        
        <category term="app" />
        
        <category term="microformats" />
        
        <category term="dialogue" />
        
        <category term="event-driven" />
        
        <category term="rest" />
        
        <category term="atom" />
        
        <summary type="xhtml">
            <div xmlns="http://www.w3.org/1999/xhtml">

<p>

In an exclusive nine-part dialogue with <i>an imaginary eBay
Architect</i>, we present an accessible discussion of the 
REST vs. SOA issue.
</p><p>
Although eBay have what they call a &#39;REST&#39; interface, it is, in
fact, a 
<a href="http://duncan-cragg.org/blog/post/strest-service-trampled-rest-will-break-web-20/">STREST</a>
interface, and only works for a few of the many function calls
that they make available via SOAP (GetSearchResults, GetItem,
GetCategoryListings, etc).
</p><p>
In this <a href="http://duncan-cragg.org/blog/post/getting-data-rest-dialogues/">dialogue series</a>,
I argue the case for eBay to adopt a truly REST approach to
their integration API. 
</p><p>
<b>Part 5: The Distributed Observer Pattern</b>
 &#160; ...
</p>

            </div>
        </summary>
        <content type="xhtml" xml:space="preserve">
            <div xmlns="http://www.w3.org/1999/xhtml">

<p>
</p><div class="summary"><p>
In an exclusive nine-part dialogue with <i>an imaginary eBay
Architect</i>, we present an accessible discussion of the 
REST vs. SOA issue.
</p><p>
Although eBay have what they call a &#39;REST&#39; interface, it is, in
fact, a 
<a href="http://duncan-cragg.org/blog/post/strest-service-trampled-rest-will-break-web-20/">STREST</a>
interface, and only works for a few of the many function calls
that they make available via SOAP (GetSearchResults, GetItem,
GetCategoryListings, etc).
</p><p>
In this <a href="http://duncan-cragg.org/blog/post/getting-data-rest-dialogues/">dialogue series</a>,
I argue the case for eBay to adopt a truly REST approach to
their integration API. 
</p><p>
<b>Part 5: The Distributed Observer Pattern</b>
</p></div><p>
</p><p>
<b>eBay Architect:</b> So, can you summarise your argument that &#39;REST
isn&#39;t just about reading and writing data&#39;, and explain your
view on RESTful business logic?
</p><p>
<b>Duncan Cragg:</b> OK. The whole collection of related resources
determines where things stand at any given time. 
</p><p>
Resources are masters of their own destiny - guided by rules
declared in the standard to which their content type conforms.
</p><p>
These rules, or business logic, run on notification of any
declarations of the state of peer resources, or on arrival of
any state via POST. Such peer states and POSTs are <i>not</i>
commands, although it is possible to go ahead and define a 
special command or edit command content type.
</p><p>
The rules aim to satisfy the business or domain constraints on
the mutual states of these resources - updating and creating
resources accordingly and causing appropriate side-effects
outside the server, such as financial transactions and emails.
</p><p>
These transformations are state driven. Even though the
&#39;tension&#39; in unresolved rules may be <i>detected</i> by events,
that tension <i>exists</i>, not in those events as such, but in
resource state.
</p><p>
<b>eA:</b> That sounds like a core difference to SOA.
</p><p>
<b>DC:</b> Indeed. It&#39;s a Resource-Oriented Architecture. And ROAs
are declarative, not imperative like SOAs.
</p><p>
We have a world of resources declaring their current state, and
resources settling into new states depending on the current
state of related resources. These state changes can be
driven by hard-coded resource animation logic, or by simpler,
clearer, more scalable, declarative state transformation rules.
</p><p>
<b>eA:</b> Remind me of those patterns for notifying state change.
</p><p>
<b>DC:</b> Resource states are either polled via GET or actively
notified via POST.  Such actively POSTed state could be from a
resource that also happens to be GETable, could be simply a link to
such a resource, or could cause such a GETable resource to be
created on the target server.  Alternatively, the POSTed state
could be considered too transient to record in a GETable
resource, but can still trigger transformation in its target
resource.
</p><p>
The above eBay examples used the pattern of &#39;server creates
GETable copy of POSTed resource&#39;, and also &#39;second server
hosts GETable copy of POST-notified resource&#39;.
</p><p>
What I have described is a general programming model because,
in general, such simple, declarative, transformational
mechanisms are Turing Complete.
</p><p>
<b>eA:</b> I&#39;m sure it&#39;s a novel perspective - even to RESTians!
Again, do you have any high-level RESTian support for this?
</p><p>
<b>DC:</b> Any web resource that is a derivative of, or is dependent
on, one or more other resources is using this approach.
</p><p>
Like I said before, there is an example of a 
<a href="http://wellformedweb.org/story/1">similar approach by Joe Gregorio</a>
on his &#39;Well-Formed Web&#39; site for alerting resources to peer
resources of mutual interest.
</p><p>
Every time you would POST some data, consider making that data
GETable and POST its URI instead, as a notification of the data
existing. 
</p><p>
<b>eA:</b> GETable POST data? You sure that&#39;s REST-compliant?
</p><p>
<b>DC:</b> In REST integration, things become more symmetric 
than in the client-server Web, or rather, the &#39;client-resource&#39;
Web. We can start to talk about the &#39;resource-resource&#39; Web!
</p><p>
But anyway, we&#39;re already halfway to the symmetric resource-resource
Web when we POST - not to a <i>service</i>, but to a <i>URI</i>. Resources
can already both issue <i>and</i> receive state, which is a pretty
symmetric state of affairs. 
</p><p>
<b>eA:</b> I never thought of it that way - I keep forgetting that
you can POST right back to a resource you just fetched.
</p><p>
<b>DC:</b> But think one step on: the POSTed data has a Content-Type
but no URI!
</p><p>
Why not close the loop and have this POSTed data be a first-class
resource (with a URI) that POSTs <i>itself</i> to the target. And it can
<i>itself</i> GET that target or be POSTed to by that target in return.
</p><p>
That really is a Resource-Oriented Architecture. Once resources are
seen as equal and active participants in RESTful integration, it
becomes irrelevant whether their state is transferred by GET or by
POST.
</p><p>
<b>eA:</b> I&#39;m still having trouble with this pattern of POST just
being a pro-active GET.
</p><p>
<b>DC:</b> Making POSTed data GETable more correctly moves the
responsibility to the target resource to fetch the incoming resource
state when its ready (rather than being bombarded by state it hasn&#39;t
asked for).
</p><p>
Once the target is interested, updates can be POSTed directly as
they happen, to prevent the target polling, or notification of
an updated URI POSTed to trigger the target to re-GET the changed
resource when it wants (thereby updating the caches).
</p><p>
<b>eA:</b> Hmm - makes clients look like servers..
</p><p>
<b>DC:</b> Since our &#39;clients&#39; in REST integration are also &#39;servers&#39;
in other contexts, it is easier to set up client-side resources than
on the browser-based Web. One objection to cookies on the Web is
that they are state or resource that has no URI. So give your
&#39;client&#39; state a URI!  And put any client-specific server resources
on your own &#39;client&#39; host.
</p><p>
<b>eA:</b> Is anyone doing this sort of thing?
</p><p>
<b>DC:</b> Well, in fact there are many examples of this
POST-notification of a GETable resource already happening
between web sites.  Like submitting a link to your site to an
indexing engine and letting it crawl (or poll) it.
</p><p>
Trackback pings are another example: POST a URI along with a
sample of your page.  And the Microformat rel-tag adds your
article to Technorati&#39;s tag index when you ping their servers
with the URI of the article.
</p><p>
Further, imagine POSTing to some new site a link to your hCard
on your own server, to save you having to type your name and
address again. And you&#39;d never need to manually update sites
when your address changes: just ping &#39;em all.
</p><p>
<b>eA:</b> Ah - but I thought all URIs should be GETable. The ping URI
you&#39;re POSTing <i>to</i> in these examples isn&#39;t always one that you
can also GET!
</p><p>
<b>DC:</b> Indeed - so think how much more powerful it would be if
we did close the loop and provide or create a GETable resource to
POST these notifications to. 
</p><p>
For example, imagine a page containing an hCalendar event. Now point
to it with a rel=&quot;attending&quot; link.  When the hCalendar discovers
your intention (using a direct POST ping of your page&#39;s URI to the
hCalendar page&#39;s URI - or perhaps through the referrer trick from
people clicking through), it adds your referring page to a list of
attendees inside the hCalendar. The hCalendar could either contain
lists of backlinks to the attendee&#39;s pages, which may in turn carry
hCards, or it could contain lists of complete hCards copied over.
</p><p>
<b>eA:</b> Sounds like a good use of Microformats.
</p><p>
<b>DC:</b> These examples make crawling and polling (even with
If-Modified-Since <i>et al</i>) look like a clumsy version of the more
proactive POST. 
</p><p>
Web Feeds and general publish-subscribe are further examples where
POST may be used to notify changes on a resource - giving the feed
consumer first-class resource status with their own URI. 
</p><p>
<b>eA:</b> I&#39;d never think of using HTTP in this way.
</p><p>
<b>DC:</b> Obviously this only applies where the feed consumer is a
visible and POSTable server and where timeliness is crucial. And
probably where the number of subscribers is relatively small, unless
asynchronous I/O and an event-driven architecture are employed, and
you don&#39;t wait for the response to each POST.
</p><p>
This isn&#39;t done now simply because of the asymmetry of the current
Web, <i>an asymmetry which we are free of in REST integration</i>.
</p><p>
<b>eA:</b> What about all those REST rules about idempotent and unsafe
methods?
</p><p>
<b>DC:</b> We&#39;re not mixing GET and POST in that sense, just turning
the tables on the asymmetric Web.  GET is still cacheable, and we
can POST a link to cause a cached GET.
</p><p>
I believe this is a more-constrained REST style, not disjoint to
REST. It is at least an ROA! It may fall foul of REST&#39;s
client-server constraint, since we&#39;re now in server-server territory
with integration applications.  Also, the concept of &#39;Hypertext as
the Engine of Application State&#39; is something that may take some
refitting to the mutual state dependency model. However, I believe
it&#39;s most important to focus on maintaining the benefits of REST
and its key elements of standard content types at URIs.
</p><p>
I call this symmetric REST integration style the &#39;Distributed
Observer Pattern&#39;.
</p><p>
<b>eA:</b> Quickly summarise the &#39;Distributed Observer Pattern&#39;.
</p><p>
<b>DC:</b> OK, the Distributed Observer Pattern is &#39;symmetric REST&#39;. A
resource subscribes to a peer resource via a GET that supplies its
own URI, and is notified of subsequent state changes in that
resource through a POST back.
</p><p>
<b>eA:</b> That was <i>too</i> quick. Tell me the details!
</p><p>
<b>DC:</b> OK, here are four. First, a POST can be either the whole
new state or the fact of the change, allowing the subscriber to
GET the resource when it&#39;s ready (and thereby fill any caches).
</p><p>
Secondly, you can use either the Referer header or perhaps the
Content-Location header in POST and GET requests to indicate the
origin POSTer or GETter URI. Alternatively, you can send this origin
resource URI using the Cookie header, echoing its use in the normal
browser client-server case to identify the pseudo-resource of a
browser user.
</p><p>
POSTed state notifications may be unsolicited by a prior GET
subscription, when the POST target is clearly open to them (as in
the ping notification examples).  These can be seen as &#39;subscribe to
anyone&#39;, and may be combined with a corresponding &#39;GET anyone&#39;
crawling process, without explicit subscription.
</p><p>
Finally, POST notifications may be targetted to single resources to
ask them to update: the Distributed Observer Pattern way of
achieving the client-server editing function.  These now become
&#39;edit suggestions&#39; of the POSTer resource - putting the target back
in control of its own destiny and integrity.
</p><p>
<b>eA:</b> And why should I use the Distributed Observer Pattern?
</p><p>
<b>DC:</b> The Distributed Observer Pattern supports the programming model
of inter-dependent resources whose own state is a function of their
peers&#39; state, driven by declarative rules. It&#39;s a very general ROA
programming model.
</p><p>
<i>(c) 2006-2007 Duncan Cragg</i>
</p><p>&#160;</p><p>
In Part 6: <a href="http://duncan-cragg.org/blog/post/content-types-and-uris-rest-dialogues/">Content-Types and URIs</a>.
</p><p>
<i>Note that the opinions of our imaginary eBay Architect don&#39;t
necessarily represent or reflect in any way the official
opinions of eBay or the opinions of anyone at eBay.</i>
</p><p>
<i>Indeed, I can&#39;t guarantee that the opinions of our real blogger
necessarily represent or reflect in any way the official
opinions of Roy Fielding...</i>
</p><p>

</p>

            </div>
        </content>
    </entry>
    
    <entry>
        <id>http://duncan-cragg.org/blog/post/microformats-challenge-web-feeds-and-web-apis/</id>
        <title>Microformats Challenge Web Feeds and Web APIs!</title>
        <published>2006-06-07T19:10:00Z</published>
        
        <updated>2006-06-07T19:10:00Z</updated>
        
        <link rel="alternate" type="text/html" href="http://duncan-cragg.org/blog/post/microformats-challenge-web-feeds-and-web-apis/" title="Microformats Challenge Web Feeds and Web APIs!" />
        
        <category term="semanticweb" />
        
        <category term="xtech" />
        
        <category term="declarative" />
        
        <category term="web2.0" />
        
        <category term="publishsubscribe" />
        
        <category term="app" />
        
        <category term="microformats" />
        
        <category term="microsummaries" />
        
        <category term="rest" />
        
        <category term="atom" />
        
        <summary type="xhtml">
            <div xmlns="http://www.w3.org/1999/xhtml">

<p>

<a href="http://microformats.org">Microformats</a> are subversive:
they not only challenge the approach of full-blown Semantic Web
approaches, but even question fundamental Web 2.0 building
blocks such as Web Feeds and Web APIs.
</p><p>
I recently attended
<a href="http://xtech06.usefulinc.com/">XTech 2006</a>,
where there were a few talks related to Microformats.
</p><p>
After summarising these talks, I&#39;ll finish with my shocking
revelations about the subversive nature of Microformats!
 &#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://microformats.org">Microformats</a> are subversive:
they not only challenge the approach of full-blown Semantic Web
approaches, but even question fundamental Web 2.0 building
blocks such as Web Feeds and Web APIs.
</p><p>
I recently attended
<a href="http://xtech06.usefulinc.com/">XTech 2006</a>,
where there were a few talks related to Microformats.
</p><p>
After summarising these talks, I&#39;ll finish with my shocking
revelations about the subversive nature of Microformats!
</p></div><p>
<b><a href="http://xtech06.usefulinc.com/schedule/detail/190">Microformats from the Ground Up</a></b>
</p><p>
<a href="http://theryanking.com/">Ryan King</a> and 
<a href="http://suda.co.uk/">Brian Suda</a> from 
<a href="http://technorati.com/">Technorati</a> presented
a half-day tutorial.
</p><p>
You can describe social networks, calendars and various other
semantic relationships by annotating page elements or embedding
small XML structures into your page according to a Microformat spec.
</p><p>
Microformats take Declarative or semantic markup (e.g. in
XHTML) to the next logical level.  Microformats have been
called the &#39;lower case Semantic Web&#39;, because they fill the
need for a lightweight set of conventions for data in Web pages
that transcends the merely renderable.
</p><p>
HTML has a number of extension points that make this kind
of thing easier. For example, the &#39;rel&#39; and &#39;rev&#39; attributes 
on a link (say what type of link it is - maybe a tag); the
&#39;class&#39; attributes (used for CSS but can also carry add-on
semantics); the &#39;profile&#39; element (say what kind of thing
the whole document represents).
</p><p>
Microformats examples include 
<a href="http://microformats.org/wiki/rel-tag">rel-tag</a> (for tagging your blog entries in Technorati, etc),
<a href="http://microformats.org/wiki/hcard">hCard</a> (like vCard-on-a-page),
<a href="http://microformats.org/wiki/hcalendar">hCalendar</a> (like iCalendar-on-a-page), 
<a href="http://microformats.org/wiki/xoxo">XOXO</a> (outlines) and
<a href="http://gmpg.org/xfn/">XFN</a> (social networking).
Technorati have an hCalendar <a href="http://feeds.technorati.com/event/">subscription service</a>.
</p><p>
However, the one that stood out for me was
<a href="http://microformats.org/wiki/hatom">hAtom</a>, with which you can
publish a blog and then let feed readers poll the actual page.
They can read the hAtom markup and treat it as an Atom feed.
</p><p>
<a href="http://theryanking.com/presentations/2006/xtech/tutorial/">Slides here</a>.
</p><p>&#160;</p><p>
<b><a href="http://xtech06.usefulinc.com/schedule/detail/148">The Intelligent Design of Microformats</a></b>
</p><p>
<a href="http://theryanking.com/">Ryan King</a> also presented a talk on
the motivation and style of the Microformats effort.
</p><p>
There is no official standards body defining
<a href="http://microformats.org">Microformats</a>, just an 
&quot;Open Source&quot;-style engineering effort, which follows the
following list of Worthy Engineering Principles: &quot;Rough
Consensus and Working Code&quot;, &quot;Paving the Cowpath&quot;, &quot;Keep It
Simple and Stupid&quot;, &quot;You Ain&#39;t Gonna Need It&#39; and &quot;Don&#39;t Repeat
Yourself&quot;.
</p><p>
<a href="http://xtech06.usefulinc.com/schedule/paper/148">Paper here</a>.
</p><p>&#160;</p><p>
<b><a href="http://xtech06.usefulinc.com/schedule/detail/201">Microsummaries in Firefox and on the Web</a></b>
</p><p>
Myk Melez gave a presentation about
<a href="http://wiki.mozilla.org/Microsummaries">Microsummaries</a> in the
up-coming Firefox releases.
</p><p>
To <a href="http://xtech06.usefulinc.com/schedule/detail/201">quote</a>:
</p><blockquote class="others-content"><div><p>Microsummaries are regularly-updated compilations of the most
important and timely information on web pages. For example:
</p><ul>
<li>current stock price and movement for a company profile: &quot;GOOG: 406.74 + 0.58&quot;</li>
<li>latest headline for a news site: &quot;BBC: US dismisses Iran attack claims&quot;</li>
<li>highest bid and time remaining for an auction item: &quot;Godzilla DVD: $15 / 2 minutes left&quot;</li>
</ul><p>
</p></div></blockquote><p>
One way to create this information is to link
(&#39;rel=&quot;microsummary&quot;&#39;) from a page to its associated
Microsummary document. You can also use XSLT to build the
summary on the client. Both approaches struck me as clumsy.
</p><p>
I commented that it would be more Microformat-like to allow
embedded markup (just annotate the Microsummary information
right in the page; perhaps call it &#39;hSummary&#39;?).
</p><p>
Myk used the bandwidth and page generation cost argument
against that, but good XHTML pages should be very lightweight,
and there are various AJAX techniques that can assemble heavier
pages.
</p><p>
The current manifestation of the idea is to write this summary
on a corresponding bookmark button in the chrome.
</p><p>
Allowing just bookmark buttons seems rather restricted to me.
I&#39;d be happy with a whole page in its own tab (or a widget in
an Ajax desktop).
</p><p>
A drag-and-drop prototype was also shown, where you visually
mark up the parts of the source page you want summarised.  I
commented that a good extension of that would be dragging
across elements to a whole new page, whose construction would be
dependent on the information in one or more source pages.
</p><p>
Myk didn&#39;t jump up and down with joy at my suggestions, so I
guess we&#39;ll have to wait before we get Microsummaries written
into Web pages that generate more Web pages.
</p><p>
<a href="http://developer.mozilla.org/presentations/xtech2006/microsummaries/">Slides here</a>;
<a href="http://wiki.mozilla.org/Microsummaries">Paper here</a>.
</p><p>&#160;</p><p>
<b><a href="http://xtech06.usefulinc.com/schedule/detail/58">RDFa: The Easy Way to Publish Your Metadata</a></b>
</p><p>
Of course, the Semantic Web folk have their own Microformat
approaches, including this one.
</p><p>
To quote from their <a href="http://xtech06.usefulinc.com/schedule/paper/58">paper</a>:
</p><blockquote class="others-content"><div><p>
The approach taken by RDFa is that ultimately any RDF structure
should be representable. This means that instead of having
to &#39;codify&#39; each format to describe how it must be marked up,
we simply provide a set of rules that explain how any RDF can
be marked up, and than any RDF &#39;language&#39; can be used.
</p></div></blockquote><p>
The &#39;a&#39; stands for &#39;attribute&#39;: RDF encoded as attributes in XML.
</p><p>
The example shown was FoaF, whose Microformat competition is
<a href="http://gmpg.org/xfn/">XFN</a> and <a href="http://microformats.org/wiki/hcard">hCard</a>.
You can use attributes like <code>&lt;link rel=&quot;foaf:mbox&quot;&gt;</code>,
<code>&lt;span property=&quot;foaf:name&quot;&gt;</code>, <code>&lt;span property=&quot;foaf:phone&quot;&gt;</code>
to encode RDF triple information at various points around your
document.
</p><p>
RDFa has some arguable benefits over their competition, but I
don&#39;t see why both sides shouldn&#39;t get along and share ideas.
And, indeed, why the other alternatives 
(<a href="http://www.structuredblogging.org/">structured blogging</a>,
<a href="http://research.talis.com/2005/erdf/wiki/Main/RdfInHtml">embedded RDF</a>)
shouldn&#39;t all find a place, too. There is a 
<a href="http://www.bnode.org/archives2/58">comparison here</a>.
Another speaker at XTech, <a href="http://xtech06.usefulinc.com/schedule/speaker/86">Uche Ogbuji</a>, has also
<a href="http://www.xml.com/pub/a/2006/04/26/microformats-grddl-rdfa-nvdl.html">discussed</a>
some of these issues.
</p><p>&#160;</p><p>
<b>Web 2.0 Centraal</b>
</p><p>
Microformats not only challenge the Semantic Web, they even
challenge such basic Web 2.0 technologies as Web feeds and Web
APIs.
</p><p>
Shouldn&#39;t we be subscribing to and interacting with semantic
Web pages (note the lower case &#39;s&#39;!), not using invisible Web
Feeds and Web APIs?  Technorati think so: they are 
<a href="http://technorati.com/weblog/2006/05/108.html">leading the way</a>
in searching and subscribing to Microformats.
</p><p>
The redundancy of Atom itself (and feeds in general) has been
<a href="http://hsivonen.iki.fi/need-atom/">remarked upon</a> before.
Further, since we&#39;re using REST in the Atom Publishing
Protocol, why not use the same protocol to publish directly to
an hAtom annotated site? (e.g., just POST a new article to your
own blog&#39;s main page!)  Web &#39;API&#39;s are redundant when our pages
are just XML data anyway.
</p><p>
Writing data pages instead of document pages, then allowing
those pages to be updated and then subscribed to, is the future
of the Web: it&#39;s Web 2.0 Centraal.
</p><p>
The new lightweight, Declarative, Microformat-rich XHTML pages
we&#39;re going to be generating can be polled just as Web feeds
are, and events made from their changes. Then re-presented via
Ajax in dynamic pages.  Such standardised page formats and
micro-formats 
<a href="http://duncan-cragg.org/blog/post/strest-service-trampled-rest-will-break-web-20/">should also accept standardised POSTs</a>
where appropriate.
</p><p>
Microformats represent some first steps towards the Data Web
replacing the Document Web.  Although there has been some
thought given to extracting full-blown Semantic Web data from
Microformats, there&#39;s a significant chance that this bottom-up,
simple, minimal, <i>change-aware</i> (i.e., updateable,
subscribable) approach may teach the Semantic Web practitioners
a thing or two about the Worthy Engineering Principles that
enable the social and technical proliferation of a good idea.
</p><p>
Standardising common formats and structures is a precursor to 
this two-way, dynamic Data Web. Both the bottom-up
practitioners of Microformats and the top-down practitioners of
the Semantic Web have much to learn from each other on this path.
</p><p>&#160;</p><p>

</p>

            </div>
        </content>
    </entry>
    
    <entry>
        <id>http://duncan-cragg.org/blog/post/imperative-declarative-inversion-open-data-ok/</id>
        <title>The &quot;Imperative to Declarative Inversion&quot;: Open Data is OK!</title>
        <published>2006-05-11T21:36:00Z</published>
        
        <updated>2006-05-11T21:36:00Z</updated>
        
        <link rel="alternate" type="text/html" href="http://duncan-cragg.org/blog/post/imperative-declarative-inversion-open-data-ok/" title="The &quot;Imperative to Declarative Inversion&quot;: Open Data is OK!" />
        
        <category term="copyright" />
        
        <category term="architecture" />
        
        <category term="declarative" />
        
        <category term="publishsubscribe" />
        
        <category term="p2p" />
        
        <category term="rest" />
        
        <summary type="xhtml">
            <div xmlns="http://www.w3.org/1999/xhtml">

<p>

There is something about the Internet that nurtures open data,
and something about computers that nurtures closed. It is 
often necessary, but often painful, to make the jump from local,
closed data to global, open data.
 &#160; ...
</p>

            </div>
        </summary>
        <content type="xhtml" xml:space="preserve">
            <div xmlns="http://www.w3.org/1999/xhtml">

<p>
</p><div class="summary"><p>
There is something about the Internet that nurtures open data,
and something about computers that nurtures closed. It is 
often necessary, but often painful, to make the jump from local,
closed data to global, open data.
</p></div><p>
The Internet is all about data; open data and open data formats
in particular. HTML, the fabric of the Web, links up vast
amounts of open data created in an open data format. Email is
sent either in the same HTML or (the most open of formats)
simple text.  Feed publishing shows that opening data can
become an unstoppable flow. Indeed, Peer-to-Peer technology
shows that opening data can become a torrent...
</p><p>
However, on our computers, data is often much less free. Take a
closed format such as Microsoft Word: such a document can only
properly be unlocked after paying for Microsoft Office.  Take
copyright data under DRM (Digital Restrictions Management):
such music, etc., has to be unlocked by paying for the key.
</p><p>
Even with nominally open formats, there&#39;s a tendency to tie one
format to one application. You still need that application to
unlock the data.  And even object-oriented programmers follow
the closed data rule: data must be wrapped in a class interface. 
</p><p>
Application user interfaces, class interfaces and service
interfaces whose implementation processes mediate, control and
restrict data and their formats are the bread-and-butter of the
non-Internet computer domain.  They work best on the more
tightly-controllable computer hosts.
</p><p>&#160;</p><p>
<b>They Just Don&#39;t Mix</b>
</p><p>
But the processes and the people that like to control data
don&#39;t mix too well with the Internet. Here are some examples
of the incongruity (or outright clash) that can result:
</p><p>
</p><ul>
<li>It still jars to hit a link and find, not something that the browser can handle - not an open format resource - but a PDF or a Word document. And, of course, you need to have paid for Office or to have installed Acrobat to see it.</li>
<li>Google dips in to these Word documents and PDFs, presumably legally, but in theory this right could be revoked at any time.</li>
<li>Some Web site owners get upset about people indexing or linking into resources on their site (&#39;deep linking&#39;).</li>
<li>Web caches, including the Google cache, are in potential breach of copyright by copying data.</li>
<li>The music and film industries have witnessed the power of Peer-to-Peer to shake up their world of controllable data.</li>
<li>Taking the computer concept of &#39;interface and process&#39; and translating it literally to the Internet - RPC and RMI - has yet to achieve the success promised; although the vendors of SOA and WS-* still believe it&#39;s possible.</li>
</ul><p>
Now, these processes and people that like to control data
obviously can&#39;t just avoid the Internet. So they&#39;d be better
off embracing the open data philosophy if they&#39;re going to do
things here.
</p><p>
Embracing open data can take courage and open-mindedness.  It
means letting go of proprietary lock-in, copyright obsession,
RPC, RMI and Service-Oriented Architectures. The lock-step
imperative, procedural, workflow and object-oriented programming
that works locally doesn&#39;t translate well onto the &#39;Net.  The
rules change.
</p><p>&#160;</p><p>
<b>Open Data Can Work</b>
</p><p>
In fact, it is possible to make a living in this
wild frontier, even when everyone can see, understand and copy
your data! (For example, watch this blog for ways to make
money on the Internet even when unlimited copying is allowed,
based on originality or novelty backed up by a little crypto
technology!)
</p><p>
I call the flip from closed data to open data the &#39;Imperative to 
Declarative Inversion&#39;. It&#39;s the flip from &#39;How&#39; to &#39;What&#39; - from 
process-centric to data-centric programming.
</p><p>
In this upside-down world of What not How, <i>the data format and
its update formats are the public &#39;interface&#39;, and process
animates things behind the scenes</i>.  Reading about REST will
provide an excellent grounding in this way of thinking.
</p><p>
Showing the benefits of inverting (scalability, robustness,
interoperability, value for money, speed and flexibility of
development) and helping overcome the understandable fears of
inverting are the main goals of this blog. In fact, I will also
show how the Declarative approach works pretty well off-Net
too - in the domain traditionally owned by process... 

</p>

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

