<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Flex and Flash Developer - Jesse Warden dot Kizz-ohm &#187; Programming</title>
	<atom:link href="http://jessewarden.com/category/programming/feed" rel="self" type="application/rss+xml" />
	<link>http://jessewarden.com</link>
	<description>A blog on software development, technology, games &#038; movies.</description>
	<lastBuildDate>Sat, 27 Feb 2010 14:05:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Good Memory Management When Using PureMVC</title>
		<link>http://jessewarden.com/2009/11/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>
]]></content:encoded>
			<wfw:commentRss>http://jessewarden.com/2009/11/good-memory-management-when-using-puremvc.html/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>AIR App: Powerz &#8211; Play Dungeons &amp; Dragons 4th Edition Faster</title>
		<link>http://jessewarden.com/2009/09/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>
]]></content:encoded>
			<wfw:commentRss>http://jessewarden.com/2009/09/air-app-powerz-play-dnd-faster.html/feed</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Agile Chronicles #3: Branch Workflow</title>
		<link>http://jessewarden.com/2008/11/agile-chronicles-3-branch-workflow.html</link>
		<comments>http://jessewarden.com/2008/11/agile-chronicles-3-branch-workflow.html#comments</comments>
		<pubDate>Sat, 08 Nov 2008 03:01:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Business Process]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://jessewarden.com/?p=1298</guid>
		<description><![CDATA[The Agile Chronicles is a set of articles documenting my experiences using an Agile process (Scrum) in software development on my current Flex project.

Part 1 &#8211; Stressful
Part 2 &#8211; Code Refactoring
Part 3 &#8211; Branch Workflow
Part 4 &#8211; POC, Strategy, and Design Challenges
Part 5 &#8211; Acceptance Criteria &#38; Punting
Part 6 &#8211; Tools, Extra Merge Day, and [...]]]></description>
			<content:encoded><![CDATA[<p>The Agile Chronicles is a set of articles documenting my experiences using an <a href="http://en.wikipedia.org/wiki/Agile_software_development">Agile</a> process (<a href="http://en.wikipedia.org/wiki/Scrum_(development)">Scrum</a>) in software development on my current Flex project.</p>
<ol>
<li><a href="http://jessewarden.com/2008/11/agile-chronicles-1-stressful.html">Part 1 &#8211; Stressful</a></li>
<li><a href="http://jessewarden.com/2008/11/agile-chronicles-2-code-refactoring.html">Part 2 &#8211; Code Refactoring</a></li>
<li>Part 3 &#8211; Branch Workflow</li>
<li><a href="http://jessewarden.com/2008/11/agile-chronicles-4-p-to-the-oh-to-the-sea-strategy-and-design-challenges.html">Part 4 &#8211; POC, Strategy, and Design Challenges</a></li>
<li><a href="http://jessewarden.com/2008/11/agile-chronicles-5-acceptance-criteria-punting.html">Part 5 &#8211; Acceptance Criteria &amp; Punting</a></li>
<li><a href="http://jessewarden.com/2008/12/agile-chronicles-6-tools-extra-merge-day-and-postponed-transitions.html">Part 6 &#8211; Tools, Extra Merge Day, and Postponed Transitions</a></li>
<li><a href="http://jessewarden.com/2008/12/agile-bugs-unit-testing-throughput.html">Part 7 &#8211; Bugs, Unit Testing, and Throughput</a></li>
<li><a href="http://jessewarden.com/2009/01/agile-chronicles-8-demo-burnout-and-feature-juggling.html">Part 8 &#8211; Demo, Burnout, and Feature Juggling</a></li>
<li><a href="http://jessewarden.com/2009/01/agile-chronicles-9-scope-creep.html">Part 9 &#8211; Scope Creep</a></li>
<li><a href="http://jessewarden.com/2009/04/agile-chronicles-10-conclusions.html">Part 10 &#8211; Conclusions</a></li>
</ol>
<p>This entry is about utilizing branches for each developer in Subversion, Merge Day, and how while cool, it&#8217;s an ivory tower process.</p>
<p>Note: This isn&#8217;t a tenet of the Agile methodology itself, it&#8217;s just something that works well when you have a bunch of developers collaborating together rapidly, and a specific workflow our client requested we follow.</p>
<p><span id="more-1298"></span><strong>Branch Workflow</strong></p>
<p>We&#8217;re utilizing a Branch Workflow on my current project.  What this means is that each developer creates their own branch in Subversion.  If you&#8217;re utilizing <a href="http://tortoisesvn.tigris.org/">Tortoise SVN</a> on PC or <a href="http://www.versionsapp.com/">Versions</a> on Mac, this is effectively a folder.  As you may know, <a href="http://subversion.tigris.org/">Subversion</a> has 3 default folders that you typically utilize in a repository, and hopefully each project gets its own repository.  These are branches, tags, and trunk.</p>
<p>Some people choose to ignore these.  Some put multiple projects into the same repo.  Both are fine because the mere fact people are utilizing source control in the first place, even if its just for disaster recovery, is great.</p>
<p>These folders, however, really do have a few reasons for their existence that have been well thought out.  Each source control system tries to out-do the next.  In Subversions case, the simple definitions are trunk is for the current version of your project, tags are for multiple older versions of your project, and branches are for experimental features or code that will possibly be merged back into trunk later.</p>
<p>Those are EXTREMELY simple definitions.  If you read the <a href="http://svnbook.red-bean.com">SVN book</a> as well as other people who incorporate SVN into their workflow, the definitions and purposes can get quite complex.  For the project I&#8217;m currently on, branches take on a new meaning.  Not only are they where experimental code goes, but they each represent a user story.  Meaning, if I&#8217;m working on completing the user story where the user can modify their hardware device settings via a Flex form, that&#8217;ll go in it&#8217;s own branch.  Using source control to do this is pretty straight forward.  Instead of checking in here:</p>
<p>https://svn.server.com/repos/project/trunk/</p>
<p>You instead check-in here:</p>
<p>https://svn.server.com/repos/project/branches/sprint2/deviceform/</p>
<p>And the other developer with me would be working from:</p>
<p>https://svn.server.com/repos/project/branches/sprint2/registration/</p>
<p>Pretty easy right?  It gets even easier to check in.  No more, &#8220;Dude, have you checked your shiz in?&#8221; to another developer, or the cardinal rule of doing an update before checking in.  Now you can check in to your hearts content knowing it&#8217;s your own repo to abuse how you wish.</p>
<p>This has the side benefit of NOT breaking trunk&#8230; usually.  Again, the point of having frozen code you KNOW for a fact works is to use a tag, or a series of tagged builds.  A lot of developers get seriously bent out of shape if you break the trunk.  At one job, whoever broke the trunk had to use this monkey icon for their IM icon for one week.  It was funny until the 50th person asked why I had a silly monkey icon, and by that point, I was swearing I&#8217;d never break ANY trunk ever again.  This can possibly have the effect of keeping &#8216;em happy.  At the very least, this reduces the possibility of it happening because no one is working from trunk.</p>
<p>Instead, you check into trunk at the end of every sprint, or for my team, from Merge Day onwards.</p>
<p><strong>Merge Day</strong></p>
<p>Part of Agile is to have a day a few days before your <a href="http://en.wikipedia.org/wiki/Acceptance_testing">UAT</a> where everyone merges their working user stories into the same code base and &#8220;works out the kinks&#8221;.  Since everyone was coding in a different direction, this can be good and bad.  Good because they are working on completely unrelated things, but in GUI coding, we all know some things are extremely related.  Specifically, these are your data model in the form of ValueObjects, calls to a framework such as the use of Event classes in <a href="http://opensource.adobe.com/wiki/display/cairngorm">Cairngorm</a> and <a href="http://puremvc.org">PureMVC</a> Mediators, and modifying settings in higher level view&#8217;s or CSS.</p>
<p>Since this can potentially have major consequences for some portions of a user story, or set of stories, it&#8217;s important to devote a pre-scheduled time where the team knows their code will be merged with everyone else&#8217;s code.  This is called Merge Day on my project and it happens every other Wednesday.  I take my branch and my co-workers, and merge his code into mine.  Then, I fix things that explode.  This could be as simple as just merging code over, or a complex verbal discussion to work towards resolving 2 different implementations.  No code is trivial.  If another developer added a style to MXML for example, setting the background color may seem small to you, but could be the difference between working or non-working code for the other developer&#8217;s code, so its important you do these merges together.</p>
<p>Once that is done, I merge into trunk, test again, fix explosions, and finally check in the working build.  I then upload a new build, or in the case of my current project, deploy a new build in a new sandbox utilizing <a href="http://www.djangoproject.com/">Django&#8217;s</a> web interface.  It can deploy to the web the latest bin-release that&#8217;s checked into SVN by merely clicking a button.  I&#8217;ll send an email to all members of the team identifying what&#8217;s new in the build.  This includes user stories, fixed bugs, and other things of note that are different from previous builds.</p>
<p>For fellow developers, this is a courtesy.  For Project Managers, it&#8217;s a necessity for them to set client expectations for Friday&#8217;s UAT.  For everyone it&#8217;s a Sprint milestone as well as reality check.  You can identify what user stories are done, which ones aren&#8217;t, what older ones you may have broken, and which current ones have issues.  You can then plan with your team what to spend the next day and a half on.  This is also where the rules can potentially break down.  What I&#8217;ll usually do is check my local copy into a new branch, and either fix partially completed or broken user stories, or just finish what I can.  The temptation here is to abandon branches since you only have a day and a half and it isn&#8217;t worth the trouble; just don&#8217;t break trunk in the meantime.</p>
<p>&#8230;riiiight.  The last thing you want to have happen the day before UAT is get all stressed out because trunk is broken.  To me, it&#8217;s worth the extra time in using the process to ensure your UAT prep goes smoothly.  I&#8217;m conservative.</p>
<p>I say that all high and mighty like, but on Sprint #2, I did just that.  Did I get lucky or was it just mad skillz?  Luck.</p>
<p><strong>Conclusions</strong></p>
<p>Now, all of the above processes could have been done with just utilizing trunk.  As you can hopefully see utilizing a branch for each developer, or multiple since creating a new folder is really easy, helps things go a lot smoother without surprises.  You can also plan for the chaos on Merge Day, which while extremely stressful for whoever is doing the merging, is at least expected and a concerted team effort.  I really have enjoyed the Branch Workflow so far.</p>
<p>&#8230;however, I don&#8217;t see it catching on.  Every Flash &amp; Flex developer I&#8217;ve ever talked to doesn&#8217;t use branches.  <a href="http://blog.pixelconsumption.com/">Sam Robbins</a> mentioned over <a href="http://twitter.com">Twitter</a> they might start adopting this workflow at their place of work, and that&#8217;s great, but again, it seems to me most developers feel trunk is good enough and branches are just an unnecessary complication.</p>
<p>Stay tuned for #4 in the Agile Chronicles series where I talk about the POC (Proof of Concept), business strategy, and design challenges.</p>
]]></content:encoded>
			<wfw:commentRss>http://jessewarden.com/2008/11/agile-chronicles-3-branch-workflow.html/feed</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>Agile Chronicles #2: Code Refactoring</title>
		<link>http://jessewarden.com/2008/11/agile-chronicles-2-code-refactoring.html</link>
		<comments>http://jessewarden.com/2008/11/agile-chronicles-2-code-refactoring.html#comments</comments>
		<pubDate>Fri, 07 Nov 2008 02:15:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Business Process]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://jessewarden.com/?p=1297</guid>
		<description><![CDATA[The Agile Chronicles is a set of articles documenting my experiences using an Agile process (Scrum) in software development on my current Flex project.

Part 1 &#8211; Stressful
Part 2 &#8211; Code Refactoring
Part 3 &#8211; Branch Workflow
Part 4 &#8211; POC, Strategy, and Design Challenges
Part 5 &#8211; Acceptance Criteria &#38; Punting
Part 6 &#8211; Tools, Extra Merge Day, and Postponed Transitions
Part [...]]]></description>
			<content:encoded><![CDATA[<p>The Agile Chronicles is a set of articles documenting my experiences using an <a href="http://en.wikipedia.org/wiki/Agile_software_development">Agile</a> process (<a href="http://en.wikipedia.org/wiki/Scrum_(development)">Scrum</a>) in software development on my current Flex project.</p>
<ol>
<li><a href="http://jessewarden.com/2008/11/agile-chronicles-1-stressful.html">Part 1 &#8211; Stressful</a></li>
<li>Part 2 &#8211; Code Refactoring</li>
<li><a href="http://jessewarden.com/2008/11/agile-chronicles-3-branch-workflow.html">Part 3 &#8211; Branch Workflow</a></li>
<li><a href="http://jessewarden.com/2008/11/agile-chronicles-4-p-to-the-oh-to-the-sea-strategy-and-design-challenges.html">Part 4 &#8211; POC, Strategy, and Design Challenges</a></li>
<li><a href="http://jessewarden.com/2008/11/agile-chronicles-5-acceptance-criteria-punting.html">Part 5 &#8211; Acceptance Criteria &amp; Punting</a></li>
<li><a href="http://jessewarden.com/2008/12/agile-chronicles-6-tools-extra-merge-day-and-postponed-transitions.html">Part 6 &#8211; Tools, Extra Merge Day, and Postponed Transitions</a></li>
<li><a href="http://jessewarden.com/2008/12/agile-bugs-unit-testing-throughput.html">Part 7 &#8211; Bugs, Unit Testing, and Throughput</a></li>
<li><a href="http://jessewarden.com/2009/01/agile-chronicles-8-demo-burnout-and-feature-juggling.html">Part 8 &#8211; Demo, Burnout, and Feature Juggling</a></li>
<li><a href="http://jessewarden.com/2009/01/agile-chronicles-9-scope-creep.html">Part 9 &#8211; Scope Creep</a></li>
<li><a href="http://jessewarden.com/2009/04/agile-chronicles-10-conclusions.html">Part 10 &#8211; Conclusions</a></li>
</ol>
<p>This entry is about the joy of coding quickly, finding the balance between getting something done quickly vs. architecting for the future, and dealing with the massive amount of re-factoring that&#8217;s entailed in iterative Scrum development.</p>
<p><span id="more-1297"></span><strong>Coding Quickly</strong></p>
<p>I&#8217;m coding like I&#8217;m in <a href="http://adobe.com/software/flash/">Flash</a> again. Instead of spending 3 weeks setting up <a href="http://opensource.adobe.com/wiki/display/cairngorm/Cairngorm">Cairngorm</a> or <a href="http://puremvc.org/">PureMVC</a> with all your use cases, agreeing on the framework implementation details with coworkers, and getting enough of a foundation together that you can actually compile the application and start seeing screens, you instead make a mad dash to get app working in just a day or less. Rather than discussing with your team what the best ValueObject structure is and how your service layer should work, you instead get a login service working in under 40 minutes. If something changes massively, such as the data structure of the user object returned, you just modify or delete &amp; rewrite the entire ValueObject. You didn&#8217;t spend a lot of time on it anyway, so it&#8217;s not like your &#8220;architecture masterpiece&#8221; is getting deleted; it&#8217;s just some scaffolding code to get you up and running.</p>
<p><strong>Coding For the Future</strong></p>
<p>&#8230;yet, it&#8217;s not scaffolding; it&#8217;s real code that needs to work, and work the entire project. Deciding how much to write well &amp; encapsulated vs. just getting it done is extremely challenging, and fun. When do you git-r-done and when do you over-architect? How much and where? Hard questions to answer, fun times. Part foresight, part gambling, all calculated risk taking.</p>
<p>You know your service layer, the code that talks to the back-end probably WON&#8217;T change.  It&#8217;s extremely unlikely that in the middle of your project, you&#8217;ll switch from .NET and XML to PHP and AMF.  Therefore, spending more time architecting that portion can be done so with confidence in using the extra time it takes.</p>
<p>Anyone from a design agency should already find that very familiar.  You have a series of impossible deadlines, and arrogant programmers (like me) exclaiming you must utilize OOP, design patterns, and frameworks.  You&#8217;re challenged with meeting your deadline(s), trying to do right where you can, and learning throughout the process.</p>
<p>This is slightly different in Agile for product development (or even service development) in that once launched, your application doesn&#8217;t have a limited shelf life.  It&#8217;s an actual product.  Traditionally software is used 3 to 5 times its original intended lifespan, although, I&#8217;d argue with web software that is lessening.  Even before launch, you&#8217;ll be extending certain areas, and expecting it to perform solidly.  Deciding what to hack together for deadline&#8217;s sake, and what to invest well thought out architecture time in is really hard.  REALLY hard.  And fun!</p>
<p><strong>UAT&#8217;s As Checkpoints</strong></p>
<p>During sprint UAT&#8217;s (every other Friday for my team), or even just posting the latest working build for the team to see, you&#8217;ll inevitably question certain functionality and performance.  &#8221;Why is that screen so slow to load?&#8221;, &#8220;Getting to this screen is more tedious than it should be&#8230;&#8221;, or &#8220;My RAM and CPU usage are through the roof!&#8221;.  The designer may see their designed creation in action, and totally change their mind on how it should look or work.  The stakeholders, after using it, may realize that it totally doesn&#8217;t solve their original goal(s) like they thought it would.  You may even notice a bunch of positive enhancements to make on already working sections.</p>
<p>This may sound frustrating, but it&#8217;s good for a bunch of reasons.  First off, this is the main reason Waterfall fails as a process.  None of these things can happen until the project is COMPLETE, in the Validation phase where you validate the software is on spec.  A lot of you may already have had those things happen during a project; now imagine none happening until the entire product is complete.  It&#8217;s a lot harder to change that much code that late in the game.  You now have the opportunity to fix bad decisions, improve design implementations, and add enhancements&#8230; early!  This is when they can have the most positive impact, reduce risk, and get battle tested more.</p>
<p>Secondly, when you go to fix something, you can code with more confidence since the functionality has at least been used.  Programmers second-guess themselves all the time.  They have to; early decisions made incorrectly can have disastrous consequences later (quoted from one of the Pragmatic Programmer authors in an interview).  It&#8217;s really frustrating to be insecure about how a user story actually works.  After getting it &#8220;working&#8221; in a reasonable timeframe, and using &amp; discussing it, you can have confidence in what you code is more &#8220;correct&#8221;.  Well&#8230; almost.</p>
<p>Third, your design gets more real.  After banging on the implemented version of the design comps, your designer/UX person can make better decisions if their design is actually working, and the programmers can collaboratively discuss how to change/improve it.  This assumes your designer/UX person hasn&#8217;t moved onto another project by this point; keeping them on retainer for at least 4 hours a week is helpful for the project.</p>
<p>Fourth, you get confirmation certain problems are in fact real problems.  You may think something is slow, but if no one notices but you, does it really matter?  Naturally, your ego as a programmer is inclined to fix it anyway, but remember, your goal is get things done, not fix something that isn&#8217;t broken.  Same goes for problems you know of and other people see; it is just an iron-clad check mark that something is in fact a problem and needs to be addressed.  If you have performance problems for full-screen video on your Mac in Safari and Firefox, and so does your project manager in Windows in IE, Firefox, and Safari, then you can confidently infer that the majority of other people will too.  Granted, testing with more than 2 people is preferred, but the point here is that you get a helpful checkpoint with a 2nd set of eyes.  Coding this quickly without too much care to architecture, juggling a lot of moving pieces is a lot to handle.  Having a helpful team member confirm an issue early is better than finding it months later in QA, even if you knew about it and forgot.</p>
<p>Bottom line, using a UAT as an early checkpoint for completed user stories ensures they truly are complete and good and points out problems or potential enhancements early.</p>
<p><strong>Refactoring</strong></p>
<p>The above leads to refactoring; re-writing or modifying existing code.  A lot of times refactoring is a pipe dream. Usually you&#8217;re so focused on getting things done, having time to make something work better or faster, even the possibility, is the carrot that can keep you going.</p>
<p>Not in Agile. Based on the past 5 weeks and talking to Darrell (my project manager at <a href="http://enablus.com/">Enablus</a>), you re-factor on average 30% of your code per Sprint. You&#8217;re coding so fast and so furiously, that not everything is encapsulated as much as it could be (except for my service layer, it&#8217;s tight baby!). Not only that, but as you see the software in action, you can then start making valid changes. Maybe the functionality didn&#8217;t work as good as you originally thought it would, or perhaps you suddenly realize, now that you see it, that it needs something added. While this is easy from a user story perspective, just modifying an existing user story or adding a new one, it may not be so straightforward in code. A lot of times, there was no way you could foresee the change you are now tasked at making. If we COULD see those changes ahead of time, there&#8217;d be no need for the Agile process in the first place. This means that some of your code needs to be majorely re-worked, or even just thrown away and done from scratch.</p>
<p>While you&#8217;re technically working on a user story, you&#8217;re potentially breaking another. It&#8217;s not necessarily spaghetti code, but it&#8217;s certainly not Orgathoganal by the Pragmatic Programmer&#8217;s definition&#8230; unless you&#8217;ve architected that section out already, you&#8217;re a bad ass, or lucky. I&#8217;d argue the 30% is a loose average. In the first sprint, I didn&#8217;t re-factor anything, nor the 2nd week into Sprint #2. In the 2nd and 3rd sprint, I was re-factoring up to 40%. In Sprint #4, it&#8217;ll definitely be at least 40% again. The 40% arose from taking 3 tries to get a piece of functionality the designer wanted correct. The 40% next Sprint accounts for my bitmap caching engine suddenly needing to save not just 1, but types of ValueObjects, and all the existing View&#8217;s that now need to support both. Not to mention the fact we were working with the server-side team for the first time and still figuring things out.  The percentages are not indicative of the entire code-base, but rather, my time spent the entire sprint (2 weeks).  All this while working on new user stories&#8230;</p>
<p>For example, while you originally stated a user story would only be a &#8220;2 &#8211; mostly easy&#8221;, it ended up taking you a total of 5 days to complete because you were re-factoring and fixing other existing user stories that it related to. This can lead to the perception that your original point estimations are inaccurate when in reality, your point estimations are accurate, it&#8217;s just there is no adjustments made for re-factoring. This isn&#8217;t always necessarily taken into consideration when forming a point average for what your team can complete each sprint. Some sprints, you hit your &#8220;20 average&#8221; and another, you only hit 15, but you could have possibility re-factored 7 points worth of existing user stories, thus skewing the results.</p>
<p>Refactoring really confirms how much you wish you could predict the future.  As I&#8217;ve stated before, sometimes it&#8217;s easier to just start from scratch again on a certain component now that you know better how it&#8217;s supposed to work.  The original piece of code may have been really small and not well thought out in the first place for the sake of time.  That&#8217;s totally fine, as the mere fact you&#8217;re deleting it and starting from scratch atests to it being a good decision at the time.  Other times, however, you&#8217;ll notice you&#8217;ll have to do some major changes to a bunch of different classes, of which because not everything is encapsulated, you may suddenly feel like it&#8217;s spaghetti code; changing one thing breaks another, totally unrelated piece.</p>
<p>I will say with ActionScript 3, strong-typing and runtime exceptions have really helped me refactor A LOT faster than in the past.  I can &#8220;break with confidence&#8221;, even if I know my code is crap (it isn&#8217;t, I&#8217;m just going for dramatic effect here&#8230; *ahem*).  This has really helped remove the &#8220;fear&#8221; factor you can get with touching code.  It&#8217;s one thing to have your code build trust with you.  You really thought about its architecture, beat on it some, and it held up.  Cool, your code has built some trust with you.  In coding quickly in Scrum, however, how much trust do you really have when only parts are uber-solid?  Knowing that your code is going into a real world product people are paying for doesn&#8217;t lessen the pressure and stress.</p>
<p>Again, AS3 has really helped me here.  If there is a problem, I&#8217;m more likely to find it now, and find it quickly.  Additionally, KNOWING that fact allows me to, again, code with more confidence, try more ideas, and end up with better code.  Now, you might think you should start coding for every eventuality, at least from assuming errors such as checking for null and isNaN like crazy, but quite the opposite.  A lot of the runtime errors can point out problems pretty quickly, and the catch here is they point them out in both quickly written code AND well architected code.  The point here is that even well architected code will have problems you don&#8217;t forsee.  What I end up doing is using my best guess at the time, using foresight based on our past UAT and other project detail discussions, and moving on with life.  Stressing too much about one section is a waste of time; if it works, rad, move forward.  You may rewrite it again later anyway&#8230;</p>
<p><strong>What Doesn&#8217;t Change and What Does</strong></p>
<p>Experience has really taught me what to code quickly, what to architect well, and all the in betweens.  I haven&#8217;t got it all figured out yet, but I DO know of some sections that usually never change, and ones that change all the time.</p>
<p>The ones that never change are the service layer.  This is your Business Delegates in Cairngorm, or your Remote Proxies in PureMVC (or if you&#8217;re like me, your Business Delegates that your PureMVC proxies call).  If they DO change, it&#8217;s because the server-side developer changed the the name of the service, or the location.  Whoop-pu-dee-doo&#8230; 1 line of code in either the class or your ServiceLocator.  If you&#8217;re delegates/proxies use Factories to actually parse the server&#8217;s returned data (XML, JSON, AMF, etc.) then you&#8217;re even more insulated.  Again, middle tier technology doesn&#8217;t really change in the middle of a project.</p>
<p>A data model change usually affects your entire application.  For example, if you change the data structure of a Person object (PersonVO), suddenly your Factory changes, your VO&#8217;s change, any Controller classes modifying PersonVO&#8217;s (such as Commands in Cairngorm or Proxies in PureMVC, and potentially Commands as well), and any View&#8217;s that represent or edit them.</p>
<p>If you&#8217;re creating complicated View&#8217;s, whether based on a design comp with little detail, or it&#8217;s not a conventional GUI control, it will definitely change over time once someone uses it and gives feedback.  Any View based on a list of dynamic data that needs to draw a bunch of children that represent a ValueObject, such as a repeater or a custom Chart will go through extreme refactoring; both modifications of item renderers and drawing performance improvements if you don&#8217;t extend List and do your own drawing routines.</p>
<p>View&#8217;s such as your main Application file, an optional MainView, a Login, and Menu&#8217;s do not change assuming you use 1 CSS file and straight forward skinning.</p>
<p>Most Event and Utility classes just get added to; you don&#8217;t really change them, rather you add or remove class properties and/or methods, but their names and package structure stay the same.</p>
<p>For Cairngorm Commands, they just grow in scope as the development age of your application increases.  Since PureMVC Commands delegate a lot of this Model modification off to Proxies, those Proxies tend to grow in scope as the complexity of your data interactions increase.  They only get waxed or massively changed if your data model does.  This doesn&#8217;t really happen later in the project.</p>
<p>The above is totally a case by case basis, but has been consistent on a lot of my projects.  Your mileage may, and most likely will, vary.</p>
<p><strong>The Con to Refactoring</strong></p>
<p>There are a few cons to soo much refactoring.  The first is, some clients don&#8217;t understand why you&#8217;re coding the same thing twice&#8230; or more, especially when Scrum is supposed to be about getting it done quickly vs. over-thinking it.  In my experience, if you can speak intelligently at a high level, you can explain each refactoring part away.  I can&#8217;t, so usually explain it to a project manager who&#8217;s capable of translating it in lamens terms to a client.</p>
<p>The second thing is that it makes merging on Merge Day a TON harder.  You may have already refactored like twice the week before, and totally forgotten all the details of why you did.  Suddenly, 4 days later (every other Wednesday in our case), you&#8217;re having an insanely hard time merging code from your branch(es) into trunk.  This may require a long conversation with your team members, and you are struggling to remember why you made such massive code changes.  Even if you do remember, the other developer may feel a little frustrated if you didn&#8217;t invite them into the code refactoring change discussion for something you may at the time have felt was trivial.  It probably was trivial, it&#8217;s just blown out of proportion now since merging is always stressful.  Either that, or you just spend a few hours getting trunk working again.  If I totally wax something, I&#8217;ll usually put a large drawn out code comment to explain why.  Additionally, I&#8217;ll do the same thing in SVN check in comments.</p>
<p>The third thing is it&#8217;s a project manager&#8217;s nightmare.  If she doesn&#8217;t have enough forewarning of these and their possible affect on not getting a single or set of user stories done by the end of the sprint, it can be a bad surprise.  Communicating these during the daily standup meeting with potential ramifications is best.  It can also make planning future sprints challenging as well.  If your team has been chugging along at an average 12 points per sprint for 3 consecutive sprints, and suddenly in sprint #4 you spend 60% of your time refactoring, you&#8217;re clearly going to finish with a lot less points in user stories completed.  This sets the project manager up for failure.  They cannot effectively communicate projected progress to the client, nor visibility into the current progress of the app since something that worked for awhile may suddenly break in the next UAT.  You&#8217;re supposed to be completing user stories, not creating new ones that break old ones.  Again, forewarning is the only thing I know immediately to do.  I&#8217;m not sure what doing too much refactoring is a symptom of yet.  Most so far on my current project, and past ones, have been for random reasons.</p>
<p><strong>Conclusions</strong></p>
<p>I really like how fast I can code some things in Agile.  Other things have stayed the same, but the overriding goal of &#8220;get it working, but don&#8217;t write crap code&#8221; is such a high bar&#8230; and I love it.  It&#8217;s the same speed of agency coding, only you know you&#8217;ll have to live with the code (aka potentially eating your own mess) so you end up producing better code than you would in an agency setting.</p>
<p>I also like either drawing on experience, or just making challenging inferences, on what to architect well, and on other parts to just get something working without too much thought.  It&#8217;s nice to have the variety.</p>
<p>Finally, I&#8217;m not sure what to think of the refactoring.  I like that it&#8217;s &#8220;ok&#8221; and an expected part of the process, but I feel that my project is unique in the amount I&#8217;m personally doing.  My coworker for example isn&#8217;t doing as much as I&#8217;m doing at all; he&#8217;s chugging along on other user stories and is set to beat me, again, in point values for user stories completed at the end of this sprint.  We&#8217;re really pushing the limits of Flash Player here, and only one section in this large app is really this challenging; the rest are your run of the mill Flex screens.  So, it sounds to me like the &#8220;on average 30% of your time is spent refactoring per sprint&#8221; still applies.  There is no way I&#8217;ll be refactoring this much on some of the easier sections in future sprints.</p>
<p>Stay tuned for #3 in the Agile Chronicles series where I talk about every developer using their own Branch in Subversion.</p>
]]></content:encoded>
			<wfw:commentRss>http://jessewarden.com/2008/11/agile-chronicles-2-code-refactoring.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Agile Chronicles #1: Stressful</title>
		<link>http://jessewarden.com/2008/11/agile-chronicles-1-stressful.html</link>
		<comments>http://jessewarden.com/2008/11/agile-chronicles-1-stressful.html#comments</comments>
		<pubDate>Wed, 05 Nov 2008 19:19:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Business Process]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://jessewarden.com/?p=1296</guid>
		<description><![CDATA[The Agile Chronicles is a set of articles documenting my experiences using an Agile process (Scrum) in software development on my current Flex project.

Part 1 &#8211; Stressful
Part 2 &#8211; Code Refactoring
Part 3 &#8211; Branch Workflow
Part 4 &#8211; POC, Strategy, and Design Challenges
Part 5 &#8211; Acceptance Criteria &#38; Punting
Part 6 &#8211; Tools, Extra Merge Day, and [...]]]></description>
			<content:encoded><![CDATA[<p>The Agile Chronicles is a set of articles documenting my experiences using an <a href="http://en.wikipedia.org/wiki/Agile_software_development">Agile</a> process (<a href="http://en.wikipedia.org/wiki/Scrum_(development)">Scrum</a>) in software development on my current Flex project.</p>
<ol>
<li>Part 1 &#8211; Stressful</li>
<li><a href="http://jessewarden.com/2008/11/agile-chronicles-2-code-refactoring.html">Part 2 &#8211; Code Refactoring</a></li>
<li><a href="http://jessewarden.com/2008/11/agile-chronicles-3-branch-workflow.html">Part 3 &#8211; Branch Workflow</a></li>
<li><a href="http://jessewarden.com/2008/11/agile-chronicles-4-p-to-the-oh-to-the-sea-strategy-and-design-challenges.html">Part 4 &#8211; POC, Strategy, and Design Challenges</a></li>
<li><a href="http://jessewarden.com/2008/11/agile-chronicles-5-acceptance-criteria-punting.html">Part 5 &#8211; Acceptance Criteria &amp; Punting</a></li>
<li><a href="http://jessewarden.com/2008/12/agile-chronicles-6-tools-extra-merge-day-and-postponed-transitions.html">Part 6 &#8211; Tools, Extra Merge Day, and Postponed Transitions</a></li>
<li><a href="http://jessewarden.com/2008/12/agile-bugs-unit-testing-throughput.html">Part 7 &#8211; Bugs, Unit Testing, and Throughput</a></li>
<li><a href="http://jessewarden.com/2009/01/agile-chronicles-8-demo-burnout-and-feature-juggling.html">Part 8 &#8211; Demo, Burnout, and Feature Juggling</a></li>
<li><a href="http://jessewarden.com/2009/01/agile-chronicles-9-scope-creep.html">Part 9 &#8211; Scope Creep</a></li>
<li><a href="http://jessewarden.com/2009/04/agile-chronicles-10-conclusions.html">Part 10 &#8211; Conclusions</a></li>
</ol>
<p>This entry is about what processes I came from, my definition of the Agile/Scrum process, and how stress has been spread out throughout the project vs. at the end.</p>
<p><span id="more-1296"></span><a href="#agileasiknowit ">Skip Intro</a></p>
<p><strong>Preface</strong></p>
<p>Five weeks ago, I started a project with <a href="http://enablus.com/">Enablus</a>, a firm that works with mainly startups to build products.  I loathe service work, and love product work, so am really glad to be working with them.  Even better, they are only 30 minutes from my house.  I don&#8217;t really need to go more than 2 to 3 times a week, but I like how close they are when I do.  One thing that struck me in the initial project discussions was that Enablus was really big on process and lingo.  <a href="http://enablus.com/about-us/leadership.html">Darrell Ross</a>, the project manager and partner I&#8217;m working with, although hard to read initially, still showed signs of uneasiness when I didn&#8217;t give him the answers he was wanting to hear in the initial discussions.  For example:</p>
<blockquote><p>&#8220;Do you utilize <a href="http://martinfowler.com/articles/continuousIntegration.html">Continuous Integration</a>?&#8221;</p>
<p>&#8220;Uh&#8230; what the hell is that?&#8221;</p>
<p>&#8220;You know, everyone on the team checking in code into a source control system every day, utilizing Test Driven Development practices, automating your builds, etc.&#8221;</p>
<p>&#8220;Er, I use <a href="http://tortoisesvn.tigris.org/">Tortoise</a> SVN and <a href="http://scootersoftware.com/">BeyondCompare</a> all the time!  Although, most people I work with don&#8217;t check in every day, don&#8217;t use <a href="http://jessewarden.com/wp-admin/Test_driven_development">TDD</a>, and do not automate their builds.&#8221;</p>
<p>&#8220;I see&#8230;&#8221;</p></blockquote>
<p>We&#8217;d constantly go through this.  He&#8217;d ask a serious question like, &#8220;Do you utilize OOP and an software framework(s)?&#8221; and I&#8217;d respond with some cynical response questioning the merits of when OOP and frameworks are applied, or what I did and did not like about a particular framework, and how I don&#8217;t always officially follow their implementations&#8230; never really answering his question and thus not giving him confidence.  I was constantly amazed at how structured Darrell made things sound, and he probably wondering how the hell a positive impression of &#8220;<a href="http://jessewarden.com">Jesse Warden</a>&#8221; was formed in his head in the first place based on the answers I was giving him.</p>
<p>In all instances, we&#8217;d discuss the details of my responses, and he seemed to get the details he needed, feel better, and move on.  Too ease his stress, I opened up and said that I&#8217;ve never really worked in places that were above a <a href="http://en.wikipedia.org/wiki/Capability_Maturity_Model#Levels_of_the_Capability_Maturity_Model">Level 3</a>, and even those I felt never followed the processes he was mentioning, specifically <a href="http://en.wikipedia.org/wiki/Waterfall_model">Waterfall</a> or Agile development, to the letter.  Later in my consulting and contracting career, I had moved to using some concepts of Agile such as <a href="http://en.wikipedia.org/wiki/Iterative_and_incremental_development">iterative</a> development, and having builds of the software regularly on a schedule (usually weekly) even if the client didn&#8217;t need one for weeks or months.  It had nothing but positive ramifications in the long run, so I stuck with what worked and saw other successful people doing similar things.  It&#8217;s really a simple process (my version): Have a build working by Friday, every Friday.</p>
<p>I&#8217;m not sure Darrell believed me that everywhere I&#8217;ve worked, whether full-time or consulting/contracting, did not use a standardize process such as Agile.  Maybe it did and I just wasn&#8217;t privy to the details?  Again, I never cared till this year.  Either way, nothing sounded as strict and defined as Darrell made it sound as he described the Agile process to me.  Hence the point of this series of posts.</p>
<p><strong>Introduction</strong></p>
<p>I&#8217;ve never been interested software development processes.  To me, it&#8217;s always been more important to be really good at the 3 main things that count: knowing your platform, knowing your tools, and knowing the language you code in.  The better you know those 3 things, the more capable you&#8217;ll be at developing software, helping those on your team develop software, and thus ensure your team will be successful.  As Dave Wolfe has said, <a href="http://www.cynergysystems.com/blogs/page/davewolf?entry=it_takes_a_village">it takes a village</a>; a great team can ensure success.  Whether the project actually succeeds isn&#8217;t really up to the software team at that point; hence the second rule to the &#8220;8 of 10 software projects fail&#8221; is &#8220;9 out of 10 are perceived as failures&#8221;.  Even if you create an awesome piece of software, management, stakeholders, and/or clients can still perceive it as failing.</p>
<p>As I&#8217;ve found throughout my career, there have been more pressing issues than &#8220;process&#8221;, such as:</p>
<ul>
<li>getting the dang design comps</li>
<li>making a workflow where fonts will compile on both machines (Mac and PC)</li>
<li>coming to a conesnsus with team members on how the framework you are using should be implemented</li>
<li>finding out what the heck we are building really is</li>
<li>finding out how the heck what we are building really works</li>
<li>resolving source control issues</li>
</ul>
<p>There are tons of other things, but each has the capacity to reach fire drill status, and thus become a major time sink and productivity killer.  As you know, losing time is the LAST thing you want to have happen in software development.</p>
<p>It also depends on the type of work.  Working with Design Agencies, there was no process.  Not because Agencies are dumb, but rather because the project timelines Agencies have are typically significantly shorter than traditional software or product development.  On average, 2 weeks vs. 4 months.  While a deadline can stretch to 4 months, you only work 10 man days on it, and of those 10, 5 are done initially, and the other 5 are done over the course of 2 or 3 months on client changes.  In short, if you have 5 days to complete a complicated coding project, you&#8217;re more focused on getting things done than you are worrying about encapsulation, continuous integration, and frameworks.  Writing code on day 1, and wondering who in the heck has time for <a href="http://en.wikipedia.org/wiki/Unified_Modeling_Language">UML</a> and test cases.  Agencies are deadline driven, whereas in software development, nothing is ever on time.</p>
<p>In consulting, you&#8217;re typically working within the constraints of your client&#8217;s company.  It can go down two different ways.  Either you get treated like a service shop, and requirements are thrown over the wall, and you complete how you see fit.   Otherwise, you integrate with an existing team, and work within their processes, trying to improve them where you can.  Contracting is usually the same way, although, you usually have little to no say in the process.</p>
<p>Even including regular work (W2 at a software shop), all instances can significantly have their chances of success improved through skill.  If you&#8217;re skillful in the aforementioned 3 areas (platform, tools, language), it doesn&#8217;t matter how screwed up things are; you can always depend on skill to make or break a project.</p>
<p>&#8230;or so I thought.  Going back to the 2nd rule of software development, &#8220;9 out of 10 software projects are perceived as failures&#8221;, I started to have more of the second rule happening vs. the first.  In those projects, more of my time would be spent doing non-software things, like pitching a tent in the project manager&#8217;s office, discussing details with stakeholders, drilling sales on what they were really trying to accomplish, etc.  In the end, trying to define success to ensure my team and I weren&#8217;t setup to fail from the beginning.  Being setup to fail, yet having a team with mad skill, results in you months later outside the office smiling on your umpteenth beer regaling all in the pimp architecture you created that never did, nor will, see the light of day.  Creating awesomeness with no result is extremely more frustrating than flat out failing.  The positive to failing is you can learn from it.  Failing, even though technically you succeeded, is just straight ridiculous, and it was at those points I started to become more interested in the software development process.  I realized I needed to find a team who knew all these processes I&#8217;d read about on the internet blogs.</p>
<p>Enablus is one of those teams.  They clearly know Agile, as far as I know it 5 weeks in.</p>
<p><a name="agileasiknowit"></a><strong>Agile As I Know It</strong></p>
<p>I got Darrell to explain how Agile, specifically the Scrum part, works.  This is my paraphrased, and re-interpreted version of our discussions, and my working with the process for a few weeks.  If you have a good idea, do market research to ensure it&#8217;ll sell, then you just need a good team to execute it.  The execution on the software side for product development utilizes an Agile approach.</p>
<p><strong>User Stories</strong></p>
<p>The Agile approach, for the engineer, starts by defining &#8220;User Stories&#8221;.  User stories are a set of sentences that describe what the user experiences while using the software.  These can be derived from the wireframes; design comps aren&#8217;t a requirement.  A user story can be expressed like so:</p>
<blockquote><p>Login: User inputs Username and Password and clicks &#8220;Start Application&#8221;. Login is validated. For all other login instances, the Dashboard is displayed.</p></blockquote>
<p>Notice there is no implied technology or design construction details.  The user story merely describes what the user see&#8217;s, what interactions the do, and what the results of those interactions are.  That same user story could apply to Flash, Silverlight, AJAX, PHP, etc.  It&#8217;s technology agnostic; the point here is to document a user experience to ensure we&#8217;ve captured it well enough to be understood, and thus executed upon.  The same goes for design.  It doesn&#8217;t say &#8220;2 text input fields for username and password, with bold headings to the left, aligned center&#8221;.  It&#8217;s left up to the interpretation of the designer to execute that user story, and hopefully provide direction for the GUI programmer through design comps assuming the user stories were derived from the wireframes, and not the design comps.</p>
<p>Notice also, it&#8217;s not a &#8220;feature&#8221;.  It doesn&#8217;t say, &#8220;The user can login&#8221;.  That leaves things massively open to interpretation, and solves no business value even if the feature is &#8220;completed&#8221;.  As we all know, not all logins are the same.  Documenting features, and executing them is one of the number one ways to be setup to fail, and is also one the main reasons Waterfall doesn&#8217;t work.  If a software spec says, &#8220;The user must be able to log into the system&#8221;, but doesn&#8217;t describe registration, single sign-on, error scenarios, and how it&#8217;s supposed to look, you&#8217;ll end up with software that the client doesn&#8217;t like.</p>
<p>Some user stories are extremely high level.  These are sometimes called meta-stories because they actually encompass a wide array of smaller user stories.  Describing a login scenario can have a multitude of smaller user stories within it such as &#8220;user is presented with an error dialogue stating that they must first activate their account via the confirmation email before gaining access to the entire application&#8217;s feature set&#8221;.  The level of detail only matters in so much as to make sense to the designer and engineer executing it.  If a user story encompasses weeks of coding, it&#8217;s probably a meta-story and should be broken down into more manageable user stories that are easily defined, and more easily tackled in a reasonable time frame.  What&#8217;s reasonable and doable is different for each team.</p>
<p>You create user stories for your entire application.  What does, rather what SHOULD, the user be able to see, do, and experience?</p>
<p><strong>Backlog</strong></p>
<p>These user stories go into a &#8220;Backlog&#8221;.  This backlog is a list of all the user stories, say 50&#8230; or a hundred.  How many user stories you have are irrelevant.  What&#8217;s important is that they are all documented in one place called the Backlog.  You need to ensure all of the user stories are valid with the stake holders.  It also helps to go over them with your entire team to ensure they make sense to everyone involved.</p>
<p>As you move through your project, you may find you&#8217;ll need more user stories to account for things you didn&#8217;t think about, or for additions/modifications to existing user stories.  You then just add them to the back log.  It&#8217;s normal for a backlog to grow during a project life cycle.  However, you do not have to complete the entire backlog to complete the project.  A lot of times, the stakeholders will make a business decision that 40 of the 60 user stories is enough to have a great product, and say &#8220;ship it&#8221;.  That&#8217;s one of the key benefits to Agile is that you have working software throughout the project, and at anytime can make the determination of when it&#8217;s &#8220;done&#8221;&#8230; or is just a version 1.</p>
<p><strong>Point System</strong></p>
<p>Once your done with your backlog, you then have your team go through and assign points to each user story.  To do that, you need a Point System.  A point system is defining a metric for &#8220;how challenging something is&#8221;.  In simple terms, a 1 is easy and a 5 is hard.  It doesn&#8217;t have to be 1 through 5; it could be 1 through 10 or whatever.  It&#8217;s best if they are numeric values because you use the points to measure a variety of statistics about your project.  Additionally, each team may have their own definitions of what is challenging.  While it&#8217;s best to use the same 1-whatever metric for the client and server team, the server team will most likely think creating a new server-side method a &#8220;1-easy&#8221; whereas a client developer a &#8220;5-hard&#8221;.</p>
<p>Once you&#8217;ve defined your point system and gained consensus amongst the team, you then go and assign a point value to each user story.  This in essense gives each user story a &#8220;value&#8221;; how many points a user story worth.  If you have multiple team members working on different parts of the system, say server-side and client side, you then have a point value added to each, such as &#8220;2 &#8211; mostly easy&#8221; for the server-side portion and &#8220;3 &#8211; doable&#8221; for the client side portion.  The combined value gives the value of the user story, in this case 5.</p>
<p>From these point values, the project manager can then go back to the client, and ask, &#8220;With 20 points, what features do you wish to have completed in the first Sprint?&#8221;</p>
<p>The client can &#8220;purchase&#8221; user stories using those 20 points.  A Sprint, which I elaborate on below, is an uninteruppted time period in which your team works on completing their assigned user stories.  You make a guess in Sprint #1 on how many points your team can complete per Sprint.  As time goes on, you start to see a pattern emerge of how many points per Sprint is the team completing.  The client and managers can use this metric for planning and resource purposes.  You can forecast, somewhat, how many Sprints you have to do to complete 60 points worth of features, and when you&#8217;ll have them completed.  The chosen user stories that the client purchased are what your team is working on in Sprint #1.</p>
<p>Assigning points is a very important step for the engineering team.  You typically don&#8217;t change point values mid-project, only assinging points to modified user stories or new user stories.</p>
<p><strong>Sprints</strong></p>
<p>As I mentioned, Sprints are a period of time that your team works on their assigned user stories.  A sprint is however long your team decides it should be to get a working build with the user stories assigned.  This could be one week, two, or a month.  My current team is using 2 week cycles.  It&#8217;s important to note the &#8220;uniteruppted&#8221; part.  The client and project manager won&#8217;t interject user stories mid-sprint, nor modify your work load.  Basically, they don&#8217;t bother you.  This allows your team to focus on the task at hand, prevent fire drills, and stay productive.</p>
<p>In the examples provided, your team has 2 weeks to complete 20 points worth of user stories.  Now, a sprint isn&#8217;t just, say 10 days of straight working.  You usually have 3 special days.  The first day is the kick off.  You determine the user stories you and your team members will tackle.  A couple days before the last is your &#8220;merge day&#8221;.  It&#8217;s when everyone merges the code together from their different branches (or you just make sure trunk works if not using branches, more on that later) to get an idea of where the build is at, and where your team is at with their user stories.  This is a final checkpoint before&#8230;. the UAT.  UAT stands for user acceptance testing and in this case, it&#8217;s going over the final working build.  Your team collectively goes over each user story, and identify if the build satisfies the user story or not.</p>
<p>As I said, our sprints are 2 weeks in length.  The first Monday is spent confirming what user stories are in the current sprint and who&#8217;s working on them.  We try to work in our own personal branches so the 2nd Wednesday is &#8220;Merge Day&#8221;, where I take any branches I and my teammate have, merge into trunk, and work out the kinks.  We make a mad dash the rest of Wednesday and all of Thursday to finish our remaining user stories, or fix issues with existing ones, or just the build in general.  Again, over the course of a sprint, you can start to get a group average of how many points your team is capable of doing in a sprint.</p>
<p>We&#8217;ve been using a shared <a href="http://docs.google.com">Google Spreadsheet</a> with each Sprint&#8217;s user stories in its own tab.  We collaboratively use this all the time for reference.</p>
<p><strong>Daily Standup</strong></p>
<p>We have a call everyday at 1 pm EST / 10 am PST.  Our server-side time + client is out west in Cali, and our Flex team + UX + designer + project manager + rest of the team for other areas is east in Atlanta.  We each go around talking about what we completed yesterday, this morning, and what we plan on going the rest of the day.  We also cite any roadblocks or issues, and if that involves another team member, we just schedule a separate call, or time to talk over IM, with that specific person.  This results in our calls usually lasting 5 minutes each day.  I&#8217;ve heard of other projects at Enablus having their daily standup lasting longer than 5 minutes, but our team is pretty focused; we know what we need to do.</p>
<p>The majority of my road blocks involve a web service not working like expected suddenly, or questions for the designer on how a part of the design comp is supposed to work.  Most of these I just solve on my own by calling the team member outside of the meeting time.</p>
<p><strong>Pro&#8217;s &amp; Con&#8217;s</strong></p>
<p>There you have it, what Agile is based on what I&#8217;ve been told and experienced so far.  So how&#8217;s it working out so far?  Here are the pro&#8217;s and con&#8217;s for this first entry in the series.  I&#8217;ll elaborate in future articles, but here&#8217;s the quick rundown.</p>
<p><strong>Pro&#8217;s</strong></p>
<ul>
<li>I&#8217;ve never been this stressed in the first two weeks of a project before.</li>
<li>coding with a &#8220;git-r-done&#8221; mentality; fast and furious.  Not everything has to be uber-architected.</li>
<li>each developer has their own branches; this makes checkins &amp; merges a lot easier and less stressful</li>
<li>It&#8217;s nice to have something real after just 2 weeks.  Gives a great feeling of validation very quickly</li>
</ul>
<p><strong>Cons</strong></p>
<ul>
<li>a lot of re-factoring</li>
<li>creating new user stories later can break older ones</li>
<li>merge day is stressful</li>
<li>&#8220;need to see it working&#8221;; the desire to see working functionality before important functionality decisions can be made isn&#8217;t solved</li>
</ul>
<p><strong>Conclusions</strong></p>
<p>In conclusion, I really like Agile methodology that we&#8217;re using so far as it allows me to code some things extremely fast and not have to worry about uber-architecting it.  I just have to get it working which I&#8217;m good at doing quickly.  For the things that matter, I can spend an allocated time which I feel good about doing because I can more easily see over time which areas deserve architecture and which ones do not.  The merge day is extremely stressful, but overall I like having an allocated day for it and using separate branches which prevent daily SVN drama.</p>
<p>I&#8217;ve never been this stressed in the first two weeks of a project before. The typical scenario is you get excited, and can&#8217;t wait to dive in. It&#8217;s a happy feeling filled with anticipation. Then, as the deadline approaches, you steadily get stressed out and things become less fun, albeit extremely frustrating. This isn&#8217;t always the case, but I&#8217;ve continually expected fun in the beginning, stress at the end.</p>
<p>It&#8217;s been really nice to be stressed at the beginning; this has implied to me the project won&#8217;t be so traditionally bipolar. The same thing happened to my mood once I capped myself at 2 cups of coffee a day. Think of it, you have 2 weeks to create working software; ready, GO! That&#8217;s insane, and really cool at the same time. What could you do in 2 weeks? It&#8217;s really nice to know that even after just 2 weeks of work on a 4 month (ish) long project, even the first 2 weeks will produce something valid and working.</p>
<p>Stay tuned for #2 in the Agile Chronicles series where I elaborate on the re-factoring challenges.</p>
]]></content:encoded>
			<wfw:commentRss>http://jessewarden.com/2008/11/agile-chronicles-1-stressful.html/feed</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
	</channel>
</rss>
