<?xml version="1.0" encoding="UTF-8"?>
<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/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Eric Feminella &#187; APIs</title>
	<atom:link href="http://www.ericfeminella.com/blog/category/apis/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ericfeminella.com/blog</link>
	<description>Thoughts on Software Design and Development</description>
	<lastBuildDate>Wed, 25 Jan 2012 04:12:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>External Templates in jQote2</title>
		<link>http://www.ericfeminella.com/blog/2011/12/12/external-templates-in-jqote2/</link>
		<comments>http://www.ericfeminella.com/blog/2011/12/12/external-templates-in-jqote2/#comments</comments>
		<pubDate>Mon, 12 Dec 2011 12:00:56 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[APIs]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jqote2]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Test Driven Development]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[templating]]></category>

		<guid isPermaLink="false">http://www.ericfeminella.com/blog/?p=3315</guid>
		<description><![CDATA[The jQote2 API Reference provides plenty of useful examples which are sure to help users get up and running quickly. I found it a bit unclear, though, as to how templates could be loaded externally as, in the reference examples, templates are defined within the containing page. For the sake of simplicity this approach certainly [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://aefxx.com/api/jqote2-reference/" target="_blank">jQote2 API Reference</a> provides plenty of useful examples which are sure to help users get up and running quickly. I found it a bit unclear, though, as to how templates could be loaded externally as, in the reference examples, templates are defined within the containing page. For the sake of simplicity this approach certainly makes sense in the context of examples. However, in practice, templates would ideally be loaded externally. </p>
<p>While <a href="http://aefxx.com/jquery-plugins/jqote2/" target="_blank">jQote2</a> provides a perfect API for templating, it does not provide a method specifically for loading external templates; this is likely due to the fact that loading external templates could easily be accomplished natively in <a href="http://jquery.com/" target="_blank">jQuery</a>. However, since this is a rather common development use case, having such a facility available would be quite useful.</p>
<p>After reviewing the comments I came across a nice example from <a href="http://aefxx.com/" target="_blank">aefxx</a> (the author of jQote2) which demonstrated a typical approach to loading external templates which was simular to what I had been implementing myself. </p>
<p>And so, I wrote a simple jQuery Plug-in which provides a tested, reusable solution to loading external templates. After having leveraged the Plugin on quite a few different projects, I decided to open source it as others may find it useful as well.</p>
<p>You can grab the source and view the example over on the <a href="https://github.com/efeminella/jqote2-template-loader">jQote2 Template Loader</a> Github page.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ericfeminella.com/blog/2011/12/12/external-templates-in-jqote2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Refreshing listviews in jQuery Mobile</title>
		<link>http://www.ericfeminella.com/blog/2011/11/18/jquery-mobile-listviewrefresh/</link>
		<comments>http://www.ericfeminella.com/blog/2011/11/18/jquery-mobile-listviewrefresh/#comments</comments>
		<pubDate>Sat, 19 Nov 2011 03:42:01 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[APIs]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[jQuery Mobile]]></category>

		<guid isPermaLink="false">http://www.ericfeminella.com/blog/?p=3168</guid>
		<description><![CDATA[When dynamically creating or updating a list in jQuery Mobile; either via AJAX or by other means, one must take care to explicitly invoke the target listview widget to &#8220;refresh&#8221; in order to instruct the framework to apply the augmented markup and styles to the corresponding elements of the underlying list. For example, consider the [...]]]></description>
			<content:encoded><![CDATA[<p>When dynamically creating or updating a <code>list</code> in jQuery Mobile; either via AJAX or by other means, one must take care to explicitly invoke the target <a href="https://github.com/jquery/jquery-mobile/blob/master/js/jquery.mobile.listview.js" target="_blank">listview widget</a> to <em>&#8220;refresh&#8221;</em> in order to instruct the framework to apply the augmented markup and styles to the corresponding elements of the underlying list.</p>
<p>For example, consider the following simplified example which creates an <code>li</code> element for each item in an <code>Array</code>:</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw2">var</span> list = <span class="st0">&quot;&quot;</span>,<br />
&nbsp; &nbsp; items = <span class="br0">&#91;</span><span class="br0">&#123;</span><span class="kw3">name</span>: <span class="st0">&quot;Item A&quot;</span>, url: <span class="st0">&quot;/#item-a&quot;</span><span class="br0">&#125;</span>, <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="br0">&#123;</span><span class="kw3">name</span>: <span class="st0">&quot;Item B&quot;</span>, url: <span class="st0">&quot;/#item-b&quot;</span><span class="br0">&#125;</span>, <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="br0">&#123;</span><span class="kw3">name</span>: <span class="st0">&quot;Item C&quot;</span>, url: <span class="st0">&quot;/#item-c&quot;</span><span class="br0">&#125;</span><span class="br0">&#93;</span>;</p>
<p>$.<span class="me1">each</span><span class="br0">&#40;</span> items, <span class="kw2">function</span><span class="br0">&#40;</span> i, <span class="kw1">item</span> <span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; list += <span class="st0">&#8216;&lt;li&gt;&lt;a href=&quot;&#8217;</span> + <span class="kw1">item</span>.<span class="me1">url</span> + <span class="st0">&#8216;&quot;&gt;&#8217;</span> + <span class="kw1">item</span>.<span class="kw3">name</span> +<span class="st0">&#8216;&lt;/a&gt;&lt;/li&gt;&#8217;</span>;<br />
<span class="br0">&#125;</span><span class="br0">&#41;</span>;<br />
$<span class="br0">&#40;</span><span class="st0">&quot;ul:jqmData(role=&#8217;listview&#8217;)&quot;</span><span class="br0">&#41;</span>.<span class="me1">append</span><span class="br0">&#40;</span> list <span class="br0">&#41;</span>;</div>
<p>While this will create the list items and add them to the target <code>listview</code> <code>ul</code> element, JQM will not auto enhance the newly added items unless instructed to do so. I imagine this is due to a necessary design decision as, constantly monitoring the DOM for changes would certainly incur a performance hit.</p>
<p>In order to correct this, we just need to invoke <code>.listview("refresh");</code> after appending the new elements to the list. This will notify <em>JQM</em> to apply the expected enhancements. And so, the following example will result in the expected list enhancements being applied:</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw2">var</span> list = <span class="st0">&quot;&quot;</span>,<br />
&nbsp; &nbsp; items = <span class="br0">&#91;</span><span class="br0">&#123;</span><span class="kw3">name</span>: <span class="st0">&quot;Item A&quot;</span>, url: <span class="st0">&quot;/#item-a&quot;</span><span class="br0">&#125;</span>, <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="br0">&#123;</span><span class="kw3">name</span>: <span class="st0">&quot;Item B&quot;</span>, url: <span class="st0">&quot;/#item-b&quot;</span><span class="br0">&#125;</span>, <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="br0">&#123;</span><span class="kw3">name</span>: <span class="st0">&quot;Item C&quot;</span>, url: <span class="st0">&quot;/#item-c&quot;</span><span class="br0">&#125;</span><span class="br0">&#93;</span>;</p>
<p>$.<span class="me1">each</span><span class="br0">&#40;</span> items, <span class="kw2">function</span><span class="br0">&#40;</span> i, <span class="kw1">item</span> <span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; list += <span class="st0">&#8216;&lt;li&gt;&lt;a href=&quot;&#8217;</span> + <span class="kw1">item</span>.<span class="me1">url</span> + <span class="st0">&#8216;&quot;&gt;&#8217;</span> + <span class="kw1">item</span>.<span class="kw3">name</span> +<span class="st0">&#8216;&lt;/a&gt;&lt;/li&gt;&#8217;</span>;<br />
<span class="br0">&#125;</span><span class="br0">&#41;</span>;<br />
$<span class="br0">&#40;</span><span class="st0">&quot;ul:jqmData(role=&#8217;listview&#8217;)&quot;</span><span class="br0">&#41;</span>.<span class="me1">append</span><span class="br0">&#40;</span> list <span class="br0">&#41;</span>.<span class="me1">listview</span><span class="br0">&#40;</span><span class="st0">&quot;refresh&quot;</span><span class="br0">&#41;</span>;</div>
<p>You can try an example which demonstrates both of the above implementations <a href="http://code.ericfeminella.com/articles/examples/jqm/listview/index.html" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ericfeminella.com/blog/2011/11/18/jquery-mobile-listviewrefresh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Circumventing Conditional Comparisons</title>
		<link>http://www.ericfeminella.com/blog/2011/10/14/circumventing-conditional-comparisons/</link>
		<comments>http://www.ericfeminella.com/blog/2011/10/14/circumventing-conditional-comparisons/#comments</comments>
		<pubDate>Fri, 14 Oct 2011 23:36:37 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[APIs]]></category>
		<category><![CDATA[Code Review]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Object Oriented Design]]></category>
		<category><![CDATA[Refactoring]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[Test Driven Development]]></category>
		<category><![CDATA[conditional comparison]]></category>
		<category><![CDATA[equality operator]]></category>
		<category><![CDATA[identity operator]]></category>
		<category><![CDATA[javascript equality operator]]></category>
		<category><![CDATA[javascript identity operator]]></category>

		<guid isPermaLink="false">http://www.ericfeminella.com/blog/?p=2800</guid>
		<description><![CDATA[Often during the course of my day I come across code which evaluates the same conditional comparisons in multiple contexts. Understandably, this is rather typical of most software systems, and while it may only introduce a negligible amount of technical dept (in the form of redundancy) for smaller systems, that dept can grow considerably in [...]]]></description>
			<content:encoded><![CDATA[<p>Often during the course of my day I come across code which evaluates the same conditional comparisons in multiple contexts. Understandably, this is rather typical of most software systems, and while it may only introduce a negligible amount of technical dept (in the form of redundancy) for smaller systems, that dept can grow considerably in more complex, large scale applications. From a design perspective, this issue is applicable to nearly every language.</p>
<p>For example, consider a simple <code>Compass</code> class which defines just one public property, &#8220;direction&#8221; and, four constants representing each cardinal direction: North, East, South and West, respectively. In JavaScript, this could be defined simply as follows:</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw2">var</span> Compass = <span class="kw2">function</span><span class="br0">&#40;</span>direction<span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">this</span>.<span class="me1">direction</span> = direction;<br />
<span class="br0">&#125;</span><br />
Compass.<span class="me1">NORTH</span> = <span class="st0">&quot;North&quot;</span>;<br />
Compass.<span class="me1">EAST</span> &nbsp;= <span class="st0">&quot;East&quot;</span>;<br />
Compass.<span class="me1">SOUTH</span> = <span class="st0">&quot;South&quot;</span>;<br />
Compass.<span class="me1">WEST</span> &nbsp;= <span class="st0">&quot;West&quot;</span>;</div>
<p>Technically, there is nothing problematic with the above class signature; the defined constants certainly provide a much better design than conditional comparisons against literal strings throughout implementation code. That being said, this design does lead to redundancy as every instance of <code>Compass</code> which needs to evaluate the state of <code>direction</code> requires conditional comparisons. </p>
<p>For example, to test for <code>Compass.North</code>, typically, client code must be implemented as follows: </p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw1">if</span> <span class="br0">&#40;</span>compass.<span class="me1">direction</span> === Compass.<span class="me1">NORTH</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> <br />
&nbsp; &nbsp; <span class="co1">//&#8230;</span><br />
<span class="br0">&#125;</span></div>
<p>Likewise, simular comparisons would need to be implemented for each cardinal direction. And, while this may seem trivial for a class as simple as the <code>Compass</code> example, it does become a maintenance issue for more complex implementations. </p>
<p>With this in mind, we can simplify client code by defining each state as a specific method of <code>Compass</code>. In doing so, we afford our code the benefit of exercising (unit testing) <code>Compass</code> exclusively. This alone improves maintainability while also simplifying client code which depends on <code>Compass</code>. As such, <code>Compass</code> could be refactored to:</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw2">var</span> Compass = <span class="kw2">function</span><span class="br0">&#40;</span>direction<span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">this</span>.<span class="me1">direction</span> = direction;<br />
<span class="br0">&#125;</span><br />
Compass.<span class="me1">prototype</span> = <span class="br0">&#123;</span><br />
&nbsp; &nbsp; isNorth: <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw1">this</span>.<span class="me1">direction</span> === Compass.<span class="me1">NORTH</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span>,<br />
&nbsp; &nbsp; isWest: <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw1">this</span>.<span class="me1">direction</span> === Compass.<span class="me1">WEST</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span>,<br />
&nbsp; &nbsp; isSouth: <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw1">this</span>.<span class="me1">direction</span> === Compass.<span class="me1">SOUTH</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span>,<br />
&nbsp; &nbsp; isEast: <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw1">this</span>.<span class="me1">direction</span> === Compass.<span class="me1">EAST</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
<p>Based on the above implementation of <code>Compass</code>, the previous conditional comparison can be refactored as follows:</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw1">if</span> <span class="br0">&#40;</span>compass.<span class="me1">isNorth</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> <br />
&nbsp; &nbsp; <span class="co1">//&#8230;</span><br />
<span class="br0">&#125;</span></div>
<h3>Comparator API</h3>
<p>To simplify implementing conditional comparisons, I have provided a simple <code>Comparator</code> API that defines a single static method: <code>Comparator.each</code>, which allows for augmenting existing objects with comparison methods. <code>Comparator.each</code> can be invoked with three arguments as follows:</p>
<table class="api-doc-table" cellspacing="0">
<thead></thead>
<tbody>
<tr class="api-method">
<td>type
<td class="default"></td>
</tr>
<tr>
<td colspan="2" class="desc">The Class to which the comparison methods are to be added.</td>
</tr>
<tr class="api-method">
<td>property</td>
<td class="default"></td>
</tr>
<tr>
<td colspan="2" class="desc">The property against which the comparisons are to be made. If the property has not been defined it, too, will be added.</td>
</tr>
<tr class="api-method">
<td>values</td>
<td class="default"></td>
</tr>
<tr>
<td colspan="2" class="desc">An <code>Array</code> of constants where each value will be used to create a new comparison method (prefixed with &#8220;is&#8221;). If the constants specified are Strings, typically an <code>Array</code> containing each constant should suffice. For example, passing <code>[Foo.BAR]</code> where <code>BAR</code> equals &#8220;Bar&#8221; would result in an <code>isBar()</code> method being created. To specify custom comparison method names, an <code>Object</code> of name/value pairs can be used where each name defines the name of the method added and the value is the constant evaluated by the method. This is useful for constants which are not strings. For example, <code>{isIOS421: DeviceVersion.IOS_4_2_1}</code> where <code>IOS_4_2_1</code> equals 4.2.1 would result in an <code>isIOS421()</code> method being created.</td>
</tr>
</table>
<p>Taking the <code>Compass</code> example, the previous comparison methods could be augmented without the need to explicitly define them via <code>Comparator.each</code>:</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw2">var</span> Compass = <span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">this</span>.<span class="me1">direction</span> = direction;<br />
<span class="br0">&#125;</span><br />
Compass.<span class="me1">NORTH</span> = <span class="st0">&quot;North&quot;</span>;<br />
Compass.<span class="me1">EAST</span> &nbsp;= <span class="st0">&quot;East&quot;</span>;<br />
Compass.<span class="me1">SOUTH</span> = <span class="st0">&quot;South&quot;</span>;<br />
Compass.<span class="me1">WEST</span> &nbsp;= <span class="st0">&quot;West&quot;</span>;<br />
Comparator.<span class="me1">each</span><span class="br0">&#40;</span> Compass, <span class="st0">&quot;direction&quot;</span>, <span class="br0">&#91;</span>Compass.<span class="me1">NORTH</span>, <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Compass.<span class="me1">WEST</span>, <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Compass.<span class="me1">SOUTH</span>, <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Compass.<span class="me1">EAST</span><span class="br0">&#93;</span> <span class="br0">&#41;</span>;</div>
<p>The above results in the comparison methods <code>isNorth</code>, <code>isEast</code>, <code>isSouth</code> and <code>isWest</code> being added to the <code>Compass</code> type.</p>
<p><strong>Comparator</strong>: <span class="figure"><a href="http://code.ericfeminella.com/apis/javascript/comparator/js/comparator.js" target="_blank">source</a> | <a href="http://code.ericfeminella.com/apis/javascript/comparator/js/comparator-min.js" target="_blank">min</a> | <a href="http://code.ericfeminella.com/apis/javascript/comparator/tests/comparator-test.js" target="_blank">test</a> (<a href="http://code.ericfeminella.com/apis/javascript/comparator" target="_blank">run</a>)</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ericfeminella.com/blog/2011/10/14/circumventing-conditional-comparisons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tracking HTML5 Support in Chrome</title>
		<link>http://www.ericfeminella.com/blog/2011/09/18/tracking-html5-support-in-chrome/</link>
		<comments>http://www.ericfeminella.com/blog/2011/09/18/tracking-html5-support-in-chrome/#comments</comments>
		<pubDate>Sun, 18 Sep 2011 22:18:54 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[APIs]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[html5 elements]]></category>
		<category><![CDATA[open web]]></category>

		<guid isPermaLink="false">http://www.ericfeminella.com/blog/?p=2597</guid>
		<description><![CDATA[Google has now made it easy to track the current implementation status of HTML5 in Chrome via The Chromium Projects&#8217; new Web Platform Status page. Many of the sections have links to their html5rocks site, which provide further details and more in-depth tutorials of implemented specifications. The current sections include: File APIs Offline and XHR [...]]]></description>
			<content:encoded><![CDATA[<p>Google has now made it easy to track the current implementation status of <a href="http://dev.w3.org/html5/spec/Overview.html" target="_blank" title="HTML5 - Overview">HTML5</a> in <a href="http://www.google.com/chrome?&#038;brand=CHMB&#038;utm_campaign=en&#038;utm_source=en-ha-na-us-sk&#038;utm_medium=ha" title="Chrome" target="_blank">Chrome</a> via <a href="https://sites.google.com/a/chromium.org/dev/" target="_blank" title="The Chromium Projects">The Chromium Projects&#8217;</a> new <a href="https://sites.google.com/a/chromium.org/dev/developers/web-platform-status" target="_blank">Web Platform Status</a> page. </p>
<p>Many of the sections have links to their <a href="http://html5rocks.com/" target="_blank">html5rocks</a> site, which provide further details and more in-depth tutorials of implemented specifications.</p>
<p>The current sections include:</p>
<ul>
<li ><a href="https://sites.google.com/a/chromium.org/dev/developers/web-platform-status#TOC-File-APIs" target="_blank">File APIs</a></li>
<li ><a href="https://sites.google.com/a/chromium.org/dev/developers/web-platform-status#TOC-Offline-and-XHR" target="_blank">Offline and XHR</a></li>
<li ><a href="https://sites.google.com/a/chromium.org/dev/developers/web-platform-status#TOC-Storage" target="_blank">Storage</a></li>
<li ><a href="https://sites.google.com/a/chromium.org/dev/developers/web-platform-status#TOC-CSS-Presentation" target="_blank">CSS &amp; Presentation</a></li>
<li ><a href="#TOC-Graphics" target="_blank">Graphics</a></li>
<li ><a href="https://sites.google.com/a/chromium.org/dev/developers/web-platform-status#TOC-Multimedia" target="_blank">Multimedia</a></li>
<li ><a href="https://sites.google.com/a/chromium.org/dev/developers/web-platform-status#TOC-Other-Open-Web-Platform-features" target="_blank">Other Open Web Platform features</a></li>
<li ><a href="https://sites.google.com/a/chromium.org/dev/developers/web-platform-status#TOC-DOM-APIs" target="_blank">DOM APIs</a></li>
</ul>
<p>This is certainly something to keep an eye on as, <a href="http://html5test.com/results.html" target="_blank">Chrome is setting the standard</a> in terms of HTML5 support by desktop browser vendors.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ericfeminella.com/blog/2011/09/18/tracking-html5-support-in-chrome/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multiscreen Software Design</title>
		<link>http://www.ericfeminella.com/blog/2011/03/06/multiscreen-software-design/</link>
		<comments>http://www.ericfeminella.com/blog/2011/03/06/multiscreen-software-design/#comments</comments>
		<pubDate>Sun, 06 Mar 2011 16:21:10 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[APIs]]></category>
		<category><![CDATA[Code Review]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Object Oriented Design]]></category>
		<category><![CDATA[Refactoring]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[Tablets]]></category>
		<category><![CDATA[Test Driven Development]]></category>
		<category><![CDATA[User Experience Design]]></category>

		<guid isPermaLink="false">http://www.ericfeminella.com/blog/?p=1852</guid>
		<description><![CDATA[&#8220;We are in the midst of a revolution across a variety of screens&#8221; You may recall first hearing the notion of a &#8220;Multiscreen Revolution&#8221; during the keynote at Max 2010. If you take a moment and think about it that&#8217;s a rather profound statement, and by all apparent indications a very true one. This is [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>&#8220;We are in the midst of a revolution across a variety of screens&#8221;</p></blockquote>
<p>You may recall first hearing the notion of a &#8220;Multiscreen Revolution&#8221; during the keynote at Max 2010. If you take a moment and think about it that&#8217;s a rather profound statement, and by all apparent indications a very true one.</p>
<p>This is also how <a href="http://www.adobe.com/aboutadobe/pressroom/executivebios/kevinlynch.html" target="_blank">Kevin Lynch</a>, CTO at Adobe, begins his recent article, aptly titled  &#8220;<a href="http://blogs.adobe.com/conversations/2011/02/the-multiscreen-revolution.html" target="_blank">The Multiscreen Revolution</a>&#8221; in which Kevin provides a succinct breakdown covering the driving forces behind this revolution and how it is guiding the future of the Flash Platform. </p>
<p>Allow me to digress for a moment as, in a way, for me at least, the &#8220;Multiscreen Revolution&#8221; tends to conjure up the hypothetical notion of a <a href="http://www.sciencedaily.com/releases/2010/01/100112165249.htm" target="_blank">Multiverse</a>. This may be a suitable analogy I suppose as  we have been focused in a predominantly Personal Computer based reality for many years, and while this remains relevant, it is no longer exclusive. </p>
<p>I have been giving a lot of thought lately regarding designing software in a multi form factor paradigm and felt I would share some initial thoughts on the subject. Keep in mind much of this is still quite new and subject to change; however, I have made an attempt to isolate what I feel will remain constant moving forward, particularly in the context of developing native applications with the Flash Platform across a variety of screens. </p>
<h3>First, User Experience Design</h3>
<p>My initial thoughts on the implications of what a Multiscreen paradigm will have on the way we think about the design of software are primarily concerned with <a href="http://en.wikipedia.org/wiki/User_experience_design" target="_blank">User Experience Design</a> (UX Design). While simply using <a href="http://www.w3.org/TR/css3-mediaqueries/" target="_blank">CSS3 media queries</a> to facilitate dynamic runtime layouts will be needed for most HTML based web applications, I do not believe these types of solutions alone will allow for the kinds of compelling experiences users have come to expect. Sure they are useful, and for some HTML based websites they may suffice. However, in the context of more complex applications, RIAs in particular, but also just about every application developed specifically for a PC, too, I believe UX Design will need to encompass the best of what a particular form factor, &#8220;screen&#8221; or whatever you prefer to call it, has to offer, be it a <a href="http://en.wikipedia.org/wiki/Personal_computer" target="_blank">PC</a>, <a href="http://en.wikipedia.org/wiki/Smartphone" target="_blank">smartphone</a>, <a href="http://en.wikipedia.org/wiki/Tablet_device" target="_blank">tablet</a> or <a href="http://en.wikipedia.org/wiki/Internet_television" target="_blank">TV</a>. </p>
<p>For example, it is extremely rare that a UX Design intended for users of a PC will translate directly to a Mobile or Tablet User Experience. The interactions of a traditional physical keyboard and mouse do not equate to those of <a href="http://www.mobiledia.com/glossary/228.html" target="_blank">soft keys</a>, <a href="http://en.m.wikipedia.org/wiki/Virtual_keyboard" target="_blank">virtual keyboards</a> and <a href="http://www.lukew.com/touch/TouchGestureGuide.pdf" target="_blank">touch gesture</a> interactions. Moreover, the navigation and transitions between different views and even certain concepts and metaphors are completely different. In simplest terms; it&#8217;s not &#8220;Apples to Apples&#8221;, as the expression goes.</p>
<p>With this in mind, UX Design should remain at the forefront of Software Design, and in order for that to happen UX Design will not only need to continue to reflect the needs of users, but also by leverage the capabilities of the particular devices and screens on which an application will run. This is necessary as it better serves the needs of users in new and useful ways. Likewise, UX Design will need to account for the limitations (resources in particular) of those same form factors.</p>
<h3>Second, Architecture</h3>
<p>Mulitiscreen design obviously poses some new challenges considering the growing number of form factors which will need to be taken into account. The good news is most existing well designed software architectures have been designed with this in mind all along. That is, the key factor in managing this complexity I believe will be code reuse. A common theme amongst many of my posts, code reuse has many obvious benefits, and in the context of Multiscreen concerns it will allow for different screen specific applications to leverage general, well defined and well tested APIs. Code reuse will certainly be of tremendous value when considering the complexities encountered with Multiscreen design. Such shared APIs can be reused across applications which are designed for particular screens or extended to provide screen / device specific implementations.</p>
<p>For example, the Architectures I have worked on are designed such that each is broken out into specific modules (libraries) which, on a high level, are typically as follows:</p>
<ul>
<li><strong>unittesting-support</strong>: Provides convenience extensions of unit testing and mock frameworks.</li>
<li><strong>commons:</strong> Provides all generic, reusable APIs which have no dependencies outside of those of the Flex Framework and Flash Player API. </li>
<li><strong>framework-support:</strong> Provides reusable extensions of a particular framework. There can be multiple framework-support libraries, each of which would be specific to an individual framework; e.g. parsley-support, swiz-support, robotlegs-support, cairngorm-support, springactionscript-support etc.</li>
<li><strong>business:</strong> Provides domain dependent, business specific reusable APIs which are common amongst all projects within the business domain. This includes domain models, shared services, Presentation Models, UI components and anything else which is specific to the business domain. While all of the previously listed libraries could be used with any AS3 / Flex project, the business library is intentionally coupled to the domain.</li>
</ul>
<p>All of the above projects are used by the different business applications, allowing for significantly reduced complexity of each individual application. Moreover, each library provides isolated test coverage which allows for a greater sense of confidence when building applications which are dependent on them. This type of structure also lends itself well with common SCM and build conventions, allowing for simplified branching and versioning.</p>
<p>Architectures designed similar to what I have described above I would consider to be &#8220;multiscreen ready&#8221; (provided they are optimized and efficient) in that much of the underlying implementation has already been completed, tested and proven. What&#8217;s left is the mobile, tablet or TV application designs which should be mainly concerned with UX, particularly interactions, navigation and device capabilities. From these screen specific UX Designs the application architecture is mainly focused around view concerns specific to those devices; leveraging the existing APIs as needed. This is where the <a href="http://www.martinfowler.com/eaaDev/PresentationModel.html" target="_blank">Presentation Model Pattern</a> (which I have been recommending for years) or similar patterns will be of great value. </p>
<p>I also anticipate additional libraries being abstracted in addition to those I have listed above as a result of these device specific projects being developed. For example, I could easily imagine &#8220;device-support&#8221;, &#8220;mobile-support&#8221; and &#8220;tablet-support&#8221; projects which would provide reusable APIs specific for those screens so as to be leveraged across applications. In fact, I am working on libraries such as these at the moment.</p>
<p>Reusable libraries are nothing new; however, their role now is perhaps even more important as it is quite likely that multiple implementations of the same application will be needed for the various form factors and contexts. Existing reusable libraries may also need to be further optimized to provide the best performance against the slowest devices in order to be considered suitable for devices with the most limited resources. A natural side effect of such optimizations is that implementations of an application targeting the fastest form factors (typically, PCs) will benefit greatly.</p>
<h3>Some Concluding Thoughts</h3>
<p>In short, I believe both users and developers alike will be best served by providing unique User Experiences for specific screens as opposed to attempting to adapt the same application across multiple screens. One of the easiest ways of managing the complexity of multiscreen design and development will inevitably be code reuse. </p>
<p>I also believe the main point of focus should be on the medium and small form factors; i.e. Tablets and Smart phones. Not only for the more <a href="http://www.lukew.com/ff/entry.asp?933" target="_blank">common reasons</a> but, also because I believe PCs and Laptops will eventually be used almost exclusively for developing the applications which run on the other form factors. In fact, I can say this from my own experiences already.</p>
<p>While there is still much to learn in the area of Multiscreen Design, I feel the ideas I&#8217;ve expressed here will remain relevant. Over the course of the coming months I plan to dedicate much of my time towards further exploration of this topic and will certainly continue to share my findings.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ericfeminella.com/blog/2011/03/06/multiscreen-software-design/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Practices of an Agile Developer</title>
		<link>http://www.ericfeminella.com/blog/2011/02/10/practices-of-an-agile-developer/</link>
		<comments>http://www.ericfeminella.com/blog/2011/02/10/practices-of-an-agile-developer/#comments</comments>
		<pubDate>Thu, 10 Feb 2011 22:24:04 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[APIs]]></category>
		<category><![CDATA[Code Review]]></category>
		<category><![CDATA[Continuous Integration]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Object Oriented Design]]></category>
		<category><![CDATA[Refactoring]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[Test Driven Development]]></category>

		<guid isPermaLink="false">http://www.ericfeminella.com/blog/?p=1753</guid>
		<description><![CDATA[Of the many software engineering books I have read over the years, Practices of an Agile Developer in particular continues to be one book I find myself turning to time and time again for inspiration. Written by two of my favorite technical authors, Andy Hunt and Venkat Subramaniam, and published as part of the Pragmatic [...]]]></description>
			<content:encoded><![CDATA[<p>Of the many software engineering books I have read over the years, <a href="http://pragprog.com/titles/pad/practices-of-an-agile-developer" target="_blank">Practices of an Agile Developer</a> in particular continues to be one book I find myself turning to time and time again for inspiration.</p>
<p>Written by two of my favorite technical authors, <a href="http://blog.toolshed.com/" target="_blank">Andy Hunt</a> and <a href="http://www.agiledeveloper.com/aboutus.html" target="_blank">Venkat Subramaniam</a>, and published as part of the <a href="http://pragprog.com/" target="_blank">Pragmatic Bookshelf</a>, Practices of an Agile Developer provides invaluable, practical and highly inspirational solutions to the most common challenges we as software engineers face project after project.</p>
<p>What makes Practices of an Agile Developer something truly special is the simplicity and easy to digest format in which it is written; readers can jump in at any chapter, or practically any page for that matter, and easily learn something new and useful in a matter of minutes. </p>
<p>While covering many of the most common subjects on software development, as well as many particularly unique subjects, it is the manner in which the subjects are presented that makes the book itself quite unique. The chapters are formatted such that each provides an &#8220;<em>Angel vs. Devil on your shoulders</em>&#8221; perspective of each topic. This is quite useful as one can briefly reference any topic to take away something useful by simply reading the chapters title and the &#8220;Angel vs. Devil&#8221; advice, and from that come to a quick understanding of the solution. Moreover, each chapter also provides tips on &#8220;<em>How it Feels</em>&#8221; when following one of the prescribed approaches. The &#8220;How it feels&#8221; approach is very powerful in that it instantly draws readers in for more detailed explanations. Complimentary to this is the &#8220;<em>Keeping your balance</em>&#8221; suggestions which provide useful insights to many of the challenges one might face when trying to apply the learnings of a particular subject. &#8220;Keeping your Balance&#8221; tips answer questions which would otherwise be left to the reader to figure out.</p>
<p>I first read Practices of an Agile Developer almost 4 years ago, and to this day I regularly find myself returning to it time and time again for inspiration. A seminal text by all means, I highly recommend it as a must read for Software Developers of all levels and disciplines.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ericfeminella.com/blog/2011/02/10/practices-of-an-agile-developer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bindable Map</title>
		<link>http://www.ericfeminella.com/blog/2010/10/18/bindable-map/</link>
		<comments>http://www.ericfeminella.com/blog/2010/10/18/bindable-map/#comments</comments>
		<pubDate>Mon, 18 Oct 2010 14:00:48 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[APIs]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Object Oriented Design]]></category>

		<guid isPermaLink="false">http://www.ericfeminella.com/blog/?p=1117</guid>
		<description><![CDATA[Recently I was going through some old drafts I had pending when I happened to notice I had never published this one, so I am finally doing so now&#8230; Since first publishing an AS3 HashMap implementation back in December of 2006, much to my surprise the original post through which I released the API still [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I was going through some old drafts I had pending when I happened to notice I had never published this one, so I am finally doing so now&#8230;</p>
<p>Since first publishing an AS3 <a href="http://code.ericfeminella.com/classes/as3/HashMap.as.html" target="_blank">HashMap</a> implementation back in <a href="http://www.ericfeminella.com/blog/2006/12/" target="_blank">December of 2006</a>, much to my surprise the <a href="http://www.ericfeminella.com/blog/2006/12/05/as3-hashmap-for-flex/" target="_blank">original post</a> through which I released the API still yields a good amount of feedback each month.</p>
<p>In the time since I have extended the functionality of the HashMap to include a <a href="http://www.ericfeminella.com/blog/2008/03/09/localpersistence-map/" target="_blank">LocalPersistenceMap</a> and <a href="http://www.ericfeminella.com/blog/2008/02/08/as3-resourcemap-api/" target="_blank">ResourceMap</a> in addition to the original HashMap; all of which implement the <a href="http://code.ericfeminella.com/classes/as3/IMap.as.html" target="_blank">IMap</a> interface and can be used interchangeably by client code.</p>
<p>The single most requested feature I have received has by far been to provide a <a href="http://livedocs.adobe.com/flex/3/html/help.html?content=databinding_8.html" target="_blank">Bindable</a> HashMap implementation, and, just recently, I decided to implement one and share it with the community. </p>
<p>The implementation of the <a href="http://code.ericfeminella.com/classes/as3/BindableMap.as.html" target="_blank">BindableMap</a> is quite straightforward as it simply provides an API which wraps an IMap implementation in order to facilitate data binding capabilities to all read methods of the underlying Map. </p>
<p>Using the various IMap implementations with BindableMap yields some interesting possibilities; specifically when using BindableMap with LocalPersistenceMap as it essentially provides a bindable implementation of a LocalSharedObject, as can be seen in the following example  (e.g. add some values and refresh the page):</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_BindableHashMapExample_1963675008"
			class="flashmovie"
			width="400"
			height="400">
	<param name="movie" value="http://www.ericfeminella.com/blog/resources/flex/BindableHashMapExample/BindableHashMapExample.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.ericfeminella.com/blog/resources/flex/BindableHashMapExample/BindableHashMapExample.swf"
			name="fm_BindableHashMapExample_1963675008"
			width="400"
			height="400">
	<!--<![endif]-->
		
<p><a href="http://adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>

	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>You can download the source, binary and example <a href="http://code.ericfeminella.com/opensource/flex/apis/as3-hashmap.zip" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ericfeminella.com/blog/2010/10/18/bindable-map/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Timing Specification</title>
		<link>http://www.ericfeminella.com/blog/2010/07/20/web-timing-specification/</link>
		<comments>http://www.ericfeminella.com/blog/2010/07/20/web-timing-specification/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 09:02:05 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[APIs]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[html5 family]]></category>
		<category><![CDATA[mobile web]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[web timing]]></category>

		<guid isPermaLink="false">http://www.ericfeminella.com/blog/?p=993</guid>
		<description><![CDATA[The Web Timing Specification (draft) aims at providing a standard set of APIs which allow for true end-to-end instrumentation of page load times across browsers. To quote the w3 spec: &#8220;This specification (Web Timing Specification) defines an interface for web applications to access timing information related to navigation and elements.&#8221; The API is based on [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://dev.w3.org/2006/webapi/WebTiming/" target="_blank">Web Timing Specification</a> (draft) aims at providing a standard set of APIs which allow for true end-to-end instrumentation of page load times across browsers. </p>
<p>To quote the w3 spec: &#8220;This specification (Web Timing Specification) defines an interface for web applications to access timing information related to navigation and elements.&#8221; The API is based on the <a href="http://dev.w3.org/2006/webapi/WebTiming/#navigation-timing">Navigation Timing</a> and <a href="http://dev.w3.org/2006/webapi/WebTiming/#resource-timing">Resource Timing</a> interfaces, respectively.  </p>
<p>While I haven&#8217;t seen this specification mentioned as part of the <a href="http://www.ericfeminella.com/blog/2010/07/18/the-html5-family/" target="_blank">HTML5 Family</a> before, in many ways I would consider it to be a worthy candidate for membership as it provides a standards based API through which web applications can be tested for load efficiency. This is obviously something quite useful for any web application as, the ability to precisely measure page load times &#8211; and implement optimizations as needed &#8211; affords developers the opportunity to provide an improved user experience.</p>
<p>Historically, the ability to accurately measure page load times of web applications has been quite challenging for a number reasons. Just knowing when and where to begin is debatable and, determining the best means of doing so can be a challenge in of itself. Regardless of any current strategies being used, the result is never entirely accurate. With Web Timing developers need not be concerned with these specifics as the API provides the ability to truly measure page load times by encompassing the full scope of loading and parsing a page. This includes the time involved to request, receive and render an HTML document.</p>
<p>For more information, try out the examples in the current supported browsers; <a href="http://ie.microsoft.com/testdrive/Performance/msPerformance/Default.html" target="_blank">IE9</a>, <a href="http://webtimingdemo.appspot.com/?r=1&#038;b=1&#038;l=1&#038;bustcache=1280702927892" target="_blank">Chrome 6</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ericfeminella.com/blog/2010/07/20/web-timing-specification/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Metadata API update for Flex 4</title>
		<link>http://www.ericfeminella.com/blog/2010/01/30/metadata-api-update-for-flex-4/</link>
		<comments>http://www.ericfeminella.com/blog/2010/01/30/metadata-api-update-for-flex-4/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 03:22:20 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[APIs]]></category>
		<category><![CDATA[Refactoring]]></category>
		<category><![CDATA[Test Driven Development]]></category>

		<guid isPermaLink="false">http://www.ericfeminella.com/blog/?p=565</guid>
		<description><![CDATA[Back in September 2008 I published a post on Class Annotations in Flex, through which I provided an API allowing for a unified approach for working with AS3 metadata. Just recently I intended to use the Metadata API in a Flex 4 project when I noticed it no longer seemed to work as expected. After [...]]]></description>
			<content:encoded><![CDATA[<p>Back in <a href="http://www.ericfeminella.com/blog/2008/09/" target="_blank">September 2008</a> I published a post on <a href="http://www.ericfeminella.com/blog/2008/09/13/class-annotations-in-flex/" target="_blank">Class Annotations in Flex</a>, through which I provided an API allowing for a unified approach for working with AS3 metadata. Just recently I intended to use the Metadata API in a Flex 4 project when I noticed it no longer seemed to work as expected. After a bit of debugging, I realized the bug appeared to be related to changes in the result returned from describeType; specifically, the addition of the &#8220;__go_to_definition_help&#8221; metadata. Considering the Metadata API leverages describeType in order to introspect metadata definitions, this made sense. </p>
<p>I made some simple modifications to the API to work with the new metadata returned from describeType and this resolved the issue. While I was in the process I also refactored operations to return Vectors as opposed to ArrayCollections, as was the case in the original design; effectively optimizing the API for <a href="http://opensource.adobe.com/wiki/display/flexsdk/MXML+Vector+Support" target="_blank">Flex 4</a> (as well as <a href="http://www.dsd.go.th/itrain/km/53/53/Flex3_Documentation/langref/Vector.html" target="_blank">Flex SDK 3.4</a>).</p>
<p>You can download the source/tests/swc/docs dist <a href="http://code.ericfeminella.com/apis/annotations.zip" target="_blank">here</a>; all of which will be available soon via SVN and a public Maven repository, more on that once it&#8217;s ready.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ericfeminella.com/blog/2010/01/30/metadata-api-update-for-flex-4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Vector Iterator for Flex</title>
		<link>http://www.ericfeminella.com/blog/2009/10/02/simple-vector-iterator-for-flex/</link>
		<comments>http://www.ericfeminella.com/blog/2009/10/02/simple-vector-iterator-for-flex/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 13:06:01 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[APIs]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Object Oriented Design]]></category>

		<guid isPermaLink="false">http://www.ericfeminella.com/blog/?p=387</guid>
		<description><![CDATA[One of the many welcome additions to the Flex 3.4 SDK is the inclusion of the Vector class. Vectors in particular are especially welcome as they provide compile time type safety over what would otherwise not be available when implementing custom solutions, such as a typed collection. Essentially, Vectors are just typed Arrays. And while [...]]]></description>
			<content:encoded><![CDATA[<p>One of the many welcome additions to the <a href="http://opensource.adobe.com/wiki/display/flexsdk/Flex+SDK" target="_blank">Flex 3.4 SDK</a> is the inclusion of the <a href="http://livedocs.adobe.com/flex/3/langref/Vector.html" target="_blank">Vector class</a>. Vectors in particular are especially welcome as they provide compile time type safety over what would otherwise not be available when implementing custom solutions, such as a <a href="http://code.ericfeminella.com/classes/as3/TypedCollection.as.html" target="_blank">typed collection</a>. </p>
<p>Essentially, Vectors are just typed Arrays. And while not as robust or powerful, Vectors are similar to <a href="http://msdn.microsoft.com/en-us/library/512aeb7t%28VS.80%29.aspx" target="_blank">Generics in C#</a> and <a href="http://java.sun.com/j2se/1.5.0/docs/guide/language/generics.html" target="_blank">Java</a>. When it is known at design time that a collection will only ever need to work with a single type, Vectors can be utilized to provide type safety and also to allow for significant performance gains over using other collection types in Flex.</p>
<p>I recently wanted to convert quite a few typed Array implementations to Vectors, however, the Arrays were being traversed with an Iterator. In order to reduce the amount of client code which needed to be refactored I simply implemented a Vector specific <a href="http://code.ericfeminella.com/classes/as3/Iterator.as.html" target="_blank">Iterator</a> implementation.</p>
<p>If you are familiar with <a href="http://en.wikipedia.org/wiki/Iterator_pattern" target="_blank">Iterator Pattern</a> in general, and the <a href="http://code.ericfeminella.com/classes/as3/Iterator.as.html" target="_blank">Iterator</a> interface in particular, then usage will prove to be very straight forward. You can use the Vector Iterator to perform standard iterations over a Vector. Below is an example of a typical client implementation:</p>
<div class="dean_ch" style="white-space: wrap;">
<p><span class="kw2">var</span> abc:Vector.&lt;String&gt; = <span class="kw2">new</span> Vector.&lt;String&gt;<span class="br0">&#40;</span><span class="nu0">3</span>, <span class="kw2">true</span><span class="br0">&#41;</span>;<br />
abc<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span> = <span class="st0">&quot;a&quot;</span>;<br />
abc<span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span> = <span class="st0">&quot;b&quot;</span>;<br />
abc<span class="br0">&#91;</span><span class="nu0">2</span><span class="br0">&#93;</span> = <span class="st0">&quot;c&quot;</span>;</p>
<p><span class="kw2">var</span> it:Iterator = <span class="kw2">new</span> VectorIterator<span class="br0">&#40;</span> alpha <span class="br0">&#41;</span>;</p>
<p><span class="kw1">while</span> <span class="br0">&#40;</span> it.<span class="me1">hasNext</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw3">trace</span><span class="br0">&#40;</span> it.<span class="me1">next</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; <span class="co1">// a, b, c</span><br />
<span class="br0">&#125;</span></div>
<p>Using an Iterator with a Vector ensures only a linear search can be performed, which proves useful with Vectors as they are dense Arrays. However, one consideration that must be made when using an Iterator with a Vector is that you loose type safety when accessing items in the Vector via iterator.next(). It is because of this I would suggest only using Iterator&#8217;s with Vectors to support backwards compatibility when refactoring existing Arrays which are being used with existing Iterators. </p>
<p>The <code>VectorIterator</code> and it&#8217;s associated test are available below:<br />
<a href="http://code.ericfeminella.com/classes/as3/VectorIterator.as.html" target="_blank" >VectorIterator</a><br />
<a href="http://code.ericfeminella.com/tests/as3/VectorIteratorTest.as.html" target="_blank">VectorIteratorTest</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ericfeminella.com/blog/2009/10/02/simple-vector-iterator-for-flex/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Simple RPC Instrumentation in Flex</title>
		<link>http://www.ericfeminella.com/blog/2009/09/20/instrumenting-remote-procedure-calls-rpc/</link>
		<comments>http://www.ericfeminella.com/blog/2009/09/20/instrumenting-remote-procedure-calls-rpc/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 03:47:28 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[APIs]]></category>
		<category><![CDATA[Object Oriented Design]]></category>
		<category><![CDATA[Software Engineering]]></category>

		<guid isPermaLink="false">http://www.ericfeminella.com/blog/?p=354</guid>
		<description><![CDATA[On occasion developers may find a need to quickly measure the time it takes for a request to a remote service to return a response back to the client without the need to employ an automated testing tool to perform the instrumentation. This information can prove quite valuable for performing application diagnostics on the client [...]]]></description>
			<content:encoded><![CDATA[<p>On occasion developers may find a need to quickly measure the time it takes for a request to a remote service to return a response back to the client without the need to employ an automated testing tool to perform the instrumentation. This information can prove quite valuable for performing application diagnostics on the client and, when measured in terms of code execution, monitoring at the execution level will always be a bit more precise than that which can be measured by using a Network proxy alone, such as <a href="http://www.charlesproxy.com/" target="_blank">Charles</a> or <a href="http://www.fiddler2.com/fiddler2/" target="_blank">Fiddler</a>, etc.</p>
<p>Obviously there are numerous solutions which can be implemented to monitor the elapsed time of a service invocation, however it was my goal to provide a unified solution which could easily be implemented into existing client code without significant refactorings being required.</p>
<p>In order to achieve this I first needed to consider what the typical implementation of a service invocation is in order to isolate the<br />
commonality. From there it is only a matter of determining a solution that meets the objective in the most non intrusive manner possible.</p>
<p>To begin let us consider what a &#8220;typical&#8221; service invocation might look like for the three most common services available in the Flex Framework; <a href="http://livedocs.adobe.com/flex/3/langref/mx/rpc/http/HTTPService.html" target="_blank">HTTPService</a>, <a href="http://livedocs.adobe.com/flex/3/langref/mx/rpc/remoting/mxml/RemoteObject.html" target="_blank">RemoteObject</a> and <a href="http://livedocs.adobe.com/flex/3/langref/mx/rpc/soap/WebService.html" target="_blank">WebService</a>.</p>
<div class="dean_ch" style="white-space: wrap;">
<p><span class="co1">// HTTPService</span><br />
<span class="kw2">var</span> <span class="kw3">call</span>:AsyncToken = service.<span class="kw3">send</span><span class="br0">&#40;</span>&#8230;<span class="br0">&#41;</span>;<br />
<span class="kw3">call</span>.<span class="me1">addResponder</span><span class="br0">&#40;</span> <span class="kw3">this</span> <span class="br0">&#41;</span>;</p>
<p><span class="co1">// RemoteObject</span><br />
<span class="kw2">var</span> <span class="kw3">call</span>:AsyncToken = service.<span class="me1">someMethod</span><span class="br0">&#40;</span>&#8230;<span class="br0">&#41;</span>;<br />
<span class="kw3">call</span>.<span class="me1">addResponder</span><span class="br0">&#40;</span> <span class="kw3">this</span> <span class="br0">&#41;</span>;</p>
<p><span class="co1">// WebService</span><br />
<span class="kw2">var</span> <span class="kw3">call</span>:AsyncToken = service.<span class="me1">someOperation</span><span class="br0">&#40;</span>&#8230;<span class="br0">&#41;</span>;<br />
<span class="kw3">call</span>.<span class="me1">addResponder</span><span class="br0">&#40;</span> <span class="kw3">this</span> <span class="br0">&#41;</span>;<br />
&nbsp;</div>
<p>Based on the 3 above  implementations we can deduce that the common API used when performing a service invocation is <a href="http://livedocs.adobe.com/flex/3/langref/mx/rpc/AsyncToken.html" target="_blank">AsyncToken</a>. So to provide a unified solution for all three common Services we could either extend AsyncToken or provider an API which wraps AsyncToken. For my needs I chose to implement an API which simply monitors an AsyncToken from which the duration of an invocation can be determined, thus I wrote an RPCDiagnostics API which can be &#8220;plugged&#8221; into an AsyncToken client implementation.</p>
<p>RPCDiagnostics provides basic performance analysis of a Remote Procedure Call by providing a message which displays information about the operation duration via a standard <a href="http://livedocs.adobe.com/flex/3/langref/package.html#trace%28%29" target="_blank">trace</a> call. In addition, an event listener of type <code>RPCDiagnosticsEvent</code> can be added to facilitate custom diagnostics and Logging. </p>
<p>RPCDiagnostics can easily be implemented as an addition to an existing <code>AsyncToken</code> or in place of an <code>AsyncToken</code>. The following examples demonstrate both implementations.</p>
<p>Implementing <code>RPCDiagnostics</code> onto an existing <code>AsyncToken</code>:</p>
<div class="dean_ch" style="white-space: wrap;">
<p><span class="kw2">var</span> <span class="kw3">call</span>:AsyncToken = <span class="kw2">null</span>;<br />
<span class="kw3">call</span> = RPCDiagnostics.<span class="me1">monitorToken</span><span class="br0">&#40;</span>service.<span class="kw3">send</span><span class="br0">&#40;</span><span class="br0">&#41;</span>,<span class="st0">&quot;methodName&quot;</span><span class="br0">&#41;</span>;<br />
<span class="kw3">call</span>.<span class="me1">addResponder</span><span class="br0">&#40;</span> &#8230; <span class="br0">&#41;</span>;<br />
&nbsp;</div>
<p>Implementing <code>RPCDiagnostics</code> in place of an <code>AsyncToken</code>:</p>
<div class="dean_ch" style="white-space: wrap;">
<p><span class="kw2">var</span> <span class="kw3">call</span>:RPCDiagnostics = <span class="kw2">null</span>;<br />
<span class="kw3">call</span> = <span class="kw2">new</span> RPCDiagnostics<span class="br0">&#40;</span> service.<span class="kw3">send</span><span class="br0">&#40;</span><span class="br0">&#41;</span>, <span class="st0">&quot;methodName&quot;</span> <span class="br0">&#41;</span>;<br />
<span class="kw3">call</span>.<span class="me1">addResponder</span><span class="br0">&#40;</span> &#8230; <span class="br0">&#41;</span>;<br />
&nbsp;</div>
<p>Implementing a listener to an RPCDiagnostics instance:</p>
<div class="dean_ch" style="white-space: wrap;">
<p><span class="kw2">var</span> <span class="kw3">call</span>:RPCDiagnostics = <span class="kw2">null</span>;<br />
<span class="kw3">call</span> = <span class="kw2">new</span> RPCDiagnostics<span class="br0">&#40;</span> service.<span class="kw3">send</span><span class="br0">&#40;</span><span class="br0">&#41;</span>, <span class="st0">&quot;operationName&quot;</span> <span class="br0">&#41;</span>;<br />
<span class="kw3">call</span>.<span class="me1">addResponder</span><span class="br0">&#40;</span> &#8230; <span class="br0">&#41;</span>;<br />
<span class="kw3">call</span>.<span class="me1">addEventListener</span><span class="br0">&#40;</span> RPCDiagnosticsEvent.<span class="me1">EXECUTION_COMPLETE</span>, <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;handler<span class="br0">&#41;</span>;<br />
&nbsp;</div>
<p>The RPCDiagnostics API and dependencies can be downloaded via the <a href="http://www.ericfeminella.com/blog/actionscript-3-apis/" target="_blank">Open Source AS3 APIs</a> page or from the below links:</p>
<p><a href="http://code.ericfeminella.com/classes/as3/RPCDiagnostics.as.html" target="_blank">RPCDiagnostics</a><br />
<a href="http://code.ericfeminella.com/classes/as3/RPCDiagnosticsEvent.as.html" target="_blank">RPCDiagnosticsEvent</a><br />
<a href="http://code.ericfeminella.com/classes/as3/Execution.as.html" target="_blank">Execution</a> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.ericfeminella.com/blog/2009/09/20/instrumenting-remote-procedure-calls-rpc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Open Source AS3 APIs</title>
		<link>http://www.ericfeminella.com/blog/2009/08/30/open-source-as3-apis/</link>
		<comments>http://www.ericfeminella.com/blog/2009/08/30/open-source-as3-apis/#comments</comments>
		<pubDate>Sun, 30 Aug 2009 14:38:37 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[APIs]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Refactoring]]></category>
		<category><![CDATA[Test Driven Development]]></category>

		<guid isPermaLink="false">http://www.ericfeminella.com/blog/?p=330</guid>
		<description><![CDATA[For the past 4 years or so I have provided quite a few AS3 APIs as Open Source to the Flex Community, via my blog. These APIs can typically be found at the Open Source AS3 APIs page however, the page is basically just a URI to a series of arbitrarily added AS3 source classes. [...]]]></description>
			<content:encoded><![CDATA[<p>For the past 4 years or so I have provided quite a few AS3 APIs as Open Source to the Flex Community, via my blog. These APIs can typically be found at the Open Source AS3 APIs page however, the page is basically just a URI to a series of arbitrarily added AS3 source classes. It was originally intended to simply serve as a convenient location to access the source, and it had always been my  intention to eventually break out all of these APIs into seperate SVN projects.</p>
<p>So with that being said I am finally in the process of making the structural changes I had originally envisioned. Moving forward I will begin the process of creating seperate SVN projects for these Open Source APIs; with the primary goal being to provide practical APIs that only require minimal (if any) dependencies on additional libraries, complete test coverage via Flex Unit 4 and Mavenized builds. </p>
<p>The first project to move over to the new project structure will be the AS3 collections project as the classes in this package, specifically HashMap, have proven to provide the most value according to community feedback.</p>
<p>So stayed tuned! </p>
]]></content:encoded>
			<wfw:commentRss>http://www.ericfeminella.com/blog/2009/08/30/open-source-as3-apis/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

