<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Flex and Flash Developer - Jesse Warden dot Kizz-ohm</title>
	
	<link>http://jessewarden.com</link>
	<description>A blog on software development, technology, games &amp; movies.</description>
	<lastBuildDate>Tue, 03 Nov 2009 17:05:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/jessewarden" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Good Memory Management When Using PureMVC</title>
		<link>http://feedproxy.google.com/~r/jessewarden/~3/3uTsw2-6W4g/good-memory-management-when-using-puremvc.html</link>
		<comments>http://jessewarden.com/2009/11/good-memory-management-when-using-puremvc.html#comments</comments>
		<pubDate>Tue, 03 Nov 2009 16:35:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://jessewarden.com/?p=1845</guid>
		<description><![CDATA[Preface
There are a lot of good articles already written &#38; screen casts about memory management in Flash Player.  I encourage you to read them first before reading the below.  I cover memory management in a large application using a PureMVC architecture, typically on top of Flex.


Unloading Flex Modules
Resource Management in AS3 Session Notes Available
AS3 Resource [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Preface</strong></p>
<p>There are a lot of good articles already written &amp; screen casts about memory management in Flash Player.  I encourage you to read them first before reading the below.  I cover memory management in a large application using a PureMVC architecture, typically on top of Flex.<br />
<span id="more-1845"></span></p>
<ul>
<li><a href="http://blogs.adobe.com/aharui/2009/08/what_we_know_about_unloading_m.html">Unloading Flex Modules</a></li>
<li><a href="http://www.gskinner.com/blog/archives/2006/09/resource_manage.html">Resource Management in AS3 Session Notes Available</a></li>
<li><a href="http://www.gskinner.com/blog/archives/2006/06/as3_resource_ma.html">AS3 Resource Management: Part 1</a></li>
<li><a href="http://www.gskinner.com/blog/archives/2006/09/garbage_collect.html">Garbage Collector Interactive Simulator</a></li>
<li><a href="http://blogs.adobe.com/aharui/2007/03/garbage_collection_and_memory.html">Garbage Collection and Memory Leaks</a></li>
<li><a href="http://onflash.org/ted/2009/07/memory-performance-in-land-of.php">Memory Performance in the Land of References</a></li>
<li><a href="http://www.quasimondo.com/archives/000691.php">Flash Player Memory Management</a></li>
<li><a href="http://lab.polygonal.de/2008/06/18/using-object-pools/">Using Object Pools</a></li>
<li><a href="http://www.bigroom.co.uk/blog/object-pool-class">Object Pool Class</a></li>
<li><a href="http://blog.joa-ebert.com/2008/05/07/tweening-and-object-pools/">Tweening and Object Pools</a></li>
<li><a href="http://spreadingfunkyness.com/garbage-collection-with-flex-and-adobe-air/">Garbage Collection with Flex and Adobe AIR</a></li>
<li><a href="http://www.iheartair.com/?cat=133">Screencast: Performance and Memory Management</a></li>
</ul>
<p><strong>Introduction</strong></p>
<p>Memory Management, referring to making sure your application doesn&#8217;t leak memory through the use of responsible coding practices, is hard.  It&#8217;s even harder if you don&#8217;t have a history of having to deal with such things (*cough* Flash Developers *cough*).  It was challenging for me to learn&#8230; and I&#8217;m still learning.  As the Flex community has grown, we&#8217;ve seen the influx of more traditional programmers to help write blog entries and white papers, especially for AIR apps, on better memory management, how to prevent memory leaks, and how memory in the Flash Player works (and doesn&#8217;t work).</p>
<p>What I haven&#8217;t seen is this applied to Enterprise programming and frameworks.  Most articles are either from a Flash game developer, or a Flex dev referring to AIR applications.  From my consulting, the people who need the biggest help are doing the web applications that need to run as long as a normal desktop application.  Below, I&#8217;ve documented how you do this using PureMVC.</p>
<p><strong>Why Memory Management?</strong></p>
<p>Many Flex &amp; Flash projects don&#8217;t need to use good memory techniques.  Memory leaks on a small scale are ok.  If the application is responsive to the user, you have no problem.  The purists will argue that creating a bunch of things and not removing them from RAM is bad.  However, if your application works, is responsive to the user, and doesn&#8217;t adversely affect other applications, then the purist is wrong.</p>
<p>For things like games that use a lot of system resources, or applications that need to run on your computer longer than 10 minutes, memory leaks will eventually use all available memory that a SWF is allowed, and cause it to stop working, or the browser to crash.  The application will be slow to respond, Garbage Collection may freeze Flash Player while it attempts to clean up, and/or your memory will become fragmented over time.  Fragmented memory makes things slower to access it, and thus can slow down your application.</p>
<p>Another side effect of not cleaning up the memory you&#8217;ve used yet no longer need is weird bugs.  You&#8217;ll sometimes have objects around that are doing things, yet you have no strong-references to.  Examples include timers still running, service classes that were &#8220;removed&#8221; yet receive a response from the server and no one is still listening for the response, or duplicate PureMVC classes.  Weird bugs can arise from these situations, causing your debugging time for problems to take longer.</p>
<p>Bottom line: If you want  your application to run for hours at a time, not to adversely affect other applications, and remain responsive, you need to employ good memory management.</p>
<p>Smaller projects that have memory leaks can often be re-factored.  Enterprise ones, however, will often take months to fix.  Worse, those months will have a major lack of visible project progress as things are broken on purpose to get things back into shape.  This is sometimes a contributor to the reason larger projects have the infamous &#8220;last 10% is 90% of the work&#8221;.  If you don&#8217;t start early with easy to follow conventions, it&#8217;ll be really hard to add them in later in; &#8220;add&#8221; is too nice a word since those projects don&#8217;t just stop to wait for you to clean up some memory; the logistics are a lot more complex than that.</p>
<p>This is even worse in <a href="http://jessewarden.com/2008/11/agile-chronicles-1-stressful.html">Agile</a>.  Where 80% of your time is re-factoring and you&#8217;re constantly creating new code, it&#8217;s quite challenging to keep up.  The best you can do is have a good understanding of the life cycle of your app.  The better understanding you have, the better you&#8217;ll be able to know what you don&#8217;t have to clean up, and what you do; i.e. when you have to write code and when you don&#8217;t.  Remember, designers / UX people can help here.  They&#8217;ll be able to give you a better understand of user paths into your app, and you can focus on what truly matters and knowingly let the rest remain in memory.</p>
<p>Example: If the user is constantly creating 3 types of forms, you can focus your efforts on ensuring they are cleaned up.  If the user hardly ever goes to a FAQ page, you can spend little to no time ensuring it&#8217;s cleaned up.  The reverse can be true as well.  If the 3 forms are accessed often, you can ensure that only the data they create is unique, but the forms themselves remain in RAM.  You can instead focus your efforts on those items that are rarely accessed.  If you user does go to the FAQ page, they shouldn&#8217;t be punished when they leave; it should remove from memory.</p>
<p><strong>Why NOT memory management?</strong></p>
<p>Memory management, sadly, requires you to often write more code.  More code is a negative contributor to projects.  For Enterprise code bases, they are often quite large.  Even when all features are completed, you are often adding more code for modifying features, or fixing bugs.  The last thing you want to do is knowingly add more code if you can help it.</p>
<p>A common practice for classes is to add destructor methods.  These are basically methods that are called &#8220;public function destroy():void&#8221; and clean up the class.  It&#8217;ll remove strong event listeners, remove child display objects, and stop asynchronous classes such as Timers, Sockets, and service classes.  Another common practice is to create &#8220;addListeners&#8221; and &#8220;removeListeners&#8221; functions that will do just that; add event listeners to an object/objects, and remove them.</p>
<p>Often, though, both classes fall into the trap of those methods never staying in sync with the rest of the class.  If you create a new object, you forget to clean it up in destroy.  That, or you add a new event listener amongst the other 4, but forget to add it to the removeListeners function.  Worse, and most often the case, these methods aren&#8217;t ever called.</p>
<p>The developer meant well, but ended up creating more code, code that isn&#8217;t used, and code that isn&#8217;t even finished with no obvious indications thereof.  The road to hell is paved with good intentions.</p>
<p><strong>When View&#8217;s Go Away</strong></p>
<p>When creating applications, whether Flash or Flex, you&#8217;ll have View&#8217;s that are shown and hidden.  You&#8217;ll have to make the decision how they are hidden.  If you need the View quickly, you&#8217;ll set visible to false and true.  If you don&#8217;t need to View quickly, you&#8217;ll simply addChild/removeChild.  If you only need the View rarely, you can destroy it entirely and rebuild it when you need it.</p>
<p>When you know you need to destroy a View, then you can write code to remove it from memory.  This is the only <a href="http://en.wikipedia.org/wiki/You_ain't_gonna_need_it">YAGNI</a> approach I&#8217;ve found that works.  Meaning, as soon as you recognize you&#8217;ll need to remove a View, only then do you write code to clean up the mess.  If you do it prematurely, you just wrote a bunch of code you may never need, and now have to maintain.  Adding it later actually isn&#8217;t so bad, but that assumed you designed for it.  Meaning, if you don&#8217;t make it easy to remove a View, it&#8217;ll be hard because you first have to re-factor the code that uses it.</p>
<p>From a GUI perspective, this is sometimes ok.  Take the case of a View used in a Flex ViewStack.  All a ViewStack does when you leave a View is remove the View from the DisplayList.  If she&#8217;s a big View, that&#8217;s nice&#8230; but not enough.  You&#8217;ll need to refactor this code to support the child in the ViewStack from being destroyed.  You can either wrap the View you want destroyed in say, a Canvas that has code to destroy/create the single child View based on Event.ADDED/Event.REMOVED.  That, or you could make the child a ModuleLoader, and based on Event.ADDED/Event.REMOVED, load/unload the module.  Or, you could just write a function that creates/destroys views based on where it&#8217;s supposed to go.  You lose the flexibility &amp; ease of using a ViewStack, but you get more control with more efficient code.</p>
<p><strong>Registering &amp; Unregistering View&#8217;s in PureMVC</strong></p>
<p>&#8230;but this assumes you can, in fact, get the View out of memory.  In the case of frameworks, larger Views will often use the <a href="http://martinfowler.com/eaaDev/PresentationModel.html">Presentation</a> pattern, a Mediator, or something like it.  Sometimes it&#8217;s directly in the View itself.  How ever it&#8217;s done, the &#8220;Master View&#8221; will integrate with a framework.  In PureMVC, this is usually via registering itself with PureMVC.  There are varying ways to do this.  The way I do it is via ApplicationFacade.getInstance().registerMyView(this), where &#8220;this&#8221; is the instance reference passed in.  The ApplicationFacade will take the instance, create &amp; register a Mediator passing the instance into the constructor of the Mediator.</p>
<pre><span class="keyword">public</span> <span class="keyword">function</span> registerMyView(view:MyView):<span class="keyword">void</span>
{
        facade.registerMediator(<span class="keyword">new</span> MyViewMediator(view));
}</pre>
<p>Others will dispatch an event, and have a Command class handle those details to prevent their ApplicationFacade from growing large.  Either way, time and time again, I see View&#8217;s that should be removed, but have no &#8220;unregister&#8221; function, nor a Command to remove the Mediator.  Basically, there is a lot of code to register the View the the framework and create associated Application domain classes, but nothing to clean up everything when you&#8217;re done with it.</p>
<p>The way I do it is via ApplicationFacade.getInstance().unregisterMyView(this).  This is the opposite of the last method; it&#8217;ll unregister the Mediator.  The Mediator&#8217;s onRemove function will fire, which gives the Mediator an opportunity to clean itself up.</p>
<pre><span class="keyword">public</span> <span class="keyword">function</span> unregisterMyView():<span class="keyword">void</span>
{
        facade.removeMediator(MyViewMediator.NAME);
}</pre>
<p><strong>Weak vs. Strong Listeners</strong></p>
<p>Let me take this opportunity to protest against using weak listeners.  They are for pussies.  Seriously, the only time they are valid is when you are creating code modules that other developers could use, and there is no conventional destruction point.  Since you have no control over when your code will have the opportunity to clean itself up, nor do you know if the developer using your code is smart enough to call your destroy method, you try to code as defensively as possible.  If you must snag a reference to a global object such as &#8220;stage&#8221; for example, which&#8217;ll surely lock your code into memory, you at least make it a weak listener AS WELL AS listening for Event.REMOVED_FROM_STAGE.</p>
<p>It&#8217;s been suggested to always use weak listeners when using Timers for example.  Since these are some the major culprits of memory leaks in applications, if you use a weak listener, you&#8217;re set right?  Same with Dictionaries with weak keys, right?  *face palm*  Sure man&#8230; with that attitude, I&#8217;m sure you&#8217;re code REALLY makes an effort to help clean itself up.  Besides, Flash Player 9 has some issues garbage collecting weak listeners, so you can&#8217;t even depend on it working as advertised.  They&#8217;ve fixed a lot of this in 10, but you need to make an effort to de-allocate as much memory as you can.  Just because a large object has no references to itself doesn&#8217;t mean the Garbage Collector will immediately free up everything.  While it is a black box, you do have ways of helping it out.  In my experience, it&#8217;s more likely to free up smaller objects more often than large objects since running Garbage Collection itself is a processor intensive operation.</p>
<p>If your code is explicit, it&#8217;s clear where you&#8217;re freeing memory.  If you&#8217;re not, it&#8217;s challenging to figure out where leaks occur, nor is it easy to write proactive code to free up memory.  Granted, deadlines may dictate otherwise, and I concede the point on those instances.  Regardless, a lot of people who use <a href="http://onflash.org/ted/2008/09/useweakreferencesboolean-false.php">weak references for listeners</a> forget that unless they keep a reference to the object itself, it&#8217;ll randomly get garbage collected, which leads to strange bugs for asynchronous classes that are hard to reproduce reliably.  If you don&#8217;t know what you&#8217;re doing or have doubt, just use a strong reference and provide a clear way of removing it later.</p>
<p><strong>Any help you can provide&#8230; would be&#8230; well&#8230; helpful!</strong></p>
<p>Make no mistake: Helping the Flash Player garbage collect your objects has major, positive impacts.  Even a half-assed approach is better than none.</p>
<p>Let&#8217;s take an Array or ArrayCollection full of Strings for example.  He&#8217;s within a View, and you removeChild the View, and null the reference in his parent.  The GC will eat it eventually right?  Wrong&#8230; you accidentally have a stage listener buried deep within the bowels of a base class of a Button you&#8217;ve written.  If that&#8217;s all you&#8217;ve done, simply removing the child from the DisplayList and nulling the reference, you&#8217;ve at least giving back memory the View was using to display itself to the screen.  Glass half full baby!</p>
<p>Taking it a step farther, what if you&#8217;re View implemented a destroy method, and cleaned up its internals to help the GC out, and free up some memory of things it&#8217;s no longer using?  Remember, the View itself is still locked in RAM because you don&#8217;t yet know about the rogue stage listener.  BUT, you at least remove all Strings in the ArrayCollection and null its reference in your destroy method.  Running the <a href="http://livedocs.adobe.com/flex/3/html/help.html?content=profiler_3.html">Flex profiler</a>, you&#8217;ll see some [reap] and [sweep] using more CPU time + memory go down slightly + less String instances.  Yum yum&#8230; while your View couldn&#8217;t get it&#8217;s fat arse outta RAM, you at least managed to free up all of those Strings it had a reference too.  They no longer have any references to them, and therefore they are cleaned up, and the memory THEY use is freed up.  Rad!  GLASS HALF FULL BABY!  Even with a memory leak, we&#8217;re lessening the damage by freeing as much memory as we can.</p>
<p>I know this doesn&#8217;t fix the problem, but if you&#8217;re under a deadline you gotta do what you can to survive.  The only reason I don&#8217;t think weak listeners are justified in the deadline scenario is because it&#8217;s like you&#8217;re not even trying to do the above: thinking about what View&#8217;s &amp; classes need to be removed, writing destructor methods, and validating they worked.  Sometimes you just don&#8217;t have time to do those things, though&#8230;</p>
<p><strong>What do you do in a Mediator::onRemove method?</strong></p>
<p>Assuming you&#8217;re PureMVC is setup correctly, then the onRemove function of your Mediator&#8217;s will fire when it&#8217;s removed from the PureMVC ApplicationFacade.  Here, you can remove strong event listeners you&#8217;ve made on the View, remove the Mediator&#8217;s view reference by setting it to null, and clearing any other data.  This is where things get hard.</p>
<p>Removing the View&#8217;s listeners and it&#8217;s reference is easy; there is a 1 to 1 relationship with with Mediator&#8217;s and a View.  But what about Commands and Proxies?  If the Mediator registered one or more Commands, it&#8217;s pretty clear he should unregister them.  Often I&#8217;ve seen Commands that are relevant to a particular View being registered in the ApplicationFacade by overriding the initializeController method.  For smaller applications this is ok.  For larger ones, it&#8217;s still ok in that they don&#8217;t necessarily take a lot of RAM.  The problem is this doesn&#8217;t scale.  Your Facade will get really really large.  Some people compensate for this by creating multiple Facades for the relevant Application Domain (called Contexts in early <a href="http://www.robotlegs.org/">RobotLegs</a> builds).  While this spreads the damage, it removes relevance from the code; it isn&#8217;t immediately obvious what problem domain these Commands are associated with.  When the Mediator registers them, it&#8217;s usually pretty obvious.  That, and it makes it easier to remove them with confidence without worrying about breaking things.</p>
<p>&#8230;Proxies, however, are another story.  Proxies are the #1 cause of race conditions in PureMVC.  Regardless of how they are written (holders of data as your Model or Services or both), they are often encapsulated enough that they could be relevant to many different Views, and thus many different Mediators.  This causes a problem in knowing when they should die&#8230; if ever.  The benefits of using a stateful client like Flash Player RIA&#8217;s, as opposed to a paged based, non-AJAX HTML application, is that you get the benefits of keeping data in RAM.  This in-RAM data allows the application to be quick and responsive.  As long as your data is ActionScript objects (excluding XML, Strings, Bitmaps, and large ByteArrays) your memory usage is often very low.</p>
<p>Therefore, there isn&#8217;t a lot of harm leaving Proxies around.  The one side effect is when your profiling your application via <a href="http://livedocs.adobe.com/flex/3/langref/flash/system/System.html#totalMemory">System.totalMemory</a>, you&#8217;ll notice it doesn&#8217;t go down as much when you&#8217;re View is destroyed.  Using the Flex profiler, when taking memory snapshots, you&#8217;ll notice you&#8217;ll have a lot of potential loitering objects (things that are still around in memory even after your View is destroyed and Garbage Collection has run).  If you&#8217;re trying to track down a leak, some of those loitering objects, your Proxy and his data, are valid&#8230; you want them to loiter in the first place so you can immediately access them again later.  Additionally, you&#8217;ll need to write more defensive &amp; proactive code in your PureMVC code that accesses the Proxy.  For example, instead of registering the Proxy every time, you need to ensure it&#8217;s not already registered.</p>
<pre><span class="keyword">private</span> <span class="keyword">function</span> getSearchProxy():SearchProxy
{
        <span class="keyword">var</span> searchProxy:SearchProxy;
        <span class="keyword">if</span>(facade.hasProxy(SearchProxy.NAME))
        {
                searchProxy = facade.retrieveProxy(SearchProxy.NAME) as SearchProxy;
        }
        <span class="keyword">else</span>
        {
                searchProxy = <span class="keyword">new</span> SearchProxy();
                facade.<span class="identifier2">registerProxy</span>(searchProxy);
        }
        <span class="keyword">return</span> searchProxy;
}</pre>
<p>Another tactic if the amount of data a Proxy has uses a lot of memory, or you just need every byte you can, is to cache on the local machine.  If you&#8217;re running in a web browser, you can use a local SharedObject and save your serialized data.  If you&#8217;re using AIR, you can read from the local disk via <a href="http://livedocs.adobe.com/flex/3/langref/flash/filesystem/File.html">File</a>, or use the <a href="http://livedocs.adobe.com/flex/3/langref/localDatabaseSQLSupport.html">local SQL database support</a>. When the Proxy is re-created, he can check the local cache first, validate the data is good, and use it instead of fetching it again from the back-end.</p>
<p>Bottom line, if you DO remove a Proxy, that&#8217;s your cue to go implement his onRemove method as well.  Here&#8217;s an example of a Mediator cleaning up its View reference &amp; listeners as well as proxies.</p>
<pre>protected override <span class="keyword">function</span> onRemove():<span class="keyword">void</span>
{
        <span class="keyword">if</span>(community)
        {
                community.<span class="identifier2">removeEventListener</span>(LoginEvent.LOGIN, onLogin);
                community.<span class="identifier2">removeEventListener</span>(LoginEvent.LOGOUT, onLogout);
                community.<span class="identifier2">removeEventListener</span>(LoginEvent.CHANGE_PASSWORD, onChangePassword);
                community.<span class="identifier2">removeEventListener</span>(SearchEvent.SEARCH, onSearch);
                community.<span class="identifier2">removeEventListener</span>(PowerEvent.OPEN_POWER, onOpenPower);
                community.<span class="identifier2">removeEventListener</span>(PowerEvent.DELETE_SEARCH_POWER, onDeletePower);
                community = <span class="identifier">null</span>;
        }

        facade.removeProxy(AuthenticationProxy.NAME);
        facade.removeProxy(SearchProxy.NAME);
        facade.removeProxy(GetPowerProxy.NAME);

        sendNotification(ApplicationFacade.COMMUNITY_SHUTDOWN);
}</pre>
<p>And here&#8217;s an example of a SearchProxy nulling out internal data, an ArrayCollection and a String, as well as cleaning up an internal web service.</p>
<pre>protected override <span class="keyword">function</span> onRemove():<span class="keyword">void</span>
{
        powers 		= <span class="identifier">null</span>;
        _searchText = <span class="identifier">null</span>;

        <span class="keyword">if</span>(searchPowersByNameService)
        {
                searchPowersByNameService.<span class="identifier2">removeEventListener</span>(CommunityServiceEvent.SEARCH_POWERS_BY_NAME_ERROR, onSearchPowersByNameError);
                searchPowersByNameService.<span class="identifier2">removeEventListener</span>(CommunityServiceEvent.SEARCH_POWERS_BY_NAME_SUCCESS, onSearchPowersByNameSuccess);
                searchPowersByNameService = <span class="identifier">null</span>;
        }
}</pre>
<p>Remember, once you start implementing clean up methods, you&#8217;ll need to keep them in sync with any changes in the class.  Tread with confidence.</p>
<p><strong>Conclusions</strong></p>
<p>Managing memory in Flash &amp; Flex applications is hard.  Validating your hard work actually is paying off is time consuming.  Most programmers who are used to managing memory keep it in the forefront of their minds while their coding, so they often don&#8217;t perceive it as an issue/challenge.  A lot of times the frameworks we use handle a lot of the mundane details of these operations for us (like Tweening engines).</p>
<p>If you&#8217;re application does need to run for any long length of time and you&#8217;re using PureMVC, having a good, up front understanding of what Views need to stick around and which ones don&#8217;t will help you better plan for which Views, Mediators, and Proxies you&#8217;ll need to write code for to free up memory.  If you do your best to make each View follow it&#8217;s own Application Domain problem it&#8217;s solving for, then it&#8217;s easier to have that entire silo follow the standard removal scenarios, and thus code to it.</p>
<p>For example, if you are creating a FAQ View, and it has a FAQ Mediator with a FAQ Proxy, then it&#8217;s pretty simple to clean up thing when you&#8217;re done: implement a destroy method in your View, then implement onRemove methods in your Mediator and Proxy.  When in doubt about the Proxies, just keep &#8216;em around since they usually aren&#8217;t the biggest memory offenders&#8230; but be sure to validate this using the Flex Profiler and/or System.totalMemory as even rogue XML can take 200 megs or more.  It&#8217;s easier to make View&#8217;s more efficient than it is to solve for race conditions in PureMVC.</p>
<p>A good tool to help visualize your memory usage in real-time is <a href="http://code.google.com/p/mrdoob/wiki/stats">Mr. Doob&#8217;s &#8220;Stats&#8221;</a>.  Just be sure your system is only running 1 SWF at a time as System.totalMemory, what Stats uses, applies to all SWFs running on your box.  I usually wrap him with a UIComponent, add a right click menu to my app to open him via <a href="http://livedocs.adobe.com/flex/3/langref/flash/ui/ContextMenu.html">ContextMenu</a>, and launch him via PopUpManager.  Another tool you can use is <a href="http://opensource.adobe.com/wiki/display/flexpmd/FlexPMD">Flex PMD</a>.  It&#8217;ll help identify which code isn&#8217;t used&#8230; and perhaps should, like destroy methods that aren&#8217;t ever called.  Finally, if you&#8217;re desperate on Flash Player 9, you can also force Garbage Collection via the <a href="http://www.gskinner.com/blog/archives/2006/08/as3_resource_ma_2.html">LocalConnection hack</a>.  This saved us on a project where we were loading SWF&#8217;s.</p>
<p>Remember, if you destroy &amp; recreate a View and his PureMVC equivalent classes a lot, you may fragment the memory over time, so don&#8217;t get overzealous.  Use your best judgement, and don&#8217;t be afraid to get the designers help on which sections of the app need to be the most responsive, and which ones it&#8217;s ok to lazy load.</p>
<img src="http://feeds.feedburner.com/~r/jessewarden/~4/3uTsw2-6W4g" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jessewarden.com/2009/11/good-memory-management-when-using-puremvc.html/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		<feedburner:origLink>http://jessewarden.com/2009/11/good-memory-management-when-using-puremvc.html</feedburner:origLink></item>
		<item>
		<title>How to Use RobotLegs On Top of Gaia: Part 1 of 3 – Quickstart</title>
		<link>http://feedproxy.google.com/~r/jessewarden/~3/CpxAClDc0ag/how-to-use-robotlegs-on-top-of-gaia-part-1-of-3-quickstart.html</link>
		<comments>http://jessewarden.com/2009/10/how-to-use-robotlegs-on-top-of-gaia-part-1-of-3-quickstart.html#comments</comments>
		<pubDate>Wed, 14 Oct 2009 19:47:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Gaia Flash Framework]]></category>

		<guid isPermaLink="false">http://jessewarden.com/?p=1825</guid>
		<description><![CDATA[The following is a quick start guide on how to get RobotLegs working on top of the Gaia Flash Framework written by Steven Sacks.  In later articles, I&#8217;ll show how to use per-Gaia-page Contexts, a visual example, as well as cover Enterprise scenarios.  For now this should get you up and running in 10 minutes.
What [...]]]></description>
			<content:encoded><![CDATA[<p>The following is a quick start guide on how to get <a href="http://shaun.boyblack.co.za/blog/2009/04/16/robotlegs-an-as3-mvcs-framework-for-flash-and-flex-applications-inspired-by-puremvc/">RobotLegs</a> working on top of the <a href="http://gaiaflashframework.com">Gaia Flash Framework</a> written by <a href="http://stevensacks.net">Steven Sacks</a>.  In later articles, I&#8217;ll show how to use per-Gaia-page Contexts, a visual example, as well as cover Enterprise scenarios.  For now this should get you up and running in 10 minutes.</p>
<p><span id="more-1825"></span><strong>What is RobotLegs?</strong></p>
<p>RobotLegs is a <a href="http://joeberkovitz.com/blog/reviewtube/">MVCS</a> framework for Flex &amp; pure AS3 applications.  You can use with Flash as well.  I call it <a href="http://puremvc.org">PureMVC</a> done right.  She&#8217;s still not at version 1, but is really close (<a href="http://wiki.github.com/robotlegs/robotlegs-framework/best-practices">docs</a> in progress).</p>
<p><strong>What is Gaia?</strong></p>
<p>The Gaia Flash Framework is the <a href="http://rubyonrails.org/">Ruby on Rails</a> for building Flash websites.  You can code generate your entire Flash website in seconds.  It has modules, SEO, page navigation, and deep-linking all built-in, amongst other things.</p>
<p><strong>Why?</strong></p>
<p>Gaia is great for building websites, but it&#8217;s just a platform for you to build on, a bunch of helpful scaffolding; it doesn&#8217;t prescribe a way to build your applications.  Specifically, you have to write your own code for <a href="http://stackoverflow.com/questions/360860/what-is-domain-logic/362746#362746">Business logic and Application/Domain logic</a>.  You still have to write code to hit back-end services, parse the returning XML/JSON/AMF, and act on that data.</p>
<p>This is where an application framework like RobotLegs comes in.  You&#8217;re domain model goes in the Model classes, your Business logic goes in the Service classes, and your Domain/Application logic goes in your Commands &amp; Mediators.  You setup your shiz in your Context class(es), like PureMVC&#8217;s ApplicationFacade</p>
<p>Gaia builds your site, and RobotLegs makes it work with dynamic data.</p>
<p><strong>Requirements</strong></p>
<p>Before we get to the &#8220;How&#8221;, you need to know 2 requirements first.  This may scare some people off.</p>
<ol>
<li>You need both <a href="http://livedocs.adobe.com/flex/3/html/help.html?content=compilers_13.html">mxmlc</a> &amp; <a href="http://adobe.com/products/flash/">Flash CS4 or CS3</a></li>
<li>Your application must be AS3</li>
</ol>
<p>RobotLegs requires compiling in mxmlc because of the <a href="http://cookbooks.adobe.com/index.cfm?event=showdetails&amp;postId=11907">custom metadata tags</a>.  Flash CS3 &amp; CS4 do not currently support the -keep-as3-metadata mxmlc compiler parameter, thus, you must compile your RobotLeg&#8217;s implementation code using mxmlc (via <a href="http://www.adobe.com/products/flex/">Flex Builder 2, 3, Flash Builder 4</a>, <a href="http://www.fdt.powerflasher.com/">FDT</a>, <a href="http://www.flashdevelop.org/wikidocs/index.php?title=Main_Page">FlashDevelop</a>, etc.).</p>
<p>While you can compile Gaia to an SWC in Flash CS4, and then re-compile via a Library linkage in mxmlc, this defeats the purpose of using the Gaia workflow in Flash.  I understand this is deal killer for many automated build/<a href="http://martinfowler.com/articles/continuousIntegration.html">continuous integrations</a> of Enterprise applications, so I&#8217;ll cover optional build scenarios in a future article.</p>
<p>Flash CS4 is required because it allows you to link to external libraries, in this case, Flex created SWC&#8217;s.  You could utilize Flash CS3, and just add a class path to the RobotLegs classes since you&#8217;ll typically only be using the interfaces in your Flash/Gaia specific code.  Both Flash CS3/CS4 will be exporting AS3 code since RobotLegs is for AS3, so you can&#8217;t use Flash 8 and export to AS2.</p>
<p>I currently do not have access to Flash CS5 alpha/beta to determine if it&#8217;s integration with Flash Builder 4 demoed at MAX 2009 would help in this instance, nor do I know if it can -keep-as3-metadata.</p>
<p><strong>Quickstart Preface</strong></p>
<p>The Quickstart may appear intimidating at 15 steps.  If you know Flex Builder/FlashDevelop, Flash, Gaia, and RobotLegs, you&#8217;ll do just fine, it&#8217;s not that bad.  Additionally, you only need to do this stuff once.</p>
<p>The rest of your project, you&#8217;ll spend in your code editor.  You can also link the Main file in Flex Builder to get code hinting on it.  The only time you go to Flash is to do Control + Enter.</p>
<p>GIT-R-DONE!!!11oneone</p>
<p><strong>Quickstart</strong></p>
<p><strong>1.</strong> <a href="http://www.gaiaflashframework.com/wiki/index.php?title=Getting_Started">Setup</a> your Gaia site.</p>
<p><strong>2</strong>. Open up your main.fla in Flash.</p>
<p><strong>3.</strong> In Flash CS4, go to File &gt; Publish Settings, click the Flash tab, click the Settings button next to AS version, click the Library Path tab, and link to the RobotLegs.swc.  In Flash CS3, just add a class path to the RobotLegs source code directory.</p>
<p><a href="http://jessewarden.com/wp-content/uploads/2009/10/flash-lib.jpg"><img class="alignnone size-medium wp-image-1829" title="flash-lib" src="http://jessewarden.com/wp-content/uploads/2009/10/flash-lib-245x300.jpg" alt="flash-lib" width="245" height="300" /></a></p>
<p><strong>4.</strong> Save your main.fla.</p>
<p><strong>5.</strong> Create an ActionScript 3 project in Flex/Flash Builder, FDT, or FlashDevelop.  Point it to the same directory your Gaia project lives.  I suggest changing bin-debug to bin since that&#8217;s what Gaia uses.  Although it&#8217;ll generate a SWF, it&#8217;s hereafter referred to as a &#8220;module&#8221; SWF since Gaia will load it in and use it&#8217;s pre-compiled classes.</p>
<p><strong>6.</strong> Create your own main class, differently named (ie not &#8220;Main.as&#8221;), and put next to Gaia&#8217;s Main.as.  This will be where your RobotLegs code lives.</p>
<p><a href="http://jessewarden.com/wp-content/uploads/2009/10/project-dir.jpg"><img class="alignnone size-full wp-image-1830" title="project-dir" src="http://jessewarden.com/wp-content/uploads/2009/10/project-dir.jpg" alt="project-dir" width="309" height="596" /></a></p>
<p><strong>7.</strong> Link to the RobotLegs.swc as a Library.  If you are in Flex/Flash Builder, you may wish to link to the RobotLegsLib Library project instead.  If so, I put this in Gaia&#8217;s lib folder next to the FLA&#8217;s that Gaia puts there.  The image below shows linking to the Library Project.</p>
<p><a href="http://jessewarden.com/wp-content/uploads/2009/10/lib-link.jpg"><img class="alignnone size-medium wp-image-1831" title="lib-link" src="http://jessewarden.com/wp-content/uploads/2009/10/lib-link-300x291.jpg" alt="lib-link" width="300" height="291" /></a></p>
<p><strong>8.</strong> Create a &#8220;MainContext&#8221; ActionScript class where ever you&#8217;d like in your package structure.  Might I recommend something other than Gaia&#8217;s pages directory, like &#8220;com.company.project.robotlegs.contexts&#8221;.  In this class, you register your modules, in this case, your Gaia pages that actually need Mediators.  Here&#8217;s mine:</p>
<pre>package com.jxl.gaiarobotlegs.robotlegs.contexts
{
        <span class="keyword">import</span> com.jxl.gaiarobotlegs.pages.IAboutPage;
        <span class="keyword">import</span> com.jxl.gaiarobotlegs.robotlegs.mediators.AboutMediator;

        <span class="keyword">import</span> flash.display.DisplayObjectContainer;

        <span class="keyword">import</span> org.robotlegs.mvcs.Context;

        <span class="keyword">public</span> <span class="keyword">class</span> MainContext <span class="keyword">extends</span> Context
        {
                <span class="keyword">public</span> <span class="keyword">function</span> MainContext(contextView:DisplayObjectContainer)
                {
                        <span class="identifier">super</span>(contextView);
                }

                <span class="keyword">public</span> override <span class="keyword">function</span> startup():<span class="keyword">void</span>
                {
                        mediatorMap.mapModule(<span class="string">'com.jxl.gaiarobotlegs.pages::AboutPage'</span>, IAboutPage, AboutMediator);
                        <span class="identifier">super</span>.startup();
                }
        }
}</pre>
<p>Notice the mapModule method goes &#8220;Your Gaia Page class as a String&#8221;, &#8220;The interface the Gaia Page class and the Mediator share&#8221;, and &#8220;The RobotLegs Mediator class&#8221;.  <strong>NOTE</strong>: In older builds of RobotLegs, they are using the fully qualified class name which is ::AboutPage, not .AboutPage (<a href="http://livedocs.adobe.com/flex/3/langref/flash/utils/package.html#getQualifiedClassName()">more info</a>).  I have a hacked version locally which accepts a normal package path of &#8220;pages.AboutPage&#8221; vs. &#8220;pages::AboutPage&#8221;.  Yes, I&#8217;ve asked the RobotLegs authors to fix this.</p>
<p><strong>9.</strong> Create 1 more class and 1 corresponding interface: a Mediator class for whatever Gaia page you&#8217;ll be mediating, and an interface of the same name with the I prefix.  Example: If you&#8217;re creating an &#8220;About Us&#8221; page for your site, you&#8217;ll probably have an about page node in your site.xml, and thus a corresponding FLA.  Create an &#8220;IAboutUs&#8221; interface, and an &#8220;AboutUsMediator&#8221; class that implements the interface.  Your Gaia &#8220;AboutUsPage&#8221; class will also implement the &#8220;IAboutUs&#8221; interface.  This is how RobotLegs will communicate to your Gaia code via the <a href="http://en.wikipedia.org/wiki/Bridge_pattern">Bridge Pattern</a> (<a href="http://jessewarden.com/2008/01/gaia-arguments-real-world-bridge-pattern-and-gaia_internal.html">more info on why</a>).</p>
<p>Here&#8217;s the interface:</p>
<pre>package com.jxl.gaiarobotlegs.pages
{
        <span class="keyword">public</span> <span class="keyword">interface</span> IAboutPage
        {
                <span class="keyword">function</span> setAboutText(<span class="identifier2">value</span>:<span class="identifier">String</span>):<span class="keyword">void</span>;
        }
}</pre>
<p>Here&#8217;s the Mediator:</p>
<pre>package com.jxl.gaiarobotlegs.robotlegs.mediators
{
        <span class="keyword">import</span> com.jxl.gaiarobotlegs.pages.IAboutPage;

        <span class="keyword">import</span> flash.events.TimerEvent;
        <span class="keyword">import</span> flash.utils.Timer;

        <span class="keyword">import</span> org.robotlegs.mvcs.Mediator;

        <span class="keyword">public</span> <span class="keyword">class</span> AboutMediator <span class="keyword">extends</span> Mediator
        {
                [Inject]
                <span class="keyword">public</span> <span class="keyword">var</span> aboutPage:IAboutPage;

                <span class="keyword">private</span> <span class="keyword">var</span> timer:Timer;

                <span class="keyword">public</span> <span class="keyword">function</span> AboutMediator()
                {
                        <span class="identifier">super</span>();
                }

                <span class="keyword">public</span> override <span class="keyword">function</span> onRegister():<span class="keyword">void</span>
                {
                        timer = <span class="keyword">new</span> Timer(3 * 1000);
                        timer.<span class="identifier2">addEventListener</span>(TimerEvent.TIMER, onTick, <span class="identifier">false</span>, 0, <span class="identifier">true</span>);
                        timer.<span class="identifier2">start</span>();
                }

                <span class="keyword">private</span> <span class="keyword">function</span> onTick(<span class="identifier2">event</span>:TimerEvent):<span class="keyword">void</span>
                {
                        timer.<span class="identifier2">stop</span>();
                        timer.<span class="identifier2">removeEventListener</span>(TimerEvent.TIMER, onTick);
                        timer = <span class="identifier">null</span>;

                        aboutPage.setAboutText(<span class="string">"Blah blah blah,nthis is from RobotLeg's 'AboutMediator'"</span>);
                }
        }
}</pre>
<p>Thing to note in the above is the Dependency Injection via the [Inject] tag does IAboutPage vs. AboutPage; this ensures mxmlc doesn&#8217;t attempt to compile Gaia code into your module SWF.</p>
<p><strong>10.</strong> Any events your Gaia About Us page will emit, put in the IAboutUs interface.  Any data your Gaia About Us page needs to have set on itself, implement a setter or a method in the IAboutUs interface.  This&#8217;ll ensure your About Us page class in Gaia and your AboutUsMediator won&#8217;t compile until you implement those methods, nor will your AboutUsMediator RobotLegs class.  Yes, I know events in interfaces aren&#8217;t enforced, but that doesn&#8217;t mean you shouldn&#8217;t do it.</p>
<p>Here&#8217;s the Gaia AboutPage class:</p>
<pre>package com.jxl.gaiarobotlegs.pages
{
        <span class="keyword">import</span> com.gaiaframework.api.*;
        <span class="keyword">import</span> com.gaiaframework.debug.*;
        <span class="keyword">import</span> com.gaiaframework.events.*;
        <span class="keyword">import</span> com.gaiaframework.templates.AbstractPage;

        <span class="keyword">import</span> flash.display.*;
        <span class="keyword">import</span> flash.events.*;
        <span class="keyword">import</span> flash.<span class="identifier2">text</span>.<span class="identifier">TextField</span>;

        <span class="keyword">import</span> gs.*;

        <span class="keyword">public</span> <span class="keyword">class</span> AboutPage <span class="keyword">extends</span> AbstractPage <span class="keyword">implements</span> IAboutPage
        {
                <span class="keyword">public</span> <span class="keyword">var</span> copyTextField:<span class="identifier">TextField</span>;

                <span class="keyword">public</span> <span class="keyword">function</span> AboutPage()
                {
                        <span class="identifier">super</span>();
                        alpha = 0;
                        <span class="linecomment">//new Scaffold(this);
</span>                }

                <span class="linecomment">// called by RobotLegs's AboutPageMediator
</span>                <span class="keyword">public</span> <span class="keyword">function</span> setAboutText(<span class="identifier2">value</span>:<span class="identifier">String</span>):<span class="keyword">void</span>
                {
                        copyTextField.<span class="identifier2">text</span> = <span class="identifier2">value</span>;
                }

                override <span class="keyword">public</span> <span class="keyword">function</span> transitionIn():<span class="keyword">void</span>
                {
                        <span class="identifier">super</span>.transitionIn();
                        TweenLite.to(<span class="identifier">this</span>, 0.3, {alpha:1, onComplete:transitionInComplete});
                }

                override <span class="keyword">public</span> <span class="keyword">function</span> transitionOut():<span class="keyword">void</span>
                {
                        <span class="identifier">super</span>.transitionOut();
                        TweenLite.to(<span class="identifier">this</span>, 0.3, {alpha:0, onComplete:transitionOutComplete});
                }
        }
}</pre>
<p>Notice the implementation of IAboutPage.  Since Gaia FLA&#8217;s by default have &#8220;../src&#8221; set in their class path, it&#8217;ll share the same class path with your ActionScript project.  The only class it&#8217;s importing form that code, however, is the interface, which is a few 300 bytes or so once compiled into the SWF.  If you&#8217;re clever, you could use External Libraries in CS4, but that&#8217;s out of scope for this article.</p>
<p><strong>11.</strong> Open up your main.as file in your editor of choice.  First, create a mainContext class reference, like:</p>
<p>private var mainContext:IContext;</p>
<p><strong>12.</strong> Override init and do no call super.init.  Instead, write code to load in your RobotLegs SWF that your ActionScript project will create in bin.  You can use a Loader, your own wrapper class, extend Main to abstract away these details in a base class&#8230; whatever you want.  I used a Loader for this example.  Ensure you load the classes into the same ApplicationDomain so Gaia can share and use these classes, as well as any loaded SWF&#8217;s that need them.</p>
<pre><span class="keyword">var</span> loaderContext:LoaderContext = <span class="keyword">new</span> LoaderContext(<span class="identifier">false</span>, ApplicationDomain.currentDomain);
moduleLoader.<span class="identifier2">load</span>(<span class="keyword">new</span> URLRequest(<span class="string">'GaiaRobotLegs.swf'</span>), loaderContext);</pre>
<p><strong>13.</strong> In your Event.COMPLETE function, snatch your MainContext class from the loaded SWF, instantiate it, and pass the stage in, and call super.init to let Gaia know you&#8217;re done, like so:</p>
<pre><span class="keyword">private</span> <span class="keyword">function</span> onComplete(<span class="identifier2">event</span>:Event):<span class="keyword">void</span>
{
        const mainContextClassName:<span class="identifier">String</span> = <span class="string">"com.jxl.gaiarobotlegs.robotlegs.contexts.MainContext"</span>;
        <span class="keyword">try</span>
        {
                <span class="keyword">var</span> mainContextClass:Class = moduleLoader.contentLoaderInfo.applicationDomain.getDefinition(mainContextClassName) as Class;
                mainContext = <span class="keyword">new</span> mainContextClass(stage) as IContext;
        }
        <span class="keyword">catch</span>(err:<span class="identifier">Error</span>)
        {
                <span class="identifier2">trace</span>(<span class="string">"Failed to find class: "</span> + err);
        }
        <span class="identifier">super</span>.init();
}</pre>
<p>You use the stage so any DisplayObject added to the DisplayList will be checked to see if it has an associated Mediator.  Yes, I know OOP Purists will groan at this; don&#8217;t worry, I&#8217;ll offer a more pure solution later.  Remember, Gaia is typically used in Agencies with 2 week deadlines vs. 4 months; this is more than good enough for that crowd.</p>
<p><strong>14.</strong> In your main ActionScript project class, define a dependency variable; this is strictly to ensure your RobotLegs code is compiled into the &#8220;module SWF&#8221;.  Assuming you have Build Automatically on in Flex Builder, it should make your SWF in the bin folder for you once you save.  Here&#8217;s mine:</p>
<pre>package
{

        <span class="keyword">import</span> com.jxl.gaiarobotlegs.robotlegs.contexts.MainContext;

        <span class="keyword">import</span> flash.display.Sprite;

        <span class="keyword">public</span> <span class="keyword">class</span> GaiaRobotLegs <span class="keyword">extends</span> Sprite
        {
                <span class="keyword">private</span> <span class="keyword">var</span> mainContext:MainContext;

                <span class="keyword">public</span> <span class="keyword">function</span> GaiaRobotLegs()
                {
                        <span class="identifier">super</span>();
                }
        }
}</pre>
<p><strong>15.</strong> Test your Gaia project in Flash.</p>
<p><strong>Conclusions</strong></p>
<p>As you can see, all you need to do now is code all your code in Flex Builder (or editor of choice), and anytime you need to compile your site, you just go back to main.fla in Flash and hit Control + Enter.</p>
<p>You&#8217;ll also notice I create one &#8220;global&#8221; context here.  Reiterating, this is good enough for most design agencies as not every Gaia page will need a Mediator, and most Gaia pages aren&#8217;t that complex View&#8217;s anyway.</p>
<p>For the purists, in a future article I&#8217;ll explain how you can modify the Gaia template files, and configure your Context classes via the Gaia site.xml externally.  This ensures that the details of a Gaia page registering it&#8217;s own Context, or simply just creating a single Context + Mediator for itself, are self-contained and as strongly-typed as possible.</p>
<p>For those building Enterprise sized sites with automated build processes, I&#8217;ll later go into how you can integrate a Gaia site into your build process.</p>
<p><strong>Thanks</strong></p>
<p>Just a quick thanks to Steven for helping answer my Gaia architecture questions, and to the RobotLegs crew for helping me work out the details of how it could be done.</p>
<img src="http://feeds.feedburner.com/~r/jessewarden/~4/CpxAClDc0ag" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jessewarden.com/2009/10/how-to-use-robotlegs-on-top-of-gaia-part-1-of-3-quickstart.html/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		<feedburner:origLink>http://jessewarden.com/2009/10/how-to-use-robotlegs-on-top-of-gaia-part-1-of-3-quickstart.html</feedburner:origLink></item>
		<item>
		<title>Flex Consulting Chronicles #1: You are NOT a Contractor</title>
		<link>http://feedproxy.google.com/~r/jessewarden/~3/C1j-DNzA7Ts/flex-consulting-chronicles-1-you-are-not-a-contractor.html</link>
		<comments>http://jessewarden.com/2009/10/flex-consulting-chronicles-1-you-are-not-a-contractor.html#comments</comments>
		<pubDate>Sun, 04 Oct 2009 15:13:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Consulting Chronicles]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://jessewarden.com/?p=1807</guid>
		<description><![CDATA[Preface
The following is a set of articles relaying my experiences in Flex consulting with the hope they will benefit others.  While they include general consulting advice, they are specifically geared towards Enterprise Flex software development consulting.  I try to compare and contrast with contracting to give context.  While it&#8217;s mainly focused on Flex, there are [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Preface</strong></p>
<p>The following is a set of articles relaying my experiences in Flex consulting with the hope they will benefit others.  While they include general consulting advice, they are specifically geared towards Enterprise Flex software development consulting.  I try to compare and contrast with contracting to give context.  While it&#8217;s mainly focused on Flex, there are the occasional Flash references as well.</p>
<p><span id="more-1807"></span><strong>Consultant vs. Contractor</strong></p>
<p>There are 2 camps: those who believe contracting and consulting are the same thing, and those who do not.  I believe they are <strong>two</strong> different disciplines.</p>
<p>A contractor writes code for another company.  A consultant does more than just write code; she does the typical consulting process:</p>
<ol>
<li>Listen to the client&#8217;s problems</li>
<li>interview project members by asking questions</li>
<li>investigating project requirements, design documents, code base, and project tracking records</li>
<li>write up a plan that contains a set of solutions to the client&#8217;s problems, and present it</li>
<li>implement the plan</li>
</ol>
<p>Consultants can be contractors; they can be called upon to be team augmentation, or the team itself to build the software, hired specifically for their software development &amp; leadership skills.  While contractors can work for both big and small companies, consultants typically work for only large/Enterprise companies.  This is because the large problems that require a consultant&#8217;s skills are found in larger companies, and in turn they are capable of affording the consultant&#8217;s rate.</p>
<p><strong>Types of Consulting Gigs</strong></p>
<p>You&#8217;ll notice from step #3 in the above mentioned consulting process that consultants are typically brought into an &#8220;existing&#8221; project.  This can be one that is just starting, underway, or is just completed.  The following 5 are the most common type I&#8217;ve encountered.</p>
<p><strong>1. Confirm Our Confidence/Trepidation&#8217;s</strong></p>
<p>The client wants to ensure the existing team is &#8220;on the right track&#8221;.  As a 3rd party, the client is either looking for your vast expertise to confirm the current plan of attack &amp; team skill set is enough for success&#8230; or they just want your opinion.  A lot of times this is to confirm what they already know, but don&#8217;t necessarily let you know they know.  This is called the &#8220;Confirm Our Confidence&#8221; or &#8220;Confirm Our Trepidation&#8217;s&#8221;.</p>
<p><strong>2. Why are we sinking?</strong></p>
<p>The project is clearly off track, but no one knows the root cause(s).  The client is looking for you to tell them why.  This is called &#8220;Why are we sinking?&#8221; or &#8220;<a href="http://flexblog.faratasystems.com/?p=150">Save our Flex Project!</a>&#8220;.</p>
<p><strong>3. Ensuring It All Goes Smoothly</strong></p>
<p>The client isn&#8217;t getting enough traction on the project, and want a heavy hitter.  Since a lot of top talent typically doesn&#8217;t do contracting, you often can only find the heavy hitters as consultants.  Other times, the client merely has budget, and decides to reduce their risk by bringing on a senior architect/developer from an existing firm that is known for producing quality work.  Assuming the project requirements are far below the challenge the consultants typically face, there should be no problems completing it, right?  This is called &#8220;Ensuring It All Goes Smoothly&#8221;.</p>
<p><strong>4. The Last Mile</strong></p>
<p>The client has just completed a project, and it doesn&#8217;t work.  They&#8217;ve invested a lot of time and money, and are angry/frustrated/confused why there are so many problems.  Sometimes they even try to convince you that it &#8220;just needs some minor bug fixes&#8221; and it&#8217;ll be fine/good enough for their needs.  They call upon you, since apparently you&#8217;ve successfully completed many projects, to figure out how to get them to, and past, the finish line.  This is called &#8220;The Last Mile&#8221; project.</p>
<p><strong>5. Last Minute Replacement</strong></p>
<p>Making software takes a team.  On every team you have one or more senior developers; the developers who &#8220;have done this before&#8221;.  Without their leadership, projects can get really bogged down, and often fail to launch on time, or at all.  Some clients for one reason or another, often under not-so-good-circumstances, will have lost their main architect or senior developer.  With no one else on the team who is capable of taking an architecture/leadership role, companies will look for a replacement to ensure the project stays on track.  You are then put in the position to learn a code base you didn&#8217;t architect, don&#8217;t know, and may not agree with.  You must do this in a short time frame, integrate with the existing teams, and learn their processes.  It&#8217;s often done for entire teams, not just 1 individual.  This happens when another firm has a fallout with the 3rd party company/firm for whatever reason.  This is called the &#8220;Last Minute Replacement&#8221;.</p>
<p><strong>The Consulting Process</strong></p>
<p>As you can see from the above process, and the types of gigs, they aren&#8217;t your typical &#8220;software development&#8221;, even though you do &#8220;software development&#8221; during those gigs.  These are not mutually exclusive.  Some clients use <a href="http://en.wikipedia.org/wiki/Agile_software_development">Agile</a>, some <a href="http://en.wikipedia.org/wiki/Waterfall_model">Waterfall</a>, some mish-mashes, and some no process at all (Process.<a href="http://en.wikipedia.org/wiki/Cowboy_coding">COWBOY_CODING</a>).  Let&#8217;s go through the consulting process first, since that part is ALWAYS the same regardless of client.</p>
<p><strong>Step 0: Who&#8217;s my boss and define success?</strong></p>
<p>This one I learned from Tom Link over at <a href="http://universalmind.com/">Universal Mind</a>.  There are 2 questions you should always ask the client, AND get answered, before you start any consulting project.</p>
<p>First, who&#8217;s my boss?  Second, what would make you happy once I leave?</p>
<p>For contracting gigs, it&#8217;s pretty clear who your boss is; whoever contacted you.  Often project managers are the ones responsible for both the hiring, and managing the remote contractor, in this case you.  Therefore, if a designer emails you comps, and you don&#8217;t agree, you usually take it up with the manager via email/phone.</p>
<p>In consulting, it&#8217;s usually not the simple.  Often times you&#8217;re dealing with large/Enterprise companies.  You may have some random Director of blah blah East Coast operations come in and start making demands.  Seeing others jump, you may get the impression you should jump too.  You shouldn&#8217;t.  If she isn&#8217;t your boss, you shouldn&#8217;t do what they say.  As a consultant, every minute of your day is costing the company who is hiring you a lot.  Anything you do that deviates from your original assigned goal is not only unethical towards the company you are working for, but could potentially cause you not to get paid.</p>
<p>The great thing about being a consultant is you can say and do things an employee of the same company you are working for could never get away with.  Feel free to ignore someone telling you what to do if they aren&#8217;t your boss.  Obviously you need to treat these situations with tact, but if you just remember you may piss your real boss off and not get paid, it&#8217;s easy to stand firm.</p>
<p>Regarding defining success, it helps keep in mind what you were originally hired for.  If you were originally hired to help enable the team to succeed, and you hand-hold them to victory, technically you failed at your job.  You can potentially breed resentment by those you were supposed to empower to succeed.  Remember, you&#8217;re not a contractor, but a consultant, a professional specialist hired for a specific purpose: to offer a plan of attack, not actually implementing that plan.  While you may feel good creating a brand new video player for the client, they might not like the bill when all they asked for was you improve their existing one.</p>
<p>Knowing who your REAL boss is keeps you out of trouble.  Knowing your true objective keeps you focused amongst the chaos that WILL ensue around you.</p>
<p><strong>Step 1: Listen to the client&#8217;s problems</strong></p>
<p>When you are looking for a new contracting gig, you are looking for a client who wants you to build something for them.  &#8221;I need a Flash widget&#8221;, &#8220;I think I need a website that does X&#8221;, or &#8220;This video player needs to have these custom features&#8221;.  Inheriting other people&#8217;s code to fix isn&#8217;t very profitable, and is often a miserable experience.  Therefore, a lot of contracting where you&#8217;re &#8220;building things&#8221; for clients is a lot of fun, and often a positive experience.</p>
<p>Consulting often times is done under negative circumstances.  &#8221;We were building a Flash widget, but ran into trouble&#8221;, &#8220;We don&#8217;t understand how a website could be so challenging to build with $80k worth of development over 4 months with so little to show for the time and money&#8221;, or &#8220;our video playback performance is very poor&#8221;.</p>
<p>You first, and foremost job as a consultant is to listen.  You need to get the whole story, and you NEVER get it during the hiring process.  A lot of the times the story you get is only the tip of the iceberg, misleading, or just wrong.  This isn&#8217;t to say it&#8217;s always wrong; a lot of times you do get an accurate assessment from management.  The key here is you need to get the details so you can ensure whatever plan you create to fix it is the RIGHT plan.  Creating a plan to optimize the client side code to improve performance when in reality the back-end servers just never work consistently, nor was any thought put into optimizing the messaging format makes you look incompetent, or trying to take advantage of the situation.  Part of your plan could include allotting additional time to investigate the service layer&#8217;s issues, and come up with a plan to fix them should they have issues.  [Did you catch that?  I just said "plan to plan" in so many words.  Just seeing if you're awake!  --JXL]</p>
<p>There is also the potential for negative pretense about your arrival that can affect the story you get.  While you may perceive the management as good for caring enough about a troubled project to bring an expert in, those on the project may hold resentment towards them, and displaced aggression towards you.  Therefore, you may get answers to your questions colored with emotion, or nothing useful because emotions are so raw.</p>
<p>The point here is to ask questions, investigate, find out what&#8217;s really going on.  The information you garner will enable you to formulate an effective plan to fix/solve the client&#8217;s problems.  This process doesn&#8217;t necessarily stop, but by the time you are presenting your plan, you know what the problems really are, and how to fix them.</p>
<p><strong>Step 2: Interview project members by asking questions</strong></p>
<p>Asking questions.  It&#8217;s the same thing you&#8217;d do if you were a contractor trying to build software for the client, or a consultant trying to save a project from doom.  What back-end am I hitting and what is the data format we&#8217;re exchanging for both the request and the response?  Where are the design comps?  Why were they created like this?  Who is the designer and is there a nearby open window to throw them out of?</p>
<p>You need to learn who is on the project, who those people are, and what makes them tick.  You need to learn how they act, and how they acted under the circumstances of the past to better predict how they&#8217;ll act in the future.  You need to learn why those decisions were made, and truly understand what the the ramifications of those decisions were.</p>
<p>The point of this step is to figure out what the true problems are by talking to the project members.  Your goal is to glean as much information about the project as possible.  From that information, you can formulate a relevant plan of attack to help solve them, one tailored so that it will work in the particular organization you are working with.  Notice the keyword &#8220;help&#8221; in the previous sentence; often times in Flex/Flash consulting, you are the one who will help implement the plan.</p>
<p><strong>Step 3: Investigate the designs/code/requirements</strong></p>
<p>While this is often done in tandem with step 2, a lot of step 3 can be done alone with questions posed in emails and phone calls.  Getting a team member to walk you through the code is something you&#8217;d do in step 2, while walking through yourself and getting familiar with it is step 3.</p>
<p>Here you start digging in and ask questions like &#8220;Why did you all choose this framework?  Why not this other framework instead?  Did you know about X, Y, and Z when you started down this development path?&#8221;  Your goal here is to get history on an existing code base or project plan.  ALL code bases have a story.  Code is born from the 4th dimension.  Software developers will often debate about best practices as if code existed in the 3rd dimension, but it does not.  All code has a reason the way it is.  It came from a certain set of decisions that shaped what it is today.  These decisions where made under certain circumstances.  Those decisions were made by certain individuals and teams who were in those circumstances.  Context is key here, and once you can tell the story of the code, you&#8217;ll have a good understanding of why it is the way it is.</p>
<p>An example is, &#8220;The code base is a large Flash website created by a 3rd party agency.  Some if it is a professional, simple, and easy to understand custom MVC portion.  The code in the associated FLA&#8217;s, however are not.  The reason for this is that a senior developer was brought on initially to setup the website.  Apparently, this senior developer moved onto other projects, and junior Flash Developers were brought on to finish the more GUI related tasks.  This worked out well for the agency since the junior developers didn&#8217;t have to know anything about the framework; they just wrote 1 line of code on the root timeline.  The downside is that while the framework was flexible, portable, and provided a good foundation for the code, the FLA&#8217;s themselves, all 32 of them, were basically useless to re-use.  The amount of time spent figuring out, and attempting to finagle already badly written code to work would not be worth our time.  Since the current redesign plan is currently in flux, and the client now owns the code, we can work with the in-house team to start building a firmer foundation on the View portion, and create easier to work with FLA&#8217;s while still re-using the older FLA&#8217;s assets.  The Model and Controller portions that run the website can remain the same.&#8221;</p>
<p>You&#8217;ll notice I&#8217;ve already started to form opinions about a possible plan of attack whilst writing the story.  That&#8217;s the point; you&#8217;ll recognize possible scenarios on what your team can do to make the most in the current situation given your current resources.  From there, you just need to document it.</p>
<p>Another example, when you look at a <a href="http://opensource.adobe.com/wiki/display/cairngorm/Cairngorm">Cairngorm</a> code base and go, &#8220;Why the F$*^ didn&#8217;t these guys build this using <a href="http://gaiaflashframework.com">Gaia</a>!?&#8221;, you know&#8217;ll how to answer your own question: the team was an existing team of server-side Java developers doing Flex for the first time, and the small size of this project seemed like a good test case for seeing how Flex performed in their department.  Flex was specifically created for developers because Flash never took off in the software development world, and Gaia currently doesn&#8217;t work with Flex.  That, and they perceive this &#8220;website&#8221; as an &#8220;application&#8221;.</p>
<p>This becomes more important when you start to recognize problems not just in the code, but in the development processes in the team, and perhaps the client&#8217;s organization.  A lot of times the code&#8217;s poor state is a direct result of those managing the developers; ie they are setup to fail.  Other times, 1 developer is preventing the others from succeeding.  We as coders sometimes get too focused on the code, when the code is the last thing that can positively affect itself.  Unfortunately, it&#8217;s often easier as a good coder to merely fix the code because you don&#8217;t think you can fix management or their processes.  Often times, this is what you must do.</p>
<p>Now, a lot of times you may think, &#8220;Oh man, I hate this framework, I&#8217;m going to re-write this whole thing in my other favorite X-framework, and then we&#8217;ll be able to make progress&#8221;.  If you ask around, though, you may find that the team had specific reasons for doing so.  Hiring Cairngorm developers is a lot easier than hiring <a href="http://puremvc.org">PureMVC</a> developers, for example.  Maybe the team didn&#8217;t know the other frameworks and decided on the one they chose because they all participated in company-paid training for it.  Or, maybe the team claims they know other frameworks, but they really don&#8217;t.  Training is often an option and sometimes a crucial part of consulting, but again, you need to remember what you were hired for.  Sometimes, the code base is just too big, and you might not have the resources to port it in a reasonable time frame without sabotaging productivity of the rest of the team.  Worse, you port it, the app has &#8220;more&#8221; bugs because it&#8217;s fresh out of a major re-factoring effort, and the client is wondering why they hired you.  For the big code bases, you often need to figure out how you can make the most with what you got.  That phrase, for me anyway, often never happened in the Flash world, but happens ALL THE TIME in the Flex consulting one, merely because the projects are so large.</p>
<p><strong>Step 4: Write up an Implementation Plan, and Present It</strong></p>
<p>Based on your talking with team members, and doing your own investigation into the code and design comps, it&#8217;s time to create a formal plan.  There are 3 goals for this.  First, to formally show the client what your professional recommendations are.  Second, while writing, you help solidify what those recommendations are now that they are written down formally.  Third, if you get caught up working on other things during the implementation phase, you can remember what your true goals were, and re-align since you can refer to the document.  To get to this point in the process usually takes me 2 to 3 weeks on-site with the client.  I&#8217;ve done it in 2 to 3 days before, though.</p>
<p>The plan can follow the typical &#8220;tell what you&#8217;re going to tell them, tell them, tell them what you told them&#8221; format.  The plan is often a document that has 3 sections.  An executive summary, problems &amp; solutions, and conclusions.  Your executive summary is a 4 sentence paragraph summarizing as high level as possible what you were hired for, what you found, and how you plan on fixing it.  This is both for management to get a quick of assessment, and it&#8217;s also great when they forward to true &#8220;executives&#8221; who don&#8217;t have a lot of time, and will not read things.  Having a succinct paragraph that makes it &#8220;appear&#8221; like you did your research and know what your doing makes it easy for managers to copy and paste that into emails or other reports for example&#8230; hence the name, &#8220;executive summary&#8221;.</p>
<p>The problems and solution section states what problem(s) you found, and each possible solution(s) to each problem.  A problem cold potentially have multiple solutions.  Often solutions to a problem aren&#8217;t very straightforward, and you want to give management options.  Like <a href="http://twitter.com/darrellross">Darrell Ross</a> once told me, your goal isn&#8217;t to spend your client&#8217;s money, but rather provide transparency to the problems at hand, with well thought out solutions, and allow them to make the decisions that directly affect their project.</p>
<p>Finally, the plan document needs a conclusion.  Here you summarize your succinct, professional assessment of the situation, any other high level risks that need to be made known, and your desire to move forward highlighting the positive results of doing so.</p>
<p>Once completed and proof read, you present this to your boss.  Often times it&#8217;ll just be your boss, and no one else on the team.  If you&#8217;re a good consultant, you&#8217;ll provide the raw truth of the situation, and your honest assessment may offend others.  The client hired you to get the real truth, and you are obligated to provide this; this isn&#8217;t personal, it&#8217;s business.  This can be done over email, phone, a more formal presentation with slides if others are present who either don&#8217;t have time to read the document, or need some high level context on what you are consulting about, and what you plan to do to help fix things.</p>
<p>Finally, the document, as well as communicating it&#8217;s contents effectively, legally shows you attempted to provide value to the client vs. stealing their money by slacking off.  Remember, consulting is often done in really negative situations; having a paper trail is good CYA (cover yer arse).</p>
<p><strong>Step 5: Implement the plan.</strong></p>
<p>Also known as, git-r-done.</p>
<p><strong>Contracting?</strong></p>
<p>If you&#8217;re a contractor, you may have read a lot of the above and said to yourself, &#8220;I already do a lot of that.&#8221;  Perhaps you do.  Contractors are often pulled into consulting situations because they are a LOT cheaper than consulting firms, and the contractors don&#8217;t realize their monetary worth.  Sometimes only 1 individual is needed vs. multiple consultants.  That, or a firm isn&#8217;t found/known to the client.</p>
<p>Mostly, though, contractors are hired to build things, fix things, or help on things.  Consultants are hired to give their professional opinions on existing projects, fix really large, screwed up projects, or help on larger endeavors with multiple consultants helping.  The 2 main differentiators are scope of the project, and amount of emails &amp; documents you write.  If you have the capability to re-write the software from the ground up in 2 weeks, don&#8217;t write documents multiple times justifying your efforts, nor participate in meetings with various stakeholders who are all mad&#8230; you&#8217;re a contractor, not a consultant.  That, and if you don&#8217;t charge consulting rates.</p>
<p><strong>Conclusions</strong></p>
<p>Consulting is the disaster recovery of the software development world.  It sometimes has a negative connotation in larger enterprises because by prolonging the problem a firm can make a lot of money.  Others view the client&#8217;s resistance to positive change as a no go, and instead choose to let the client fail, THEN come in to help them up.  To me, consulting is a natural progression from being a contract software developer.  You&#8217;ve been in enough negative situations, you recognize how to get out of them.  Convincing the client of this, as well as getting them to actually do it, is where it&#8217;s challenging.</p>
<p>Software development is hard.  That said, there are a lot of development shops out there that can work with larger companies to create wonderful solutions.  What&#8217;s more valuable, and challenging, is working with larger companies to escape horrible situations.  You get into this line of work because either you love the challenge, like the appreciation of clients who are saved from certain doom, or you just fell into it as an &#8220;unnatural&#8221; career progression like I did.</p>
<p>A lot of times, you and you&#8217;re fellow consultants may be very skilled compared to others in your industry, yet you&#8217;re given way less time than needed, with an already existing problem code base&#8230; and you&#8217;re expected to work miracles because &#8220;you&#8217;re so good&#8221;.  &#8230;and then God invented alcohol.</p>
<p>If you are an independent software developer interested in getting into consulting, the easiest way to to start is to join an existing firm.  I won&#8217;t name names, but there are a few firms in the Flex industry that do this kind of work all the time.  <strong>Beware</strong> of evangelists/owners from said firms that claim you&#8217;ll &#8220;work with clients to create engaging solutions, building awesome Flex applications from scratch&#8221;.  They are all full of shit.  If you&#8217;re any good, you&#8217;ll be put in the worse situations imaginable.  Clients like you when you build something awesome for them.  They like you more when you prevent their project from going up in flames&#8230; and are often more willing to part with bling.  Consulting firms know this.</p>
<p>To be a consultant, you typically are brought into troubled projects, and use the consulting process to help those projects succeed.  This includes listening to the clients problems, investigating the code, writing up &amp; presenting a formalized implementation plan, and executing the plan.  Everything else is based on your experience, intuition, and luck.</p>
<img src="http://feeds.feedburner.com/~r/jessewarden/~4/C1j-DNzA7Ts" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jessewarden.com/2009/10/flex-consulting-chronicles-1-you-are-not-a-contractor.html/feed</wfw:commentRss>
		<slash:comments>16</slash:comments>
		<feedburner:origLink>http://jessewarden.com/2009/10/flex-consulting-chronicles-1-you-are-not-a-contractor.html</feedburner:origLink></item>
		<item>
		<title>Viaas: Live &amp; Archived Video</title>
		<link>http://feedproxy.google.com/~r/jessewarden/~3/65cgBXTvd3w/viaas-live-archived-video.html</link>
		<comments>http://jessewarden.com/2009/09/viaas-live-archived-video.html#comments</comments>
		<pubDate>Fri, 25 Sep 2009 14:07:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Appz]]></category>
		<category><![CDATA[Awesome]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://jessewarden.com/?p=1802</guid>
		<description><![CDATA[Viaas: The best project I ever worked on, with the best client I&#8217;ve ever had.  This is where my Agile Chronicles came from. The front-end portion I worked on was built using Flex.  Congrats to the Third Iris team for launching!
Here&#8217;s a video from Tuesday of Steve &#38; Paul showing off the application in 5 [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://viaas.com/">Viaas</a>: The best project I ever worked on, with the best client I&#8217;ve ever had.  This is where my <a href="http://jessewarden.com/2008/11/agile-chronicles-1-stressful.html">Agile Chronicles</a> came from. The front-end portion I worked on was built using Flex.  Congrats to the Third Iris team for launching!</p>
<p><span id="more-1802"></span>Here&#8217;s a <a href="http://link.brightcove.com/services/player/bcpid41695772001?bclid=41486138001&amp;bctid=41338518001">video</a> from Tuesday of Steve &amp; Paul showing off the application in 5 minutes.  There are a lot of cool things they don&#8217;t show, but this should give you the gist in a short time frame.  Notice the camera is powered via the ethernet cable.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="486" height="412" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="name" value="flashObj" /><param name="bgcolor" value="#FFFFFF" /><param name="flashvars" value="videoId=41338518001&amp;playerId=980795693&amp;viewerSecureGatewayURL=https://console.brightcove.com/services/amfgateway&amp;servicesURL=http://services.brightcove.com/services&amp;cdnURL=http://admin.brightcove.com&amp;domain=embed&amp;autoStart=false&amp;" /><param name="src" value="http://c.brightcove.com/services/viewer/federated_f8/980795693" /><embed type="application/x-shockwave-flash" width="486" height="412" src="http://c.brightcove.com/services/viewer/federated_f8/980795693" flashvars="videoId=41338518001&amp;playerId=980795693&amp;viewerSecureGatewayURL=https://console.brightcove.com/services/amfgateway&amp;servicesURL=http://services.brightcove.com/services&amp;cdnURL=http://admin.brightcove.com&amp;domain=embed&amp;autoStart=false&amp;" bgcolor="#FFFFFF" name="flashObj"></embed></object></p>
<p>Paul is the only developer I&#8217;ve met in my entire career who does accurate time estimations. Also, props to <a href="http://www.linkedin.com/pub/jonathan-miranda/11/b33/557">Jonathan Miranda</a> who took over for me and brought her to launch.</p>
<img src="http://feeds.feedburner.com/~r/jessewarden/~4/65cgBXTvd3w" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jessewarden.com/2009/09/viaas-live-archived-video.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://jessewarden.com/2009/09/viaas-live-archived-video.html</feedburner:origLink></item>
		<item>
		<title>AIR App: Powerz – Play Dungeons &amp; Dragons 4th Edition Faster</title>
		<link>http://feedproxy.google.com/~r/jessewarden/~3/4J0skwIE4hU/air-app-powerz-play-dnd-faster.html</link>
		<comments>http://jessewarden.com/2009/09/air-app-powerz-play-dnd-faster.html#comments</comments>
		<pubDate>Tue, 08 Sep 2009 19:19:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Appz]]></category>
		<category><![CDATA[Awesome]]></category>
		<category><![CDATA[Branding]]></category>
		<category><![CDATA[Business Process]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Marketing]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://jessewarden.com/?p=1758</guid>
		<description><![CDATA[This is a long post, so I&#8217;ve provided a short version, and content links to relevant sections if you want to skip around.
Short Version

I&#8217;ve built an AIR application in my spare time using Flex that helps you play Dungeons &#38; Dragons 4th edition faster.  It took 6 months in my spare time and cost [...]]]></description>
			<content:encoded><![CDATA[<p>This is a long post, so I&#8217;ve provided a short version, and content links to relevant sections if you want to skip around.</p>
<p><strong>Short Version<br />
</strong></p>
<p><a href="http://jessewarden.com/archives/powerz/start-page-preview.jpg"><img style="width: 160px; padding-right: 4px;" title="Powerz Start Page" src="http://jessewarden.com/archives/powerz/start-page-preview.jpg" alt="Powerz Start Page" align="left" /></a>I&#8217;ve built an <a href="http://adobe.com/products/air/">AIR</a> application in my spare time using <a href="http://adobe.com/products/flex/">Flex</a> that helps you play <a href="http://www.wizards.com/default.asp?x=dnd/4dnd/dndtestdrive">Dungeons &amp; Dragons 4th edition</a> faster.  It took 6 months in my spare time and cost around $50k to build, and $40 a month to maintain.</p>
<p><a href="http://powerzapp.com/screenshots.html">See</a> and <a href="http://powerzapp.com/download.html">download it here</a>.</p>
<p>It was created in response to my new players, who are tech saavy, having a slow time getting a game going.  I copied the design metaphor used in MMORPG games, as well as creating an online database via <a href="http://www.djangoproject.com/">Django</a> of user submitted content to help the process go faster, as well as supporting house rules.  In doing market research, I found my product is for a younger generation, and this makes it challenging to market.  I used an Iterative/Agile development process to ensure it got completed.</p>
<p>The app had 3 goals: make money, make our games quicker &amp; easier, and prove to myself I could execute.  I succeeded in the latter 2, and failed in the making money&#8230; so far.</p>
<p><span id="more-1758"></span></p>
<hr /><strong>Contents</strong></p>
<ul>
<li><a href="#preface">Preface</a></li>
<li><a href="#introduction">Introduction: Why the need for Powerz?</a></li>
<li><a href="#thepowerofpowerbars">The Power of Power Bars</a></li>
<li><a href="#whyair">Why AIR?</a></li>
<li><a href="#whydjango">Why Django?</a></li>
<li><a href="#selfinflictediterations">Self-Inflicted Iterations</a></li>
<li><a href="#quicknoteonscrum">Quick Note on Scrum</a></li>
<li><a href="#schedule">Schedule</a></li>
<li><a href="#technicaldetails">Technical Details</a></li>
<li><a href="#flex3vs4">Flex 3 vs 4</a></li>
<li><a href="#libraries">Libraries</a></li>
<li><a href="#monkeypatches">Monkey Patches</a></li>
<li><a href="#developmentchallenges">Development Challenges</a></li>
<li><a href="#featurecasulaties">Feature Casualties</a></li>
<li><a href="#marketingandresearch">Marketing &amp; Research</a></li>
<li><a href="#targetaudience">Target Audience</a></li>
<li><a href="#triptodragoncon">Trip to Dragon*Con</a></li>
<li><a href="#failures">Failures</a></li>
<li><a href="#successes">Successes</a></li>
<li><a href="#conclusions">Conclusions</a></li>
</ul>
<p><a name="preface"></a><strong>Preface</strong></p>
<p><a href="http://powerzapp.com/screenshots/Power-Melee_Basic_Attack.jpg"><img style="width: 160px; padding-right: 4px;" title="Melee Attack Power" src="http://powerzapp.com/screenshots/Power-Melee_Basic_Attack.jpg" alt="Melee Attack Power" align="left" /></a>I&#8217;ve spent my spare time the last 6 months building an AIR application called &#8220;<a href="http://powerzapp.com">Powerz</a>&#8220;.  Simply, it is an application that allows you to play <a href="http://www.wizards.com/default.asp?x=dnd/4dnd/dndtestdrive">Dungeons &amp; Dragons 4th edition</a> a lot quicker.  It was built in response to newer players hastily flipping back and forth through rule book pages, all the while lamenting how much easier it is to do this in <a href="http://worldofwarcraft.com">World of Warcraft</a>.</p>
<p>It also became a test for myself.  I wanted to see if I could release a product on my own, perhaps even turn a profit.  I&#8217;ve been attempting for 5 years to create an online version of D&amp;D, fueled by the wishful emails of those around the world who both managed to get their hands on alpha builds and validated my target market.  That, and I had recently become an advisor for a startup, so needed creditability that I had produced results in the product sphere as opposed to the service industry which I&#8217;m currently in (<a href="http://adobe.com/products/flex/">Flex</a> &amp; <a href="http://adobe.com/products/flash/">Flash</a> consulting/contracting).  I had just recently completed my first official Agile/<a href="http://aboutscrum.com/">Scrum</a> project getting a startup client to (*ahem* near) Alpha, and upon reflecting, knew I was now capable of releasing a real product on my own.</p>
<p><a name="introduction"></a><strong>Introduction: Why the need for Powerz?</strong></p>
<p>D&amp;D 4th edition was created, in my opinion, to cater to, what I call, the &#8220;WoW Generation&#8221;.  <a href="http://www.wizards.com/">Wizards of the Coast</a>, the company also responsible for <a href="http://www.wizards.com/magic/multiverse/default.aspx">Magic the Gathering</a>, owns the D&amp;D game.  They recognized that to gain broader appeal of a game traditionally challenging to learn and losing market share to video games, they needed to not only make it easier to learn and play, but also target this gaming demographic.  The new rules do just that.  They are easier to learn for those not inclined to &#8220;read a bunch of rules&#8221;, and the new power concept allows a gaming group to quickly ascertain how they can contribute to the group.</p>
<p><a href="http://powerzapp.com/screenshots/Power-Last_Ditch_Evasion.jpg"><img style="width: 160px; padding-right: 4px;" title="Power - Last Ditch Evasion" src="http://powerzapp.com/screenshots/Power-Last_Ditch_Evasion.jpg" alt="Power - Last Ditch Evasion" align="right" /></a>The problem with the WoW gen&#8217;s, though, is that they grew up texting, and not only want, but EXPECT digital tools to be there, as well as cross device.  D&amp;D, at least currently, doesn&#8217;t totally work like that.  They have made great strides in years to provide online digital content, such as Character Builders, rules compendiums, and online magazines with exclusive content.  What&#8217;s funny to me is that the main goal for most of this content is to be printed to paper and used during gameplay.  If you want to use these tools strictly digitally, you can, but that wasn&#8217;t why they were made.  Ultimately, your still going to be using &#8220;real&#8221; books during gameplay.</p>
<p>When you have a background in <a href="http://en.wikipedia.org/wiki/Massively_multiplayer_online_role-playing_game">MMORPG&#8217;s</a>, or even just gaming on consoles, you look at rule books as primitive, and cumbersome, and ultimately, not as fun.  They, like me, know this problem has already been solved digitally.</p>
<p>What kept coming up as a hassle during gameplay with this new generation of gamers was referencing their character&#8217;s powers, the main crux of 4th edition rules.  I figured if I could solve this problem digitally, I&#8217;d be onto something special.  I knew I couldn&#8217;t solve everything; I&#8217;d tried multiple times in the past to digitize the entire D&amp;D experience, and I simply didn&#8217;t have enough resources to pull that off.  For a digital power bar, however, I didn&#8217;t need a lot of resources&#8230;</p>
<p><a name="thepowerofpowerbars"></a><strong>The Power of Power Bars</strong></p>
<p><a href="http://jessewarden.com/archives/powerz/powerz-bar-preview.jpg"><img style="width: 160px; padding-right: 4px;" title="Powerz Bar Preview" src="http://jessewarden.com/archives/powerz/powerz-bar-preview.jpg" alt="Powerz Bar Preview" align="left" /></a>If you&#8217;ve ever played <a href="http://worldofwarcraft.com">World of Warcraft</a>, <a href="http://starwarsgalaxies.com">Star Wars Galaxies</a>, <a href="http://ddo.com">DDO</a>, or any other Massively Multiplayer Online Role Playing Game, they have the concept of a power bar.  There are a series of slots on the bottom, like a horizontal list in Flex, and in each you can drop a power into.  It&#8217;ll be represented as a little image icon that infers what the power does.  Upon rolling over them, they provide details of what they do.  Upon clicking them, you use them.  While veteran players use keyboard shortcuts and macros, this GUI concept is the core to most MMORPG&#8217;s today.  Players familiar with such games &#8220;get it&#8221;, just like you and I understand to click &amp; drag on a scroll bar to scroll text.</p>
<div class="wp-caption aligncenter" style="width: 397px"><a href="http://jessewarden.com/archives/powerz/powerbar-wow.jpg"><img src="http://jessewarden.com/archives/powerz/powerbar-wow.jpg" alt="World of Warcraft Power Bar" width="387" height="32" /></a><p class="wp-caption-text">World of Warcraft Power Bar</p></div>
<p>This interface element is important because in MMO&#8217;s, those powers, while forming the crux of the 2 most important aspects in those games, chatting &amp; fighting, they also serve another subtle purpose.  RPG games in general are technical.  They basically take a lot of math, specifically ratio&#8217;s &amp; percentages, and personify the results through the use of chance.  While neat from a geek perspective, newbie players, especially those not tech saavy, can get overwhelmed by information overload.</p>
<p><a href="http://jessewarden.com/archives/powerz/powerbar-ddo.jpg"><img class="aligncenter" title="Dungeons &amp; Dragons Online Power Bar" src="http://jessewarden.com/archives/powerz/powerbar-ddo.jpg" alt="" width="393" height="42" /></a></p>
<p>Just like how Word hides non-frequently accessed information in menu&#8217;s that reveal, so to do MMORPG&#8217;s &#8220;reveal&#8221; information when the user requests it.  Additionally, since these interface elements are actually over top of a 3D virtual world, they need to be as non-intrusive as possible.</p>
<p><a href="http://jessewarden.com/archives/powerz/powerbar-swg.jpg"><img class="aligncenter" title="Star Wars Galaxies Power Bar" src="http://jessewarden.com/archives/powerz/powerbar-swg.jpg" alt="" width="348" height="36" /></a></p>
<p>In short, they provide the user with the ability to learn what their character can do, when she/he can do it, all using a mnemonic device of visual icons that relate to the action in a non-intrusive interface.</p>
<p><a name="whyair"></a><strong>Why AIR?</strong></p>
<p><a href="http://adobe.com/products/air/"><img style="padding-right: 4px;" title="Adobe AIR" src="http://jessewarden.com/archives/powerz/adobe_air.jpg" alt="Adobe AIR" align="left" /></a><a href="http://jessewarden.com/2007/06/what-rhymes-with-air-i-dont-care.html">I&#8217;ve bashed her in the past</a> and got shot down by desktop developers who came out of the wood work.  To this day I still don&#8217;t get clients asking me to build AIR apps.  Regardless, it was a pretty clear choice as to why I needed AIR: offline capability to run Flex apps.</p>
<p>You can play D&amp;D ANYWHERE.  I&#8217;ve played at friends houses, at a <a href="http://www.turkey-creek.com/">camp site</a> deep in the woods, on a plane, a bus, etc.  All of these places don&#8217;t always have internet.  Nowadays with wireless and cell phones that have decent coverage, you can <a href="http://9to5mac.com/iPhone-3G-tethering">tether</a> on your device to ensure you have an internet connection just about everywhere.  &#8220;Just about&#8221; isn&#8217;t good enough; if you can&#8217;t use it, or it&#8217;s a spotty connection, you view the &#8220;<a href="http://en.wikipedia.org/wiki/Cloud_computing">cloud</a>&#8221; as holding your data hostage vs. some benevolent caretaker.</p>
<p>So, I didn&#8217;t want an internet connection to be a requirement, and thus, targeted AIR vs. a web browser.  If you know me, using the Flex SDK was a no-brainer.  If you don&#8217;t, here&#8217;s the run down:</p>
<ol>
<li>Needs to work on as many platforms as possible.  AIR works on most PC, Mac, and enough Linux distros.  I use a Mac mostly, my gaming group uses Linux and Windows.  The Character Builder for DDi works on a PC with .NET.  Using <a href="http://www.codeweavers.com/products/">CrossOver</a> or <a href="http://www.parallels.com/">Parallels</a> isn&#8217;t cheap.  Buying an OS + emulation software when you already have a working computer is lamesauce.</li>
<li>Writing my own component framework is time consuming.  It took me 6 months to build <a href="http://code.google.com/p/shurikencomponents/">Shuriken</a> for Flash Lite 2, I&#8217;m still working on <a href="http://code.google.com/p/coreplay/">CorePlay</a> for pure AS3&#8230; so if I ended up doing that, I&#8217;d spend all my time on developing code to develop code vs. finishing my product.  Flex has all the components &amp; styling features I need, Flex 4 more so.</li>
<li>I make my living developing in Flex Builder.  This is what I&#8217;m most comfortable, and thus productive in.</li>
</ol>
<p><a name="whydjango"></a><strong>Why Django?</strong></p>
<p><a href="http://djangoproject.com"><img style="padding-right: 4px;" title="Django Project" src="http://jessewarden.com/archives/powerz/django_logo.gif" alt="Django Project" align="left" /></a>Once I personally started using Powerz in my game sessions, taking her for a test run with my gaming group, a new problem arose: setup time.  While battles finally went a lot faster, and focused more on strategy and chaos vs. wtf can I do, actually STARTING to play took awhile.  Players had to manually input the powers from the Players Handbook into Powerz.  Without <a href="http://en.wikipedia.org/wiki/Optical_character_recognition">OCR</a>, this is a lot of meticulous hand typing.  This included those who played with made up house rules.</p>
<p><a href="http://jessewarden.com/archives/powerz/Community-login.jpg"><img style="width: 160px; padding-right: 4px;" title="Community Login" src="http://jessewarden.com/archives/powerz/Community-login.jpg" alt="Community Login" align="right" /></a>I thought, why couldn&#8217;t we do something like the CDDB days of old?  <a href="http://en.wikipedia.org/wiki/CDDB">CDDB</a> was an online database where people would submit CD track lists.  That way, when you turned a CD into MP3&#8217;s, it automatically filled out the song names and album name for you.  By the time it got popular, most CD&#8217;s were in the database so you didn&#8217;t need to submit them yourself.  This was the first Web 2.0 (aka the read-write web) phenomenon that I remember.  Basically you are leveraging the community, much like <a href="http://wikipedia.com">Wikipedia</a> leverages the knowledge from every contributor in the world.  This is a double-edged sword, as sometimes CDDB would have incorrect data without an easy way to change it.  Wikipedia has had its fair share of drama about article authenticity, and who defines the truth when multiple authors disagree about the same topic.</p>
<p>Regardless, both are using the forces of good, and showcase how leveraging community input can greatly benefit the masses.  Two heads are better than one, and thousands are just f&#8217;ing awesome.</p>
<p>I set out to build an online database of powers so when one person submitted it, everyone else could use it.  The most common ones, say all 1st level ones for all classes, would be ready to go.  That way, even new players could quickly get up to speed.  Powerz is supposed to speed up gameplay, and this would be the final lynchpin.</p>
<p><a href="http://jessewarden.com/archives/powerz/Community-main.jpg"><img style="width: 160px; padding-right: 4px;" title="Community Main" src="http://jessewarden.com/archives/powerz/Community-main.jpg" alt="Community Main" align="left" /></a>I hate, and suck, and server-side anything.  I&#8217;d argue the majority of arguments, philosophical debates, and technical podcasts about software are regarding server-side development (iPhone apps aside).  When people talk about <a href="http://martinfowler.com/articles/injection.html">Inversion of Control</a>, server clustering, or <a href="http://en.wikipedia.org/wiki/Aspect-oriented_programming">Aspect Orientated Programming</a>, my eyes glaze over, I <a href="http://jessewarden.com/archives/facepalm.jpg">face palm</a>, and am like, &#8220;Wow&#8230; that&#8217;ll solve like 10% of my problems.  That 10% is on the server&#8230; WHERE MY CODE ISN&#8217;T RUNNING!&#8221;  To be fair, the majority of all cool software is running on the server.  Most Flex apps I&#8217;ve written are merely pretty faces for pimp server-side action.  The problem with server-side stuff is that you can&#8217;t see it.  I&#8217;m a visual person, I went to art school, and if I can&#8217;t see it, to me it&#8217;s boring.  I like seeing visual results from my coding efforts, and no, logging statements don&#8217;t count.</p>
<p>So&#8230; I knew I was in trouble with my idea.  Every time in the past I had such an idea, I merely turned to <a href="http://php.net">PHP</a>, since finding good server devs looking to work for free is really hard.  PHP is available on just about every web host, for free, and there are a lot of resources out on the internet for it.  It&#8217;s also very similar in syntax to ActionScript, so learning it was easy.  The problem is, I&#8217;m not &#8220;in&#8221; the PHP community.  Creating a user account system may seem like a reasonable programming task to me, but an ignorant waste of time to a veteran PHP programmer who has used <a href="http://framework.zend.com/?fle=Adobe">Zend</a> or <a href="http://drupal.org/">Drupal</a> on many projects.  Most of my endeavors into larger PHP systems have failed because the workload was just to large for me to tackle both the front and back-end.  I knew this time I HAD to find whatever framework others were using for a user account system.  I&#8217;ve failed to find like-minded server-side developers in the past for such ideas.  I actually had a friend offer his services for this very project, but I was concerned I might actually make money, and I make a rule of not mixing friends and business.</p>
<p><a href="http://jessewarden.com/archives/powerz/Community-01.jpg"><img style="width: 160px; padding-right: 4px;" title="Community Powers Search Results" src="http://jessewarden.com/archives/powerz/Community-01.jpg" alt="Community Powers Search Results" align="right" /></a>However, I had just got off a <a href="http://www.djangoproject.com/">Django</a> project.  Having spent 5 years or so evangelizing <a href="http://amfphp.org/">AMFPHP</a>, yet never actually successfully getting native object passing working, I decided I&#8217;d see how easy it was in Python.  Additionally, my experiences using Django&#8217;s user administration interface along with <a href="http://pyamf.org/">PyAMF</a> Flex integration was a very pleasant experience.  Since I&#8217;d already taking a look at Ruby on Rails awhile ago, I figured I&#8217;d give Python a chance.</p>
<p>Best decision ever.</p>
<p>I don&#8217;t know Terminal, my SQL knowledge equates to SELECT * FROM *, and I&#8217;ve never coded Python before.  Django is the shit.  It&#8217;s so easy, I learned my way around Terminal enough to not only &#8220;run a local server&#8221; (I know, right?), sync my database, and even play with <a href="http://www.python.org/">Python</a> code, just like <a href="http://adobe.com/products/director/">Director&#8217;s</a> message window.  I even learned how to remote ssh into my production server, install PyAMF remotely, and deploy my code.  Django is merely a framework atop of Python, but you have to know all that insane crud just to do it.  Oh yeah, and I ended up buying <a href="http://macromates.com/">TextMate</a> (in part to <a href="http://twitter.com/kristoferjoseph">Kristofer&#8217;s</a> recommendation) to use for coding Python.</p>
<p><a href="http://jessewarden.com/archives/powerz/Community-02.jpg"><img style="width: 160px; padding-right: 4px;" title="Community Characters Search Results" src="http://jessewarden.com/archives/powerz/Community-02.jpg" alt="Community Characters Search Results" align="left" /></a>Speaking of Python, it&#8217;s a LOT like ActionScript 1.  Really strange going back to loose typing.  Unfortunately, the only real benefit I found was more succinct code.  The Aspect Orienated/<a href="http://en.wikipedia.org/wiki/Functional_programming">Functional</a> stuff that uses the <a href="http://en.wikipedia.org/wiki/Python_syntax_and_semantics#Decorators">Decorator pattern</a> with metadata tags for designating what methods require the user to be logged in only works for more recent builds of Python.  Still&#8230; I got it and think its hawt.  Additionally, the fact that you can import just a method of a class and use it is neat.  There&#8217;s been a request on an unnamed list requesting ActionScript 3 get this ability so when you import 1 method of a library, you don&#8217;t end up importing the whole library, and thus incur the file size penalty.  Since SWF is for web, this makes a lot of sense in investing in such a feature.  Python&#8217;s for loops?  Holy fish, advanced, and really cool stuff, way easier than doing similiar things in ActionScript 3 (faster? doubt it).  I still don&#8217;t get their slicing syntax, but I&#8217;m sure if I did it every day I would.</p>
<p>So why Django?  Within 3 days I had learned Python, Django, and PyAMF integration to have a working user authentication system working in my Flex app.  Blah blah blah&#8230; open source has no value&#8230; blah blah blah.</p>
<p>&#8230;I suck at debugging it, though, a friend told me to look into Python logging, but I just ran out of time&#8230; print print print OT OT OT.  That, and my admin only works on my local box, not the remote server&#8230; *ahem*.</p>
<p><a name="selfinflictediterations"></a><strong>Self-Inflicted Iterations</strong></p>
<p>All my personal projects suffered from the most common symptom that affects a lot of us software developers: starting new projects is ALWAYS more fun than finishing them.  You accrue a long list of awesome ideas that never make it to fruition.  Of those, a few you blog about.  Knowing this industry, a bunch are probably worthy of actually finishing and marketing because they&#8217;ll make bling&#8230; but&#8230; we&#8217;re a busy bunch.  That, or you see no point because you have no clue how to monetize them.</p>
<p>I&#8217;ve had this happen 3 times with my major D&amp;D online project in 5 years, 3 times with some games, and once with every other project that wasn&#8217;t specifically created FOR a blog entry since my career started.  I almost swore a blood oath before starting Powerz.  I didn&#8217;t really have too, though, because of circumstances.</p>
<p>First, I had just got off the best gig I&#8217;ve had in my entire career.  It was working for a startup as a service consultant through <a href="http://enablus.com/">Enablus</a>.  So, I make bling, but see $0 bling when they insanely succeed.  Quite the soul reflection project.  Second, I read a book called &#8220;<a href="http://www.amazon.com/Rich-Dad-Poor-Money-That-Middle/dp/0446677450/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1252451054&amp;sr=1-1">Rich Dad, Poor Dad</a>&#8221; upon a recommendation form <a href="http://www.dropthezero.com/">a friend</a>, and was then pissed for 3 weeks straight.  Third, I now knew how to do Agile development which was better than my made up iterative process of the past.  Fourth, D&amp;D 4th edition really is slow if you don&#8217;t know your powers by heart; it&#8217;s even worse for DM&#8217;s who have 50 billion other things to keep track of.  I needed this tool!</p>
<p>I made a simple rule.  If I was going to work on Powers, I needed to release SOMETHING a week from when I started.  If I grabbed a beer and started coding on a Friday night, there better be a new build, with associated forum post, WORKING up online the following Friday.  If I had something come up, like say real, paying work, or my kid(s) got sick, or whatever&#8230;. then 2 weeks. If that didn&#8217;t work because, say I only had 4 hours in a 2 week period, then I&#8217;d lock myself into finishing just one feature before I was allowed to work on anything else.</p>
<p>Failure was not an option.  To fail is to fail myself, and everything I stood for, and for those who listened to my blog entries full of &#8220;advice&#8221;.  If I did fail, it meant Agile didn&#8217;t work, and all <a href="http://jessewarden.com/2008/11/agile-chronicles-1-stressful.html">10 of those blog entries</a> I wrote espousing it were utter bullshit, and I needed to die in a fire.  Seriously.  After being so frustrated for so long about &#8220;figuring out&#8221; software development for the past 9 years, this was the line in the sand.  Pick your platform, pick your tool, pick your framework, and either put up, or shut up.  Get something done vs. proselytizing about &#8220;how to program&#8221; with nothing to show for it.</p>
<p>In short, finish something I started.</p>
<p>6 months later, I&#8217;ve released version 1.0.  That feels f&#8217;ing good.  Really good.  That, and D&amp;D is easier to play now for me, and a lot of others.</p>
<p><a name="quicknoteonscrum"></a><strong>Quick Note on Scrum</strong></p>
<p>Remember, if you ever hear about this Agile or Scrum stuff, and are like, &#8220;Wtf?&#8221;, don&#8217;t stress.  All you need to know about using Scrum correctly is release working software with a new feature every week (or every 2 weeks).  That&#8217;s it, that&#8217;s all you need to do to be JXL Scrum compliant.  If you don&#8217;t do that, you should really take a look at what you are really trying to accomplish.</p>
<p>If you&#8217;re a manager who&#8217;s trying to implement it, and your developers keep going off on paths they weren&#8217;t assigned, play to their ego&#8217;s.  For example, if someone says, &#8220;I could write a login form in less than a day!&#8221;.  If it then takes them 8 days for the form to actually work, call them on it.  I guarantee you they&#8217;ll spout off about &#8220;OOP/Framework setup&#8221;, or some other lack-of-<a href="http://en.wikipedia.org/wiki/Don't_repeat_yourself">DRY</a>-adherence excuse.  That&#8217;s ok; the point here is to show them that what they thought they could do, they didn&#8217;t actually execute on.  They&#8217;ll either re-assess what it really takes to develop even simple things, or you&#8217;ll come to a mutual understanding of what &#8220;working&#8221; really means.</p>
<p>I had to do that.  In 2001, I created a stock charting application in Flash 5, AS1 pre-#initclip days, knowing very little OOP, zero best practices, and no frameworks, in 1 month.  Today, that same application would take me 4 to 6 months, and cost 177% more per hour.  Granted, the devil is in the details (quality of user experience, less bugs, more features, I actually know what I&#8217;m doing now + have experience, etc), but that, to me, says something about my ability to execute.  Those in software know faster doesn&#8217;t mean better&#8230; but when you start splitting hairs about even simple features, you find some surprising things about yourself.  I call this, programmer self-awareness through Scrum.</p>
<p><a name="schedule"></a><strong>Schedule</strong></p>
<p>For those who are interested, here is how my schedule worked out.  When I mention a week, I&#8217;m speaking about a week of development time.  So, if I started coding on Friday night, but only put in 4 hours for an entire week&#8230; I certainly had very little to offer in a true build.  So, my first rule was, if I could do a week, do a week, and release.  If I couldn&#8217;t because I had real work to do, then I&#8217;d instead get 1 feature DONE and release.  This was still hard, because even if I could only devote like 2 hours a week to my personal project, it HAD to be on that one feature, and I had to force myself to finish it so I could get a build up, and move onto another.  It was far from perfect, but it&#8217;s as Scrum as I could get with my free time&#8230; and it guaranteed I&#8217;d release multiple builds with enough room for user feedback.</p>
<ul>
<li>First 3 weeks, spent designing &amp; doing initial prototyping (aka design phase in Waterfall).  I had no gig lined up, so worked 3 weeks straight on my own stuff.  I worked for about 7 days straight in Photoshop CS3.</li>
<li>Work 1 hour one night, 4 hours another, 8 maybe on a weekend, or perhaps none for 4 days in a row.  Bottom line, I still followed my weekly/bi-weekly/single feature release schedule.</li>
<li>One build took 6 weeks (Alpha 9 to Beta 1) because I had to learn Django and do real work at the same time.  Some weeks during that time, I only worked 1 to 2 hours per week, others, I&#8217;d work 3 days straight.</li>
<li>Some weeks were coding.  Some weeks were pure Photoshop.  Three weeks was learning/implementing Django.  Four weeks was setting up the website, porting all code &amp; assets to work on it, and installing all forum and blog software.  All was mixed amongst each other.  Since I was doing everything myself.</li>
<li>I did Analytics once in the beginning, and then changed it 2 weeks later when I couldn&#8217;t understand my own metrics.</li>
<li>Start Date: Around April 5th, 2009.</li>
<li>End Date: Hopefully September 26th, 2009.</li>
<li>Total Time: 6 months</li>
</ul>
<p>It&#8217;s hard for me to predict how long Powerz would of taken had I been able to spend 100% of my time on it.  A lot of things came up, positively &amp; negatively, during development that adversely affected the timeline.  Users asked for features, work flows I originally tried didn&#8217;t pan out, Photoshop designs took a few tries, and learning Django staggered overall development on the Community portion.  All I know is, Flex Builder 3 and Flex SDK 3.3 is foogin&#8217; solid for what I needed.</p>
<p><a name="technicaldetails"></a><strong>Technical Details</strong></p>
<p>The <a href="http://powerzapp.com">web site</a> is pretty standard stuff.  <a href="http://powerzapp.com/forum/">Forum</a> is <a href="http://www.phpbb.com/">PHPBB</a>, and blog is vanilla install of <a href="http://wordpress.org/">Wordpress</a>.  Hopefully post 1.0 launch, I can modify the blog to match the rest of the site look and feel (excluding forum) via <a href="http://www.themedreamer.com/">the Dreamer</a>, an easier way to design Wordpress sites via <a href="http://adobe.com/products/dreamweaver/">Dreamweaver</a>.  Her majesty used it for her site and it&#8217;s pretty cool.  I also need to redo my <a href="http://jessewarden.com/projects/gamingtools/powerz/screencast/">dated screen cast</a>, and tons of other things.</p>
<p>While I did the original web site designs in <a href="http://adobe.com/products/photoshop/">Photoshop</a>, the site itself was done by her majesty and I in <a href="http://adobe.com/products/fireworks/">Fireworks</a>.  Fireworks&#8217; text handling is superior to Photoshop&#8217;s, and now that CS4 shares the same font engine, you can get good looking interfaces.  If Photoshop were to improve their text handling capabilities, I&#8217;d probably still use Fireworks for it&#8217;s easier object editing + grouping + moving functionality.  For the web with lots of content, it was just quicker for me and her majesty.</p>
<p>For the video, shot using a <a href="http://www.amazon.com/Sony-DCR-SR200-Handycam-Camcorder-Optical/dp/B000M3GJKU/ref=sr_1_1?ie=UTF8&amp;s=electronics&amp;qid=1253188966&amp;sr=8-1">Sony DCR-SR200</a>, and edited in <a href="http://www.adobe.com/products/premiere/">Premiere</a> CS3 &amp; <a href="http://adobe.com/products/aftereffects/">After Effects</a> CS3.  <a href="http://www.telestream.net/screen-flow/overview.htm">ScreenFlow</a> was used for demoing the software.</p>
<p><a name="flex3vs4"></a><strong>Flex 3 vs 4</strong></p>
<p>Yes, I very much wanted to use <a href="http://labs.adobe.com/technologies/flashbuilder4/">Flex 4</a>.  Unlike Flex 2 Alpha, however, she&#8217;s unstable and changes all the time.  You could build some pretty Enterprise stuff on Flex 2, Beta 1.  I would never do such a thing with Flex 4 just because she&#8217;s in such flux, and the IDE (+ <a href="http://labs.adobe.com/technologies/flashcatalyst/">Catalyst</a> builds) is somewhat flaky.  Obviously 6 months later things are more stable&#8230; but they still changed a lot (fx prefix, Halo interop, etc.).</p>
<p>I used Flex Builder 3 &amp; Flex SDK 3.2&#8230; then 3.3&#8230; then 3.4.  I use AIR 1.5.2.  AIR still has a bug where you can&#8217;t seem to use compc (aka Library Projects) because of some weird Vector bug in playerglobals.swc or something.  So I just gave up on using a library project.</p>
<p><a name="libraries"></a><strong>Libraries</strong></p>
<p>I have 1 Flex project, and a ton of libraries.  Ones of note are:</p>
<ul>
<li>Cliff Hall&#8217;s <a href="http://puremvc.org/">PureMVC</a></li>
<li>Ely&#8217;s <a href="http://www.quietlyscheming.com/blog/2007/01/23/some-thoughts-on-doubt-on-flex-as-the-best-option-orhow-i-made-my-flex-images-stop-dancing/">SuperImage</a> (that I <a href="http://jessewarden.com/2009/08/fix-for-elys-superimage.html">patched</a>)</li>
<li>Claus Wahlers&#8217; and Max Herkender&#8217;s <a href="http://codeazur.com.br/lab/fzip/">FZip</a> for reading &amp; writing my custom file formats</li>
<li>Christian Cantrell&#8217;s <a href="http://code.google.com/p/as3nativealertlib/">NativeAlert</a> ported to Flex</li>
<li><a href="http://code.google.com/p/gaforflash/">Google Analytics</a></li>
<li><a href="http://google.com/adsense">Google AdSense</a></li>
<li><a href="http://code.google.com/p/as3corelib/">as3corelib</a> for <a href="http://json.org">JSON</a>, used in reading &amp; writing custom file format</li>
<li>Adobe AIR Update framework (which refuses to GTFO of RAM) with custom badges written in Flash (zomg!)</li>
<li>my DebugMax window which is a lame attempt to copy that older Flash debug window (the Portuguese one)</li>
<li>&#8230;and Grden&#8217;s <a href="http://rockonflash.wordpress.com/2007/05/16/as3-localtolocal-and-coordinatetools/">localToLocal function</a></li>
<li>Server is running Django on Python, using PyAMF to send AMF objects back and forth. I&#8217;m only using one class; getting nested ValueObjects to work with inherited and one to many relationships in Django&#8217;s Models was nigh impossible to debug.  For now, I just pass simple Objects which are uber-easy to parse.</li>
</ul>
<p>Blah blah blah&#8230; open source provides no value&#8230; blah blah blah.</p>
<p><a name="monkeypatches"></a><strong>Monkey Patches</strong></p>
<ol>
<li>Commented out a bunch of <a href="http://bugs.adobe.com/jira/browse/SDK-20784">InterManagerRequest</a> code in AIR&#8217;s NativeDragManagerImpl class. Doing drag operations would cause the app to lock up for 7 to 11 seconds. Not sure if this was fixed in 3.4, but I don&#8217;t load multiple Flex apps with different SDK versions, so don&#8217;t need this code.</li>
<li>Added bitmap smoothing in SWFLoader, which Flex SDK 3.4 (or 3.3 I forget which, added officially)</li>
<li>Added a numLines getter to Label for more accurate text height measurement&#8230; which I then later didn&#8217;t use.  Proper invalidation fixed my measurement bug; text can be finicky, but if you wait a frame&#8230;&#8230;</li>
</ol>
<p><a name="developmentchallenges"></a><strong>Development Challenges</strong></p>
<p>There were 3 development challenges I faced.</p>
<p><a href="http://jessewarden.com/archives/powerz/Character-v2-preview.jpg"><img style="width: 160px; padding-right: 4px;" title="Character" src="http://jessewarden.com/archives/powerz/Character-v2-preview.jpg" alt="Character" align="right" /></a>The first was developing in AIR.  If you are using Flex in AIR, it&#8217;s nearly the same thing.  The hard parts were learning how Windows work, and their quirks (such as when does Window REALLY get its reference to nativeWindow?).  How do you design for this as a designer, and what is an appropriate design metaphor?  Multiple windows, or 1 window with many states?  Also, event bubbling doesn&#8217;t work with windows, since each has it&#8217;s own stage, so there was a learning curve of when to manually re-dispatch, and when to just hand off to PureMVC Mediators.</p>
<p>The second was learning to work with reading and writing files.  The FileReference class is EASY, but there are actually 3 classes (really you just work with 2) for AIR.  They too have intricacies to learn, and how you can abstract them, and what the costs are in doing so.  What was fun to figure out was how to associate a file with a document window in the PureMVC framework.  I really had a tough time trying to tightly couple something when you&#8217;re technically not supposed to tightly couple anything in programming.</p>
<p>The third was creating a file format.  I believe most traditional developers would of used some sort of serialization via ByteArray and the <a href="http://livedocs.adobe.com/flex/3/langref/flash/utils/IExternalizable.html">IExternalizable</a> interface for your objects.  To me, that stuff takes a lot of work, and isn&#8217;t easy for me to debug, nor verify if it worked.  Maybe to those who think in 0&#8217;s and 1&#8217;s, but not me.  It took some tinkering; I copied how SWC works.  SWC is a ZIP file with some XML and binary assets all inside.  My file formats are basically the same thing; a ZIP file with a JSON text file holding the serialized object, images for any icons, and a text file determining what type the file format is (since you can&#8217;t rely on file extension).  This allowed me to open up the file to see it&#8217;s contents and confirm my code worked as well as perusing the JSON to see if my objects serialized correctly.</p>
<p>What was great about being the only developer was that I was also the designer and back-end developer.  I knew how to design assets for Flex and could predict what I&#8217;d need designed.  As the back-end developer, I could create data that the client would need, thus making my job easier in both places.</p>
<p><a name="featurecasulaties"></a><strong>Feature Casualties</strong></p>
<p>I had 2 features that caused major scope creep, and thus extended how long it took.  They weren&#8217;t a waste of time, but as with every project, I learned something.</p>
<p>The first was the whole &#8220;document editing process&#8221; that people are used to.  You open a file, edit it, save it if it&#8217;s dirty, and close the &#8220;document&#8221;.  If you &#8220;Save As&#8230;&#8221;, you create a new file, yet use same window.  I didn&#8217;t use this model at first.  Instead, I just opened files, kept a reference to the file handle for each AIR window, and removed it when the window closed.  However, this is not how every other desktop application works.  Additionally, for those on network drives, you couldn&#8217;t really work with the files easily when moving things since it always had an opened file handle.  So, it was a pretty big re-write/re-factoring effort to put this functionality &amp; work flow in.  I know how to do it now, but I&#8217;m just glad no one asked for undo yet. *whew*</p>
<p>The second was pimping out Christian&#8217;s NativeAlert window.  I spent 3 days in <a href="http://adobe.com/products/aftereffects/">AfterEffects</a> when I was between gigs creating a transition in and transition out for the window.  Instead of just popping in, it&#8217;d &#8220;materialize&#8221; in, all magical like.  To me, and one of my users, it looked awesome.  It got old after 2 uses because you had to wait for it and there are a few alerts when saving files.  If I speed it up any, it loses fidelity&#8230; so I just removed it.  It required a lot of custom code to make the alert do it&#8217;s modality magic in time with the transition.  I didn&#8217;t get to use any of it.</p>
<div>
<p><object id="player" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="450" height="400" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="name" value="player" /><param name="allowfullscreen" value="true" /><param name="src" value="http://jessewarden.com/projects/gamingtools/powerz/oldalerts/preview/alert_skin.swf" /><param name="align" value="middle" /><param name="quality" value="high" /><embed id="player" type="application/x-shockwave-flash" width="450" height="400" src="http://jessewarden.com/projects/gamingtools/powerz/oldalerts/preview/alert_skin.swf" quality="high" align="middle" allowfullscreen="true" name="player"></embed></object></div>
<p><a name="marketingandresearch"></a><strong>Marketing &amp; Research</strong></p>
<p>This was the most interesting for me.  While I&#8217;m not a good salesman, I feel that I get online marketing and branding.  I also feel like I understand my target audience, since I&#8217;m part of that audience.  I actually did market research (aka learning my target audience and their needs) both at the start and during development.</p>
<p>I looked online and read about what WotC was offering, and then I looked at all the 3rd party offerings.  I took a few for a spin.  I read user reviews on forums and blogs, especially the passionate ones.  I wanted to gain a better understanding of what they liked about the software, and how they expected software to work.  There wasn&#8217;t really a pattern.  The bitching about lack of Linux/Mac support was low, and a lot of the 3rd parties utilized Java.  For those that didn&#8217;t, there we already well documented ways of installing a Windows emulator.</p>
<p>One thing that reading the forums did for me was really educate me on the current flux of the industry.  Technology really has changed, and continues to change, table top gaming.  WotC is in an interesting time of the market, and frankly I&#8217;ve think they&#8217;ve done a good job on positioning their D&amp;D brand &amp; rules for 4th edition to perform well with these changes.  Where they haven&#8217;t done entirely well is executing both their community aspects online, as well as delivering their associated digital tools.</p>
<p>The short version of WotC&#8217;s transition to the digital age is, as magazine sales declined, WotC first sold their magazines to <a href="http://paizo.com/">Piazo</a>, and later brought them back and incorporated them into their new online subscription service; they no longer print magazines.  You get the monthly magazines digitally, exclusive content, as well as access to their desktop and web tools.  There are good and bad things about this.  Some of their software isn&#8217;t released years later, but the ones that are are definitely nice.</p>
<p><a name="targetaudience"></a><strong>Target Audience</strong></p>
<p>I wrote something similar to this over a the <a href="powerzapp.com/blog/2009/09/ddis-character-builder-powerz.html">Powerz blog</a>.  Bottom line, there is a lot of confusion, at least for me, on who really is the target demographic.  The high level view is that the older players prefer tangible rule books, whereas the younger ones are more apt to digital content.  That&#8217;s where the black and white views end.  Some from both groups are fine with digital content, but intend to transfer that content to paper in use in their games.  Others would prefer to wholly digital, yet still play in person with their friends; like a LAN party.</p>
<p>I intended to confirm this suspicion beyond just talking online&#8230;</p>
<p><a name="triptodragoncon"></a><strong>Trip to Dragon*Con</strong></p>
<p>&#8230;so I took a trip to <a href="http://dragoncon.org">Dragon*Con</a> 2009 this year.  I go every so often to stock up on new dice as well as to see the <a href="http://www.501st.com/">501st</a>.  My goal this year was to promote Powerz, and meet potential customers.  I knew it would be challenging for a few reasons.  First off, finding D&amp;D players is actually hard.  It&#8217;s a huge Sci-fi &amp; fantasy conference; it&#8217;s not solely for D&amp;D&#8217;ers.  Additionally, most D&amp;D&#8217;ers who do go play with their friends at predefined tables in a reserved hotel ballroom.  These are usually niche groups, and while friendly, you can&#8217;t just barge in on them in a middle of game.  If someone did that to me during mine, I&#8217;d be really ticked off.  Additionally, the conference itself is confusing because it&#8217;s spaced around 4 semi-adjoining hotels (Hilton, Marriott, Sheraton, etc.), and signage isn&#8217;t large/verbose enough for you to get a clear picture of where you are, nor what events are happening where.  I knew it&#8217;d be hard.  Her majesty helped set my expectations to a reasonable level.</p>
<p>My first attempt was while waiting in dice line (like a food large buffet, except there are different colored dice you can choose from).  One particular customer was taking awhile to get his transaction finished, and was in a TF2 spy costume (I think), so I figured he was a good target.</p>
<p>&#8220;Hey chief, you play D&amp;D?&#8221;</p>
<p>&#8220;Yeah!&#8221;</p>
<p>&#8220;Cool, you play 4th edition?&#8221;</p>
<p>&#8220;Naw, 3.5.&#8221;</p>
<p>*sigh*</p>
<p>I then asked the attendant who was waiting on customers, but he didn&#8217;t play, just pointed to one of his co-workers; but they were UBER busy.  Even <a href="http://vimeo.com/6553056">Solid Snake briefly came out of his box</a> to browse their wares.  I didn&#8217;t want to annoy every customer, so moved to another vendor booth, full of D&amp;D books.</p>
<p>A girl was just sitting down in a chair, and lamenting about how good it was to sit down.  Prime target.</p>
<p>&#8220;Hey, you play D&amp;D?&#8221;</p>
<p>&#8220;Yeah&#8230;&#8221;</p>
<p>&#8220;4th edition?&#8221;</p>
<p>Irritatedly, &#8220;Only because my group made me&#8230;&#8221;</p>
<p>&#8220;Rad, do you mind if you ask you a few questions about some software I&#8217;m building?&#8221;</p>
<p>Cautious, and body language suggesting she was about run at the slightest sign I was a vampire, &#8220;Ooookkkayy&#8230;.&#8221;</p>
<p>I sat down next to her on the floor to make her feel more comfortable with my laptop, and briefly walked her through why I created Powerz, and what it does.</p>
<p>She immediately got excited, &#8220;Oh we already use that through our DM.  He uses WotC&#8217;s subscription service&#8230; DD something&#8230;&#8221;</p>
<p>&#8220;DDO or DDi?&#8221;</p>
<p>&#8220;Yeah.&#8221;</p>
<p>&#8220;Which one?&#8221;</p>
<p>She shrugged but excitedly explained, &#8220;I don&#8217;t know, but it&#8217;s great.  You can input all of your character data, and it prints out all your powers.  Our whole group does it.&#8221;</p>
<p>I then proceeded to ask her questions about how her group plays, and take notes.  Another gent from her gaming group joined in on the conversation, and motioned to a 3rd member who was also browsing books nearby.  After I had asked my questions, I thanked them for their time&#8230; and went looking for a bar.  I suddenly felt insecure, &#8216;How could DDi do all that?  There is no way, I&#8217;ve seen the screen shots, read the reviews&#8230;.&#8217;</p>
<p>While waiting for the bar tender who was overworked, and was already getting heckled by some disgruntled women next to me, I reflected on those I had talked to.  I knew a lot of the older generation was very pro-3.5, me included.  I really like, still, the 3.5 rules and felt they were akin to Macromedia&#8217;s Flash 8; the pinnacle of the company.  I started getting really depressed, and quickly started going over all of my past research in my head.</p>
<p>&#8230;then I remembered something the girl had said.  &#8220;Print them out.&#8221;  Print?  To paper?  wtf?  A smile came to my face, I gave up waiting on the bartender, and quickly headed to where I remembered the D&amp;D gaming tables being the previous year.  I stopped by the bellman&#8217;s desk to obtain some change so I could buy a few people beers in exchange for me pestering them with questions.</p>
<p>Paper.  That was really what I kept seeing.  The generation gap in that one prefers tangible assets to play with and the younger ones do not.  Again, it&#8217;s not that black and white sometimes, but it&#8217;s still true.  While waiting 1 hour and 40 minutes in line, I met a father who had brought his 11 year old daughter to &#8220;meet&#8221; the creators of the online game she played.  It was some alternative to <a href="http://www.clubpenguin.com/">Club Penguin</a>, which was apparently ruined under new management.  She was really excited, and wanted to be a programmer when she grew up.  The father, clearly out of his element, saw me in my business professional getup, clearly over dressed for such a casual, and often costumed event, and seemed happy to have some one to talk to.  He found it strange that his daughter would spend his money on these online games for things that didn&#8217;t exist.  Instead of a new barbie doll, she&#8217;d get a some new, exclusive outfit for her online character.  We discussed her online habits, and those of her friends.  I explained what I did, and he was intrigued.</p>
<p>His daughter is my target audience.  The girls and boy in front of her, definitely early teens, one dressed up as <a href="http://en.wikipedia.org/wiki/Naruto">Naruto</a>, and others as <a href="http://en.wikipedia.org/wiki/List_of_InuYasha_characters#Sango">Sango</a> from InuYasha&#8230; those are my target audience.  They grew up texting, the internet always existed.  Those who were my age, dressed up as star trek characters&#8230; those probably aren&#8217;t my target audience.  These kids revel in online content, but still have social interactions with each other in person.</p>
<p>People like me, and the kids who are used to digital tools don&#8217;t mind <strong>keeping</strong> things digital.  Others see digital tools as a means to a paper end.</p>
<p>Upon leaving, I was convinced my target audience was mostly online and not at Dragon*Con&#8230; or at Dragon*Con WITH their PARENTS.  It was a great learning experience, even talking to the few people I did was helpful.</p>
<p><a name="failures"></a><strong>Failures</strong></p>
<p>The project as a whole, while successful, failed to meet one of its primary goals: make money.  It does have some successes, which I document below.  I had two main goals: releasing a product to prove I could execute, and to make money, enough to cover costs.  Currently, there is not enough community features to justify a subscription pricing model.  Additionally, I highly doubt I&#8217;ll get enough users to cover the costs via the ad supported model I use currently.</p>
<p>If you add up all the costs:</p>
<ul>
<li>Around 6 to 10 weeks of man hours (design, development, marketing + expenses)</li>
<li>hosting costs ($20 hosting + $20 Django container @ Mediatemple)</li>
</ul>
<p>The total comes to around $50,000.  Each month I go $40 more into the hole as the ads currently aren&#8217;t providing enough revenue to cover costs, and I haven&#8217;t figured out how to monetize the anonymous usage data.</p>
<p>I have a new idea that will actually generate revenue, and Powerz could actually be a companion application, so that&#8217;s a positive.</p>
<p>I&#8217;m not sure about this statement, but&#8230; here goes: I&#8217;m glad I know I&#8217;m capable of executing vs. knowing how to make money and not execute.  This, as opposed to someone who knows how to make money, but can&#8217;t execute.  The sad fact is, most rich people I read about know how to make money, and get other more qualified individuals to execute for them.  Doh!</p>
<p>As a developer, however, I view this as yet another thing to learn, so that&#8217;s a good thing!  If I start learning how to monetize things better, I can focus my development efforts on what matter monetarily, and eventually find easier ways to leverage help vs. doing everything myself.  If at first you don&#8217;t succeed, try, try again.</p>
<p><a name="successes"></a><strong>Successes</strong></p>
<p>My favorite part, the wins.</p>
<ol>
<li>I now have a tool to make my D&amp;D gaming easier, and more fun.</li>
<li>Others now have access to the same tool, with the ability to help guide it&#8217;s direction.</li>
<li>I&#8217;ve proved to myself for the 2nd time that <a href="http://en.wikipedia.org/wiki/Iterative_and_incremental_development">Iterative development</a> works.</li>
<li>I&#8217;ve proved to myself that I can execute on my ideas.</li>
<li>I learned Django &amp; Python, and also learned not to hate the server-side.</li>
<li>I&#8217;ve learned, again, how much work it really takes beyond just coding to release a product.</li>
<li>I learned a little bit about engaging potential customers.</li>
<li>I learned a little bit about market research.</li>
<li>I learned how NOT to migrate data.</li>
<li>I now have something new to learn: How to make money with software.</li>
</ol>
<p><a name="conclusions"></a><strong>Conclusions</strong></p>
<p>While I&#8217;m disappointed I failed to monetize my work, it&#8217;s still early in the game, so maybe I&#8217;ll think of something.  Overall, I&#8217;m really happy to have finally finished one of personal projects into an actual product.  That, and I learned a ton. Soon, onto idea #2!</p>
<p>If you play D&amp;D 4th edition, check it out and let me know what you think.  If you don&#8217;t, but know people who do, let &#8216;em know; I&#8217;d be most appreciative!</p>
<img src="http://feeds.feedburner.com/~r/jessewarden/~4/4J0skwIE4hU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://jessewarden.com/2009/09/air-app-powerz-play-dnd-faster.html/feed</wfw:commentRss>
		<slash:comments>14</slash:comments>
		<feedburner:origLink>http://jessewarden.com/2009/09/air-app-powerz-play-dnd-faster.html</feedburner:origLink></item>
	</channel>
</rss>
