<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>booleanbetrayal</title>
	<link>http://booleanbetrayal.com</link>
	<description>0 = 1</description>
	<pubDate>Fri, 13 Jun 2008 19:15:17 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.1</generator>
	<language>en</language>
			<item>
		<title>Google Reader Contra Code</title>
		<link>http://booleanbetrayal.com/2008/06/13/google-reader-contra-code/</link>
		<comments>http://booleanbetrayal.com/2008/06/13/google-reader-contra-code/#comments</comments>
		<pubDate>Fri, 13 Jun 2008 19:15:17 +0000</pubDate>
		<dc:creator>brent</dc:creator>
		
		<category><![CDATA[uncategorized]]></category>

		<guid isPermaLink="false">http://booleanbetrayal.com/2008/06/13/google-reader-contra-code/</guid>
		<description><![CDATA[Go to Google Reader and type the following:
up, up, down, down, left, right, left, right, B, A
Seriously, I can't stress how cool this is.
]]></description>
			<content:encoded><![CDATA[<p>Go to <a href="http://www.google.com/reader">Google Reader</a> and type the following:</p>
<ul>up, up, down, down, left, right, left, right, B, A</ul>
<p>Seriously, I can't stress how cool this is.</p>
]]></content:encoded>
			<wfw:commentRss>http://booleanbetrayal.com/2008/06/13/google-reader-contra-code/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Software Enemas (and other mature blog titles)</title>
		<link>http://booleanbetrayal.com/2008/06/12/software-enemas-and-other-mature-blog-titles/</link>
		<comments>http://booleanbetrayal.com/2008/06/12/software-enemas-and-other-mature-blog-titles/#comments</comments>
		<pubDate>Thu, 12 Jun 2008 04:32:33 +0000</pubDate>
		<dc:creator>brent</dc:creator>
		
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://booleanbetrayal.com/2008/06/12/software-enemas-and-other-mature-blog-titles/</guid>
		<description><![CDATA[Recently, I decided to purge my PCs of unnecessary or inferior software products. Below is a tally of the casualties and victors amongst the cleansing.
Google Apps FTW!
My company recently switched from Microsoft Exchange in favor of a Google Apps for our domain's email, calendar, and instant messaging. The result: I was able to completely obliterate [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I decided to purge my PCs of unnecessary or inferior software products. Below is a tally of the casualties and victors amongst the cleansing.</p>
<p><strong>Google Apps FTW!</strong></p>
<p>My company recently switched from Microsoft Exchange in favor of a <a href="https://www.google.com/a/">Google Apps</a> for our domain's email, calendar, and instant messaging. The result: I was able to completely obliterate all traces of Microsoft Outlook as well as the rest of the god-forsaken office suite. It's a no-brainer, really. Globally-accessible email / calendar / address book that ties into your IM, as well. If for whatever reason I need to use some sort of bloated word processor or *shiver* spreadsheet program, I can always download and install <a href="http://www.openoffice.org/">OpenOffice</a> (and immediately uninstall it). Seeing as how this migration process left us in a transitory position between IM providers, I've stumbled upon a new IM client, at the behest of some fellow coworkers ...</p>
<p><strong>Digsby</strong></p>
<p><a href="http://www.ceruleanstudios.com/learn/">Trillian</a> is dead. Long live <a href="http://www.digsby.com/">Digsby</a>. This versatile little IM application supports all major protocols (including Jabber). Out of the box, it also supports email and social networking notification for all the usual suspects. Its ability to consolidate multiple contacts despite provider or account into a single aliased contact (with account messaging priorities) is mega-rad. It appears to be written in python and is very extensible with YAML theming and skinning. All contact list modifications and application configuration is centralized, so if you install the app on another PC, that's it ... you'll login with a completely consistent interface. Google Calendar notifications are in the pipeline, so double-plus to Digsby.</p>
<p><strong>Firefox 3 RC3</strong></p>
<p>I'm inpatient when it comes to well-written software. As such, Firefox 2 has recently been replaced with the vastly superior <a href="http://www.mozilla.com/en-US/firefox/3.0rc3/releasenotes/">Firefox 3 RC3</a>. An embedded <a href="http://www.sqlite.org/">SQLite</a> database opens the door for all sorts of interesting extension customization and makes things such as searching history or bookmarks much easier. More importantly though, memory utilization is vastly improved, JavaScript execution speed is blazingly fast, and having the option of restoring state upon application restart (without having to annihilate the firefox.exe process, or install yet another extension) is pretty frickin sweet. Coupled with the <a href="http://www.oxymoronical.com/web/firefox/nightly">Nightly Tester Tools</a> extension, selective enabling of extensions that haven't yet been ported made upgrading a no-brainer. Uninstall Firefox 2. Install Firefox 3 RC3. All profile settings preserved. Duh.</p>
<p><strong>Ultimate Defrag</strong></p>
<p>What it lacks in leet 2.0 naming, this program more than excels for those of us stuck in NTFS / FAT32 turmoil. <a href="http://www.raxco.com/home_office/home_perfectdisk_professional.cfm">Raxco PerfectDisk</a> certainly earned it's place in the land of milk and honey, having long promoted file contingency based on access times. However, this little freeware / trial application raised the bar. The addition of selective directory structure / file type defragmentation prioritization on a per-disk basis, alongside a crapload of fine-tuning options, and some disk sector eye-candy, all packaged in a 1.7 meg distribution is mad wicked. There is no defragger but <a href="http://www.softpedia.com/reviews/windows/UltimateDefrag-Review-38721.shtml">Ultimate Defrag</a>. I've never gotten a hard-on for a defragger ... before today ... honestly.</p>
<p><strong>ReSharper 4.0 Final</strong></p>
<p>I'm one of those guys. One of those Java developers who wakes up one day to find that something has gone horribly wrong. Suddenly, all you look at is C# code. I'm really no zealot, and despite the language being tied to the most pervasive of the antiquated software monopolies with an utter lack of cross-platform consideration, it really is a decent language. Visual Studio isn't half-bad, either, as anyone who's used their debugger is forced to admit (seriously ... they're listening). However, I could not imagine having to develop without <a href="http://www.jetbrains.com/resharper/">Resharper 4.0</a>, which is ironically developed by the same guys who put together arguably the best Java IDE, <a href="http://www.jetbrains.com/idea/">IntelliJ</a>. The refactoring options, semantic static source code analysis, and other nerdly capabilities that this product offers are a necessity. Furthermore, the developers at JetBrains must be sustained on a diet of methamphetamine and Red Bull. It's the only way I can comprehend their ability to squash bugs as they do, having been privy to the Resharper 4.0 EAP development cycle. Another obligatory plug for JetBrains ... I'm now loving <a href="http://www.jetbrains.com/teamcity/">TeamCity</a> over any other continual integration tool I've used.</p>
<p>So there you have it. Learn from the purge. Likewise, I'm interested in any nifty software that any of my 0 readers have stumbled upon. Unless, of course, you happen to mention Twitter, in which case you'll be shot in the face.</p>
<p><em>Edit:</em></p>
<p><strong>CoolIris</strong></p>
<p>I somehow have neglected to mention <a href="http://www.cooliris.com/">CoolIris</a>, a whiz-bang 3D image and video player extension for all major browsers. I had thought it would be one of those eye-candy plugins that remains unused, but I've been surprised by just how much I actually like this thing. It makes browsing places like DeviantArt and YouTube much more tolerable.</p>
]]></content:encoded>
			<wfw:commentRss>http://booleanbetrayal.com/2008/06/12/software-enemas-and-other-mature-blog-titles/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Drinking the Framework Kool-Aid</title>
		<link>http://booleanbetrayal.com/2008/02/06/drinking-the-framework-kool-aid/</link>
		<comments>http://booleanbetrayal.com/2008/02/06/drinking-the-framework-kool-aid/#comments</comments>
		<pubDate>Wed, 06 Feb 2008 23:12:55 +0000</pubDate>
		<dc:creator>brent</dc:creator>
		
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://booleanbetrayal.com/2008/02/06/drinking-the-framework-kool-aid/</guid>
		<description><![CDATA[I'm lucky enough to have a job where I'm afforded a bit of R&#038;D time, every now and then. Currently that entails evaluating various Flex frameworks, which will eventually impact some architectural decisions being made down the road. That being said, I must confess that I've traditionally not given a lot of credit to frameworks, [...]]]></description>
			<content:encoded><![CDATA[<p>I'm lucky enough to have a job where I'm afforded a bit of R&#038;D time, every now and then. Currently that entails evaluating various Flex frameworks, which will eventually impact some architectural decisions being made down the road. That being said, I must confess that I've traditionally not given a lot of credit to frameworks, preferring to drink the homebrew code cocktail that I mix up myself. That trend may be changing, though. I've come to accept that all of these frameworks and accompanying design patterns really strive to address legitimate concerns. However, it seems to me that for the most part, they end up creating a whole new set of problems of their own. So, currently I'm on the fence. Here's what I've discovered:</p>
<p><strong><a href="http://labs.adobe.com/wiki/index.php/Cairngorm">Cairngorm</a> is an under-sugared, bitter-tasting Grape ...</strong></p>
<p>First, there's simply way too much boiler-plate code involved. One can argue that this is great for development pattern enforcement in enterprise environments where 80-bajillion programmers are all working on the same set of functionality, each from a different angle, but I disagree. Although segmentation is important, I don't think these divisions of labor pay off in an enterprise environment as well as people claim. Honestly, I tend to think of the enterprise development as synonymous with "slow," as all of my anecdotal experiences have taught me, despite having very clean, ideologically correct code abstracted out the wazoo.</p>
<p>Second, Its abundant use of singletons with the Model Locator pattern and no clear mandates of when to pass data down a view hierarchy or just hit the singleton, short of "use your best judgement," seems wrong to me. I know for a fact that excessive singleton usage hurts unit test capabilities, modularization (literally, Flex modules), and the ability to debug without wanting to drop-kick your laptop.</p>
<p>Finally, for the first two reasons, Cairngorm enthusiasts remind me of those crazy religious zealots who like to flagellate themselves out of some twisted sense of duty. I may drink the kool-aid, but I don't want to join that camp, thanks.</p>
<p><strong><a href="http://www.puremvc.org">PureMVC</a> is the somewhat questionable Tropical-Punch ...</strong></p>
<p>Looks like PureMVC aims to alleviate developers of several of the common-complaints Cairngorm brings about. That's admirable, as is the goal of being ECMAScript compliant, rather than being ActionScript specific. However, in my initial glance, I'm seeing a lot of the same boiler-plate, only with more patterns at play, such as Proxies, Mediators, and Facades; all of which I have no real clue as to their intent. I suspect they're there to be unnecessarily confusing. I really need to learn up more and until then, judgment is reserved.</p>
<p><strong>Joe Berkovitz's <a href="http://www.adobe.com/devnet/flex/articles/blueprint.html">MVCS Blueprint</a> is Cherry awesomeness ... </strong></p>
<p>This should be considered more of a set of guidelines, rather than a framework, as there is no real distribution or official repository of documentation. That being said, there are a few things I can really appreciate about these patterns. </p>
<p>For one, the use of singletons is throttled to Controllers, Services and Session information. This just flat out eliminates the majority of problems a developer can encounter when exposing their Model in singletons. However, rather than having to pass reference down from a top level controller to a particular View, the View is allowed to directly ask for data from the Controller ... </p>
<p>Controller calls that require asynchronous interactions accomplish this with what some people have termed the <a href="http://johnwilger.com/2007/03/future-value-pattern-in-actionscript-3.html">Future Value Pattern</a> (or just Futures). In this scenario, you construct a placeholder for your data in your Controller, pass it by reference to your Service call, then immediately return it. At some point, your asynchronous call will return to populate that reference, leaving your view to listen to bindings and update your UI. Very clean, very accessible, no unnecessary Event bubbling. This in itself helps to reduce a significant amount of boiler-plate.</p>
<p>Finally, Joe preaches the use of dependency injection with a base class that referenes Controller and Service interfaces, then a subclass which implements those via MXML. Think compile-time Spring IOC. This opens a lot of doors when it comes to developmental mocking, testing, and easily adapting code.</p>
<p>Those are my initial thoughts ... I plan to spend a good bit of time on this subject.</p>
<p>Edit: <a href="https://admin.adobe.acrobat.com/_a200985228/p12266504/">Here's a good presentation</a> on frameworks by the developers of ASUnit. Definitely worth a watch if you're a total dork.</p>
]]></content:encoded>
			<wfw:commentRss>http://booleanbetrayal.com/2008/02/06/drinking-the-framework-kool-aid/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Delinquency and ExternalInterfaces</title>
		<link>http://booleanbetrayal.com/2007/12/10/delinquency-and-externalinterfaces/</link>
		<comments>http://booleanbetrayal.com/2007/12/10/delinquency-and-externalinterfaces/#comments</comments>
		<pubDate>Mon, 10 Dec 2007 16:08:07 +0000</pubDate>
		<dc:creator>brent</dc:creator>
		
		<category><![CDATA[uncategorized]]></category>

		<guid isPermaLink="false">http://booleanbetrayal.com/2007/12/10/delinquency-and-externalinterfaces/</guid>
		<description><![CDATA[I've been AWOL from my blog for over a couple of months now. I guess I'm lacking in the whole blogging discipline thing, but I've got good excuses. I've been fairly busy since accepting a new position with b-bline medical, a small firm specializing in medical training products with sexy RIA interfaces. I got turned [...]]]></description>
			<content:encoded><![CDATA[<p>I've been AWOL from my blog for over a couple of months now. I guess I'm lacking in the whole blogging discipline thing, but I've got good excuses. I've been fairly busy since accepting a new position with <a href="http://blinemedical.com">b-bline medical</a>, a small firm specializing in medical training products with sexy RIA interfaces. I got turned on to the work being done here after meeting <a href="http://www.rewindlife.com/">Chafic Kazoun</a> at the Adobe On-AIR Bus Tour. I had just picked up Chafic's <a href="http://www.amazon.com/Programming-Flex-comprehensive-creating-applications/dp/059652689X/ref=pd_bbs_sr_1?ie=UTF8&#038;s=books&#038;qid=1197301106&#038;sr=8-1">Programming Flex 2.0</a> book, so his sales pitch carried some credibility, and next thing I knew, I was on board. Good work, good people, crazy commute, but enough about that. On to coding goodness ...</p>
<p>I've recently come to gain a greater appreciation of Actionscript and Javascript communication. I haven't had any pressing predicament to steer me into this new-found respect, just a few odd things here and there that have caused me to take pause. For example, I doubt it will remain this way for long, but currently Google has no AS3 mapping API. There are a couple out there such as MapQuest, but come on ... we all know that Google Maps is where it's at. So, I began playing around with ExternalInterface calls in AS3 to see how it could be done. Pretty straight-forward use of Flex / HTML windowing and JS calls. You can play with it here: <a href='http://booleanbetrayal.com/wp-content/uploads/2007/12/GoogleFlexMap/' title='GoogleFlexMap'>GoogleFlexMap</a> Or download it here: <a href='http://booleanbetrayal.com/wp-content/uploads/2007/12/googleflexmap.zip' title='GoogleFlexMap'>GoogleFlexMap Source</a>.</p>
<p>Today, I also stumbled across a pretty interesting way of dealing with the lack of full support for "right click" events in Flash. Check out <a href="http://www.uza.lt/blog/2007/08/solved-right-click-in-as3/">this blog posting</a> for more info. Another good use of ExternalInterface calls.</p>
<p>I think the thing to take away from these examples is that you should never limit yourself solely to what one technology will allow you to do. You may have to jump through hoops, but often you can achieve what you seek out to accomplish. In the case of Flash and Javascript, I think it's probably a good thing to stress that Javascript calls should be as standardized as possible to ensure maximum browser portability. One thing we take for granted in Flash development is that sort of cross-platform consistency.</p>
]]></content:encoded>
			<wfw:commentRss>http://booleanbetrayal.com/2007/12/10/delinquency-and-externalinterfaces/feed/</wfw:commentRss>
		</item>
		<item>
		<title>FlexMDI Leetness</title>
		<link>http://booleanbetrayal.com/2007/09/28/the-leetness-that-is-flexmdi/</link>
		<comments>http://booleanbetrayal.com/2007/09/28/the-leetness-that-is-flexmdi/#comments</comments>
		<pubDate>Fri, 28 Sep 2007 16:10:12 +0000</pubDate>
		<dc:creator>brent</dc:creator>
		
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://booleanbetrayal.com/2007/09/28/the-leetness-that-is-flexmdi/</guid>
		<description><![CDATA[As RIAs strive to emulate conventional desktop applications, they'll tend to encounter the same hurdles that are commonly present in these desktop application interfaces. One of these hurdles is multiple child window management or in nerdspeak, Multiple Document Interface (MDI) management. The Flex framework does not currently (and rightfully so) support this need out-of-the-box, so [...]]]></description>
			<content:encoded><![CDATA[<p>As RIAs strive to emulate conventional desktop applications, they'll tend to encounter the same hurdles that are commonly present in these desktop application interfaces. One of these hurdles is multiple child window management or in nerdspeak, <a href="http://en.wikipedia.org/wiki/Multiple_document_interface">Multiple Document Interface</a> (MDI) management. The Flex framework does not currently (and rightfully so) support this need out-of-the-box, so blessed are the creators of <a href="http://code.google.com/p/flexmdi/">flexmdi</a>. This tight little open-source framework supports all the essential window management techniques you commonly find in most desktop applications, such as window creation, destruction, movement, sizing, cascading, tiling, etc. It also appears to have a few wiz-bang transitions tossed in for good measure. So props to the flexmdi team ... I hope to encounter an application that needs a sophisticated MDI management implementation, now.  =]</p>
<p>additional links:</p>
<p><a href="http://www.returnundefined.com/2007/09/announcing-flexmdi-robust-extensible-mdi-framework-for-adobe-flex/">return undefined; blog announcement</a></p>
<p><a href="http://www.returnundefined.com/flexmdi/explorer/">flexmdi example explorer</a></p>
]]></content:encoded>
			<wfw:commentRss>http://booleanbetrayal.com/2007/09/28/the-leetness-that-is-flexmdi/feed/</wfw:commentRss>
		</item>
		<item>
		<title>on AIR Bus Tour: Washington D.C.</title>
		<link>http://booleanbetrayal.com/2007/08/20/on-air-bus-tour-washington-dc/</link>
		<comments>http://booleanbetrayal.com/2007/08/20/on-air-bus-tour-washington-dc/#comments</comments>
		<pubDate>Mon, 20 Aug 2007 21:26:01 +0000</pubDate>
		<dc:creator>brent</dc:creator>
		
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://booleanbetrayal.com/2007/08/20/on-air-bus-tour-washington-dc/</guid>
		<description><![CDATA[Sitting in the balcony at the Adobe on AIR Bus Tour in D.C. (I guess Falls Church sounds less impressive) ...
Lots of interesting presentations and discussions on Adobe's new runtime environment, AIR. AIR extends Adobe's previous offerings by providing desktop application development capabilities to programmers already familiar with either ActionScript / MXML or HTML / [...]]]></description>
			<content:encoded><![CDATA[<p>Sitting in the balcony at the <a href="http://onair.adobe.com/schedule/cities/washingtondc.php">Adobe on AIR Bus Tour</a> in D.C. (I guess Falls Church sounds less impressive) ...</p>
<p>Lots of interesting presentations and discussions on Adobe's new runtime environment, AIR. AIR extends Adobe's previous offerings by providing desktop application development capabilities to programmers already familiar with either ActionScript / MXML or HTML / AJAX web development. Adobe's gone to great lengths to make this web to desktop transition as painless as possible, and I've gotta say, they've done a good job. The most compelling reasons for AIR development (as I see it), is cross-platform consistency, a clean API set, and the overall media hotness of flash within a networked desktop application. As not to sound too much like an Adobe evangelist, I'll just stop now.</p>
<p>My only gripe about this tour is the lack of focus on anything Flex 2/3. The line is blurring between Flex and AIR development, and I'd like to see where exactly those boundaries extend. For example, to what extent can one take advantage of the new JavaScript bridging capabilities within a Flex 3 application, if any at all? I suppose I just need to start playing around with Moxie ...</p>
]]></content:encoded>
			<wfw:commentRss>http://booleanbetrayal.com/2007/08/20/on-air-bus-tour-washington-dc/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SSL + IE + HttpServices = Cache Prevention Annoyances</title>
		<link>http://booleanbetrayal.com/2007/06/20/ssl-ie-httpservices-cache-prevention-annoyances/</link>
		<comments>http://booleanbetrayal.com/2007/06/20/ssl-ie-httpservices-cache-prevention-annoyances/#comments</comments>
		<pubDate>Wed, 20 Jun 2007 11:32:42 +0000</pubDate>
		<dc:creator>brent</dc:creator>
		
		<category><![CDATA[flex]]></category>

		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://booleanbetrayal.com/2007/06/20/ssl-ie-httpservices-cache-prevention-annoyances/</guid>
		<description><![CDATA[Turns out that ActiveX plugins (re: flash) have a 4 year old bug that prevents the proper parsing of the "Pragma" and "Expires" flag, if the response is coming through SSL. I learned this the hard way, the other day, and spent a great bit of time trying to figure out a way around the [...]]]></description>
			<content:encoded><![CDATA[<p>Turns out that ActiveX plugins (re: flash) have a 4 year old bug that prevents the proper parsing of the "Pragma" and "Expires" flag, if the response is coming through SSL. I learned this the hard way, the other day, and spent a great bit of time trying to figure out a way around the issue, as disabling cache prevention on the server-side was not an option. I stumbled upon a blog post by <a href="http://www.gmrweb.net">Gary Matthew Rogers</a> who summed up the solution as following ...</p>
<ul>
<li>remove "Pragma" headers</li>
<li>remove "Expires" headers</li>
<li>set "Cache-Control" as: "no-store, no-cache, must-revalidate, post-check=0, pre-check=0"</li>
</ul>
<p>The original blog post is dead, but you should be able to access a google cache version <a href="http://209.85.165.104/search?q=cache:qw2g8oXGQLwJ:www.gmrweb.net/2005/08/18/flash-remoting-https-internet-explorer/+ssl+ie+cache-control&#038;hl=en&#038;ct=clnk&#038;cd=7&#038;gl=us">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://booleanbetrayal.com/2007/06/20/ssl-ie-httpservices-cache-prevention-annoyances/feed/</wfw:commentRss>
		</item>
		<item>
		<title>CacheMoney HTTPServices</title>
		<link>http://booleanbetrayal.com/2007/06/08/cachemoney-httpservices/</link>
		<comments>http://booleanbetrayal.com/2007/06/08/cachemoney-httpservices/#comments</comments>
		<pubDate>Fri, 08 Jun 2007 18:09:46 +0000</pubDate>
		<dc:creator>brent</dc:creator>
		
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://booleanbetrayal.com/2007/06/08/cachemoney-httpservices/</guid>
		<description><![CDATA[Suppose you're developing a Flex application which retrieves data from a server outside your realm of control, dictating a HTTP caching policy which clashes with your general well-being. Or, suppose you wish to implement a caching mechanism on the Flex client application that is a bit more elaborate than a simple document expiration scheme. Now, [...]]]></description>
			<content:encoded><![CDATA[<p>Suppose you're developing a Flex application which retrieves data from a server outside your realm of control, dictating a HTTP caching policy which clashes with your general well-being. Or, suppose you wish to implement a caching mechanism on the Flex client application that is a bit more elaborate than a simple document expiration scheme. Now, suppose you wish to implement this functionality in an elegant, low-maintenance manner. </p>
<p>The best way I've found to go about this is by extending mx.rpc.http.mxml.HTTPService and overriding the send() method. Using a little bit of AOP-style, result-handling kung-fu, along with an extended mx.rpc.events.ResultEvent that allows writing to the result property, calls can be made to this CachedHTTPService as you would normally expect, but behind the scenes the result is built either from cache (if it has already been populated) or from the original intended URL. No caching logic to muck up your business logic.</p>
<p></p>
<ul>CachedHTTPService.as</ul>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="600" height="400" id="ftf_wp" align="middle">
		  <param name="movie" value="/wp-content/plugins/FlashTextFormatter/ftf_wp.swf" />
		  <param name="quality" value="high" />
		  <param name="scale" value="noscale" />
		  <param name="bgcolor" value="#ffffff" />
		  <param name="flashvars" value="w=600&h=400&file=/index.php&ftf=true&postID=5&no=0&def=/wp-content/plugins/FlashTextFormatter/definitions/as2.xml&auto=true&" />
		  <embed src="/wp-content/plugins/FlashTextFormatter/ftf_wp.swf" quality="high" scale="noscale" bgcolor="#ffffff" width="600" height="400" name="ftf_wp" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="w=600&h=400&file=/index.php&ftf=true&postID=5&no=0&def=/wp-content/plugins/FlashTextFormatter/definitions/as2.xml&auto=true&" />
		</object></p>
<ul>Example Call:</ul>
<p> (CachedHTTPService is defined and called just like HTTPService, only requiring an additional parameter, the CacheManager Implementation you wish to tie into)</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="600" height="200" id="ftf_wp" align="middle">
		  <param name="movie" value="/wp-content/plugins/FlashTextFormatter/ftf_wp.swf" />
		  <param name="quality" value="high" />
		  <param name="scale" value="noscale" />
		  <param name="bgcolor" value="#ffffff" />
		  <param name="flashvars" value="w=600&h=200&file=/index.php&ftf=true&postID=5&no=1&def=/wp-content/plugins/FlashTextFormatter/definitions/as2.xml&auto=true&" />
		  <embed src="/wp-content/plugins/FlashTextFormatter/ftf_wp.swf" quality="high" scale="noscale" bgcolor="#ffffff" width="600" height="200" name="ftf_wp" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="w=600&h=200&file=/index.php&ftf=true&postID=5&no=1&def=/wp-content/plugins/FlashTextFormatter/definitions/as2.xml&auto=true&" />
		</object></p>
<p></p>
<p>Here is the <a href='http://booleanbetrayal.com/wp-content/uploads/2007/06/cachedhttpservice.zip' title='CachedHTTPService'>CachedHTTPService Source</a>, including the CacheManager interface and example implementation, as well as the WriteableResultEvent. Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://booleanbetrayal.com/2007/06/08/cachemoney-httpservices/feed/</wfw:commentRss>
		</item>
		<item>
		<title>HTTPService, xmlDecode, ObjectTranslator, and RabidSquirrels</title>
		<link>http://booleanbetrayal.com/2007/05/18/httpservice-xmldecode-objecttranslator-and-rabidsquirrels/</link>
		<comments>http://booleanbetrayal.com/2007/05/18/httpservice-xmldecode-objecttranslator-and-rabidsquirrels/#comments</comments>
		<pubDate>Fri, 18 May 2007 19:58:44 +0000</pubDate>
		<dc:creator>brent</dc:creator>
		
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://booleanbetrayal.com/?p=3</guid>
		<description><![CDATA[Often when developing a client-server application, it's desirable to keep your object model / value objects in sync between these two tiers. Simply put, this means having identical object representations on both the client and the server. The reason for this is, it keeps the codebase manageable and ultimately makes for a saner development environment. [...]]]></description>
			<content:encoded><![CDATA[<p>Often when developing a client-server application, it's desirable to keep your object model / value objects in sync between these two tiers. Simply put, this means having identical object representations on both the client and the server. The reason for this is, it keeps the codebase manageable and ultimately makes for a saner development environment. For example, if you're dealing with a RabidSquirrel class on the client-side you can rest assured that its frothingMouth property will be of identical naming and type when you receive it from the server. No guesswork. The only gotcha with this communication design decision is usually the implementation of an elegant transport strategy capable of taking a serialized model from one tier, deserializing it, and converting it to the respective strong-typed model on the other tier. The less this logic needs to know about the particular objects it's serializing and deserializing, the better.</p>
<p>The typical transport mechanism for this design pattern is our boy, XML, which despite it's faults (bloatedness, no strong-typing support, etc) is extremely well supported, especially by Flex. E4X notation and all kinds of XML convenience classes make XML parsing a breeze, allowing the developer to take an XML response via ResultEvent.result in an HTTPService result handler and start playing around with its data with zippy developmental overhead. The problem, again, lies in the actual conversion of this response to a strong-typed object. Often, developers will manually populate typed objects with the XML values within the HTTPService result handler. Unfortunately, this makes any changes to the model annoying, as now, each of these manual translations will most likely be affected.</p>
<p>This brings us to one of Flex's most well-hidden gems ... the HTTPService.xmlDecode property. When you pass the HTTPService.xmlDecode property a function reference, that function will be passed an XMLDocument object as its only parameter, which is generated automatically by the service. You can then take that XMLDocument, iterate through it, building and returning objects of whatever type you desire. When you access ResultEvent.result in your handler function, that property value will be typed based on your decoder return type. So ResultEvent.result is now, say a RabidSquirrel object, rather than a RabidSquirrel XML node representation.</p>
<p>The beauty of this strategy is, at any point, your transport mechanism becomes disposable. If you suddenly decide to switch from XML to JSON (woot!) as your serialization strategy of choice, you only need to code some decoder / encoder functions, and you're done. No need to change anything else.</p>
<p>This is probably best implemented with <a href="http://www.darronschall.com/weblog/archives/000247.cfm">Darron Schall's ObjectTranslator class</a>, which is capable of taking a raw Object and returning an instantiated strong-typed object in return. Combine this with AS3's <a href="http://livedocs.adobe.com/flex/201/langref/mx/rpc/xml/SimpleXMLDecoder.html">SimpleXMLDecoder</a> class, and you've tada, you're done. Here's a simple example:</p>
<ul>The HTTPService Definition (note the resultFormat="object")</ul>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="600" height="250" id="ftf_wp" align="middle">
		  <param name="movie" value="/wp-content/plugins/FlashTextFormatter/ftf_wp.swf" />
		  <param name="quality" value="high" />
		  <param name="scale" value="noscale" />
		  <param name="bgcolor" value="#ffffff" />
		  <param name="flashvars" value="w=600&h=250&file=/index.php&ftf=true&postID=3&no=0&def=/wp-content/plugins/FlashTextFormatter/definitions/as2.xml&auto=true&" />
		  <embed src="/wp-content/plugins/FlashTextFormatter/ftf_wp.swf" quality="high" scale="noscale" bgcolor="#ffffff" width="600" height="250" name="ftf_wp" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="w=600&h=250&file=/index.php&ftf=true&postID=3&no=0&def=/wp-content/plugins/FlashTextFormatter/definitions/as2.xml&auto=true&" />
		</object></p>
<ul>Decoder Method</ul>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="600" height="400" id="ftf_wp" align="middle">
		  <param name="movie" value="/wp-content/plugins/FlashTextFormatter/ftf_wp.swf" />
		  <param name="quality" value="high" />
		  <param name="scale" value="noscale" />
		  <param name="bgcolor" value="#ffffff" />
		  <param name="flashvars" value="w=600&h=400&file=/index.php&ftf=true&postID=3&no=1&def=/wp-content/plugins/FlashTextFormatter/definitions/as2.xml&auto=true&" />
		  <embed src="/wp-content/plugins/FlashTextFormatter/ftf_wp.swf" quality="high" scale="noscale" bgcolor="#ffffff" width="600" height="400" name="ftf_wp" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="w=600&h=400&file=/index.php&ftf=true&postID=3&no=1&def=/wp-content/plugins/FlashTextFormatter/definitions/as2.xml&auto=true&" />
		</object></p>
<p>And there you have it. If you ever wanted to change the model, short of modifying the classes, you wouldn't need to do any additional work. Personally, I favor JSON and have adopted this strategy as such, using the <a href="http://code.google.com/p/as3corelib/">as3corelib</a> JSON serialization tools. One significant benefit over XML is the typing that JSON supports, therefore making recursive graph deserialization much much simpler. The only thing to keep in mind, is that your decoder function will still need to accept an XMLCollection. However, you can always grab the firstNode value off this object for the full-text response of your non-XML serialized String.</p>
<p><strong>EDIT:</strong> Below is an example implementation of recursively typing an untyped object as it is decoded. This is currently handled in a JSON implementation, but it should be easily portable to an XML implementation. Note that it is dependent on Darron Schall's ObjectTranslator class. I hope this helps some people out!</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="480" height="300" id="ftf_wp" align="middle">
		  <param name="movie" value="/wp-content/plugins/FlashTextFormatter/ftf_wp.swf" />
		  <param name="quality" value="high" />
		  <param name="scale" value="noscale" />
		  <param name="bgcolor" value="#ffffff" />
		  <param name="flashvars" value="=&file=/index.php&ftf=true&postID=3&no=2&def=/wp-content/plugins/FlashTextFormatter/definitions/as2.xml&auto=true&" />
		  <embed src="/wp-content/plugins/FlashTextFormatter/ftf_wp.swf" quality="high" scale="noscale" bgcolor="#ffffff" width="480" height="300" name="ftf_wp" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="=&file=/index.php&ftf=true&postID=3&no=2&def=/wp-content/plugins/FlashTextFormatter/definitions/as2.xml&auto=true&" />
		</object></p>
]]></content:encoded>
			<wfw:commentRss>http://booleanbetrayal.com/2007/05/18/httpservice-xmldecode-objecttranslator-and-rabidsquirrels/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
