<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" 
      xmlns:thr="http://purl.org/syndication/thread/1.0">
  <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/07/tibco-pagebus-an-event-framewo.html" />
  <link rel="self" type="application/atom+xml" href="http://www.insideria.com/atom.xml" />
  <id>tag:www.insideria.com,2009://34/tag:www.insideria.com,2009://34.37306-</id>
  <updated>2009-11-16T14:52:54Z</updated>
  <title>Comments for Tibco PageBus: an event framework for JavaScript (http://www.insideria.com/2009/07/tibco-pagebus-an-event-framewo.html)</title>
  <generator uri="http://www.sixapart.com/movabletype/">Movable Type 4.21-en</generator>
  <entry>
    <id>tag:www.insideria.com,2009://34.37306</id>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/07/tibco-pagebus-an-event-framewo.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://blogs.oreilly.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=34/entry_id=37306" title="Tibco PageBus: an event framework for JavaScript" />
    <published>2009-07-01T20:02:07Z</published>
    <updated>2009-07-02T20:48:35Z</updated>
    <title>Tibco PageBus: an event framework for JavaScript</title>
    <summary>Tibco PageBus is a free event framework for JavaScript.  In this entry I discuss the merits of PageBus, how to implement it, and show a quick example demo I built integrating some HTML, PageBus, and a very simple Flash component.</summary>
    <author>
      <name>RJ Owen</name>
      
    </author>
    
    <category term="Blogs" />
    
    <content type="html" xml:lang="en" xml:base="http://www.insideria.com/">
      <![CDATA[<p>Event frameworks are all the rage these days.  Sending messages and receiving messages is the preferred way to keep your code separated and loosely coupled, which, as we all know, is the single most important development best practice on the planet.</p>

<p>Flash content has always had a fairly good built in message handling mechanism.  The event dispatcher has been around for a while now and served developers well.  It's featured prominently in the Flex framework as the foundation for data binding.  </p>

<p>But what if you're a developer working in JavaScript?  Until recently you were forced to build your own solution or suffer the pain of tightly coupling your components. Into the gap comes <a href="http://developer.tibco.com/pagebus/default.jsp">Tibco PageBus</a>, an event framework for JavaScript that brings loosely-coupled goodness to the masses.</p>

<p>PageBus is pretty easy to use, providing a few simple methods to wrire your components together.  The core it relies on dispatching a message, like this:</p>

<p>function publishValue(s) {<br />
  window.PageBus.publish('com.tibco.pagebus.ex.text.select', { text: s});<br />
}</p>

<p>where 's' is the content of the message and 'com.tibco.pagebus.ex.text.select' is the event identifier; and subscribing for those messages, like this:</p>

<p>window.PageBus.subscribe('com.tibco.pagebus.ex.text.select', this, onMessage, null);</p>

<p>where 'this' is the object to receive the event and 'onMessage' is the method to call when it's received.  Pretty darn simple, really.</p>

<p>I recently built a short demo that wires an HTML component to a Flash button through PageBus.  Click <a href="http://labs.effectiveui.com/rjowen/TibcoDemo/bin-debug/TibcoFlexTest.html">here to see it in action</a>, or <a href="http://www.insideria.com/upload/2009/06/TibcoDemo.zip">here</a> to download the full source.</p>

<p>It was relatively easy to use once I had the kinks worked out of my never-stellar JavaScripting skills, and I was excited to see how modular I could make RIAs.  Stop arguing about AJAX vs. Flash - use an event backbone like PageBus and use components from any RIA technology.</p>]]>
      
    </content>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.37306-comment:2067697</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.37306" type="text/html" href="http://www.insideria.com/2009/07/tibco-pagebus-an-event-framewo.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/07/tibco-pagebus-an-event-framewo.html#comment-2067697" />
    <title>Comment from Natalie on 2009-07-02</title>
    <author>
        <name>Natalie</name>
        <uri>http://www.cogitas.net/blog/home.php</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.cogitas.net/blog/home.php">
        <![CDATA[<p>That actually sounds pretty cool, bridging the gap between AJAX and Flash and thanks for the example. Do you know of any website/developper using this for a real life web app/website? I'd like to see more examples before committing myself to exploring this deeper - this looks very promising though :-)<br />
</p>]]>
    </content>
    <published>2009-07-02T20:29:47Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2009://34.37306-comment:2067699</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2009://34.37306" type="text/html" href="http://www.insideria.com/2009/07/tibco-pagebus-an-event-framewo.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2009/07/tibco-pagebus-an-event-framewo.html#comment-2067699" />
    <title>Comment from RJ on 2009-07-02</title>
    <author>
        <name>RJ</name>
        <uri>http://www.twitter.com/rjowen</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.twitter.com/rjowen">
        <![CDATA[<p>Check out the Tibco pagebus page - they have some good examples you can download there.  They're all Javascript / AJAX, however - I don't know of anyone using this with Flash commercially (yet.)</p>

<p><a href="http://developer.tibco.com/pagebus/default.jsp">http://developer.tibco.com/pagebus/default.jsp</a></p>

<p>I've updated the post to include a link to Tibco - no idea how I left that out originally.</p>]]>
    </content>
    <published>2009-07-02T20:49:38Z</published>
  </entry>

</feed
