<?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"
	>

<channel>
	<title>Small man, big mouth</title>
	<atom:link href="http://www.totalworldannihilation.org/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.totalworldannihilation.org/blog</link>
	<description>All about software development</description>
	<pubDate>Fri, 25 Jul 2008 09:57:39 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>Simplifying form validation and processing in Flex</title>
		<link>http://www.totalworldannihilation.org/blog/2008/07/23/simplifying-form-validation-and-processing/</link>
		<comments>http://www.totalworldannihilation.org/blog/2008/07/23/simplifying-form-validation-and-processing/#comments</comments>
		<pubDate>Wed, 23 Jul 2008 07:41:35 +0000</pubDate>
		<dc:creator>leftieFriele</dc:creator>
		
		<category><![CDATA[Flex]]></category>

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

		<category><![CDATA[form processing]]></category>

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

		<guid isPermaLink="false">http://www.totalworldannihilation.org/blog/?p=66</guid>
		<description><![CDATA[One of the most common tasks you perform when writing an application is code related to validating user input and collecting user input. This is also the case for applications written in Flex and having a simple way of doing this would save both time and money. In my new job working for Open AdExchange [...]]]></description>
			<content:encoded><![CDATA[<p>One of the most common tasks you perform when writing an application is code related to validating user input and collecting user input. This is also the case for applications written in Flex and having a simple way of doing this would save both time and money. In my new job working for <a href="http://openadex.com" target="_new">Open AdExchange</a> I looking at possible solutions to this very common task. Adobe has an article by <a href="http://aralbalkan.com/" target="_blank">Aral Balkan</a> called <a href="http://www.adobe.com/devnet/flex/quickstart/validating_data/" target="_blank">Handling Data</a> which covers basic validation of a form in Flex. This example serves as a good sample of simple validation, but it is not perfect and it does not cover collection of the form data.</p>
<h2>The Goal</h2>
<p>The goal of this article is to improve upon the code from Aral&#8217;s article with generic form handling and automatic collection of form data. This is one way of going about this problem and there are many other ways to do it which probably just as good for your use.</p>
<p>A secondary goal is to make the solution as simple as possible and make it really simple to use in most kinds of applications. Just having two or three lines of code to make it all work perfectly.</p>
<h2>The Design</h2>
<p>The design consists mainly of two interfaces called <em>FormHelper</em> , <em>FormHelpEnabled</em> and an implementation class <em>FormHelperImpl</em>.<br />
<a href="http://www.totalworldannihilation.org/blog/wp-content/uploads/2008/07/formhelper1.png"><img class="alignnone size-thumbnail wp-image-68" title="FormHelper version 2" src="http://www.totalworldannihilation.org/blog/wp-content/uploads/2008/07/formhelper1-150x150.png" alt="" width="150" height="150" /></a></p>
<p>The <em>FormHelper</em> interface extends the IEventDispatcher interface because the implementation classes needs to dispatch events notifying about changes in validation status and sending. The implementation class dispatches a FormEvent, which extends <em>flash.events.Event</em>, when a form is validated and all the data is collected. Listening for a FormEvent.SEND event you can retrieve a <em>typed object</em> containing the form data.</p>
<p>In order to make data collection easy the <em>FormHelper</em> uses a <em>convetion</em> in the way you name your input controls inside your Form. By having a naming convention the implementation class uses the field names in the <em>targetClass</em> property and looks first for a <em>FormItem </em>with the ID on the form <em>&lt;Field name in class&gt;Field</em> and a an input control called <em>&lt;Field name in class&gt;Input</em>. You can of course change this convention to just rely on the input control if you like.<br />
Using this convention the implemention class of <em>FormHelper</em> is capable of returning a typed object with the form data. Have a look at the source code (see the link below) to learn more about the details of the implementation.</p>
<p><strong>UPDATE (25.07.2008):</strong> My friend <a href="http://www.borrewessel.com" target="_blank">BÃ¸rre Wessel</a> pointed out something which makes a lot of sense and that was the tight coupling between the view component and the validators.Â  This was beyond my simple scope which was simple validation and data collection. However his point makes perfect sense and I have update the sample code with a new class <em>VOFormHelper</em> which extends the <em>FormHelperImpl</em> class by adding a mapping array which uses the field names of the configured target class as key to store a validator class.<br />
This is all configured in the main application and removes the tight coupling between the form component and the validation logic. The same approach can be performed to <a href="http://www.adobe.com/devnet/flex/quickstart/formatting_data/" target="_blank">format data</a>.<br />
Have a look at the sample source code to see how this is done.</p>
<h2>The Sample</h2>
<p>Here is a simple demonstration application which shows how to make use of these classes to provide your application with form validation and processing. The sample consists of two input forms and they are there to collect information about a user and some address data. Both input components implement the <em>FormHelpEnabled</em> interface:</p>
<pre><code>public interface FormHelpEnabled {
  function set formHelper(f:FormHelper):void;
  function get formControl():Form;
}</code></pre>
<p>This enables the main application to compose the input components with a <em>FormHelper</em> to do validation and data collection.<br />
Using the two SASO&#8217;s (Simple ActionScript Objects) Address and User the sample just needs to setup two <em>FormHelperImpl</em> instances and add an event listener to retrieve the form data.</p>
<pre><code>formhelper = new FormHelperImpl(FormHelpEnabled(regForm), User);
formhelper.addEventListener(FormEvent.SEND, function(fe:FormEvent):void {
  if (fe.resultObject is User) {
    var u:User = User(fe.resultObject);
    Alert.show("Form data:\n" + ObjectUtil.toString(u));
  }
});
regForm.formHelper = formhelper;
.....
&lt;mx:TabNavigator height="350" width="600"&gt;
  &lt;local:RegistrationForm2 id="regForm"
	label="User information"/&gt;
  &lt;local:RegistrationForm id="regForm2"
	label="Address information"
	creationComplete="initAddress()"/&gt;
&lt;/mx:TabNavigator&gt;
</code></pre>
<p><script src="/code/swfobject/swfobject.js" type="text/javascript"></script><br />
 <script type="text/javascript"><!--
var flashvars = {};
var params = {};
var attributes = {};
attributes.id = "cntent";
attributes.name ="FormHandlingPoc";
swfobject.embedSWF("/code/formhandler/FormHandlingPoc.swf", "cntnt", "500", "398", "9.0.0", "expressInstall.swf", flashvars, params, attributes);
// --></script></p>
<div id="cntnt"></div>
<p><a href="http://www.totalworldannihilation.org/code/formhandler/" target="_blank">View the sample in new window</a><br />
<a href="http://www.totalworldannihilation.org/code/formhandler/srcview/index.html" target="_blank">View the source code</a></p>
<p>The design of these classes are not necessarily what you need for you application and you are free to use the code in any way you see fit. Just let me know and I can post an update here on the blog.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.totalworldannihilation.org/blog/2008/07/23/simplifying-form-validation-and-processing/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Policy based security in Flex - part II</title>
		<link>http://www.totalworldannihilation.org/blog/2008/07/10/policy-based-security-in-flex2/</link>
		<comments>http://www.totalworldannihilation.org/blog/2008/07/10/policy-based-security-in-flex2/#comments</comments>
		<pubDate>Thu, 10 Jul 2008 18:39:06 +0000</pubDate>
		<dc:creator>leftieFriele</dc:creator>
		
		<category><![CDATA[Flex]]></category>

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

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

		<category><![CDATA[how-to]]></category>

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

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

		<guid isPermaLink="false">http://www.totalworldannihilation.org/blog/?p=61</guid>
		<description><![CDATA[Since writing my first article about Implementing Policy Based Security In Action Script 3 I have had the opportunity to create a live demo with source code available for viewing/downloading. This is to give you a better notion of how implementing policy based security for user interface components can make sense. No more of those [...]]]></description>
			<content:encoded><![CDATA[<p>Since writing my first article about <a href="http://www.totalworldannihilation.org/blog/2008/03/09/implementing-policies-using-reflection-is-action-script-3/">Implementing Policy Based Security In Action Script 3</a> I have had the opportunity to create a live demo with source code available for viewing/downloading. This is to give you a better notion of how implementing policy based security for user interface components can make sense. No more of those monster <em>data binding</em> expressions which determine whether a user has access or not.</p>
<p>Having this kind of logic seperated into <em>Simple ActionScript Objects</em>, <strong>SASO</strong>&#8217;s, (I&#8217;m sorry I could not resist to reuse the <a href="http://en.wikipedia.org/wiki/POJO" target="_blank">POJO</a> catch phrase) which are simple to both understand and unit test. Unit testing and indeed understanding complex binding expressions or functions inline in MXML-code is hard when your application grows. Therefor making this kind of separation makes perfect sense.</p>
<p>In my <a href="http://www.totalworldannihilation.org/blog/2008/03/09/implementing-policies-using-reflection-is-action-script-3/">previous posting</a> I outlined how you could have stand alone classes for handling security. However the posting did not include a running sample as to how you would best implement the principles outlined. This posting comes with a more detailed description and a running sample with source code.</p>
<h2>The Design</h2>
<p>The implementation of the policy based security consists of three interfaces and an implementation class. Security policies are created in stand alone classes which are easily unit tested and gives you better control of what policies applies to performing certain operations in your applications.</p>
<p><a href="http://www.totalworldannihilation.org/blog/wp-content/uploads/2008/07/policybasedsecurity2.png"><img class="alignleft size-thumbnail wp-image-65" title="policy based security" src="http://www.totalworldannihilation.org/blog/wp-content/uploads/2008/07/policybasedsecurity2-150x150.png" alt="" width="150" height="150" /></a><br />
The <em>Policy</em> interface has one method <em>apply</em>, which takes a criteria as parameter. Classes implementing this interface can be set on a class implementing the <em>PolicyHandler</em> interface.Â  In the policy handler class all the &#8220;magic&#8221; happens. Based on the composed <em>criteria</em>, <em>policies</em> and <em>targets</em>.</p>
<p>Ease of use is important when writing library style components and the policy handler is design with this in mind.Â  All you need to do in your application is to instanciate a policy handler class and then configure it with the required properties. Thanks to Flex&#8217;s data binding features the policies get applied whenever the criteria changes.</p>
<h2>Using the policy handler</h2>
<p>The implementation class, <em>PolicyHanlderImpl</em> of the <em>PolicyHandler</em> interface does all the heavy lifting and all you need to do is to pass it a callback function which gets called with the result of all the applied policies. In your callback method you can do make components appear/dissapear or enable/disable depending on the policy result.</p>
<pre><code>public function applyToTargets(policyApplies:Boolean):void {
  componentA.visible = componentA.includeInLayout = b;
}
...
&lt;policyHandlers:PolicyHandlerImpl id="handler"
	policies="{[AdminWidgetAccessPolicy]}"
	criteria="{currentUser}"
	callback="{applyToTargets}"
	/&gt;
</code></pre>
<h2>The Sample</h2>
<p>In order to make it a bit easier to review this way of securing access to parts of your application I have created a really horrible looking sample (can&#8217;t have a security sample which looks nice, that just does not seem secure enough) which shows the design in practice.</p>
<p>Pressing the button in the sample makes you change the current user between <em>user A</em> and <em>user B</em>. The policy in the sample ensures that only users with the role administrator sees the admin widgets.Â  When looking at the source code, do not pay much attention to the lack of comments and nice coding. This is a quick and dirty sample code, not a best practice type sample.<br />
<script type="text/javascript" src="/code/swfobject/swfobject.js"></script><br />
<script type="text/javascript">
var flashvars = {};
var params = {};
var attributes = {};
attributes.id = "cntent";
attributes.name ="PolicyHanlder";
swfobject.embedSWF("/code/policysecurity/main.swf", "cntnt", "500", "280", "9.0.0", "expressInstall.swf", flashvars, params, attributes);
</script></p>
<div id="cntnt">
<p>In order to view this sample you must install the Adobe Flash Player.</p>
<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
</div>
<p><a href="http://www.totalworldannihilation.org/code/policysecurity/" target="_blank">View the sample in new window</a><br />
<a href="http://www.totalworldannihilation.org/code/policysecurity/srcview/index.html" target="_blank">View the source code</a></p>
<p>I appreciate all questions/comments, whether you think this is terrible or brilliant, just leave them over on the right.</p>
<p>UPDATE: Last night I detected an obvious flaw in my design, originally I had an abstract class which you had to extend in order to implement a new policy handler. In order to make using this design even easier I decided to have the <em>PolicyHandler/<em> have a new method for setting a callback function which gets called after application of all the policies.</em></em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.totalworldannihilation.org/blog/2008/07/10/policy-based-security-in-flex2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Test dirving user interface development</title>
		<link>http://www.totalworldannihilation.org/blog/2008/06/27/test-dirving-user-interface-development/</link>
		<comments>http://www.totalworldannihilation.org/blog/2008/06/27/test-dirving-user-interface-development/#comments</comments>
		<pubDate>Fri, 27 Jun 2008 11:04:45 +0000</pubDate>
		<dc:creator>leftieFriele</dc:creator>
		
		<category><![CDATA[work]]></category>

		<category><![CDATA[interface development]]></category>

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

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

		<category><![CDATA[test driven development]]></category>

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

		<category><![CDATA[user interface]]></category>

		<guid isPermaLink="false">http://www.totalworldannihilation.org/blog/?p=59</guid>
		<description><![CDATA[The other day I read an interesting posting on the Object Mentor blog called Observations on Test-Driving User Interfaces by Dean Wampler. He makes quite a few good points as to why applying TDD to rich internett application user interfaces is very hard. There are two reasons why TDD is not being performed when building [...]]]></description>
			<content:encoded><![CDATA[<p>The other day I read an interesting posting on the Object Mentor blog called <a href="http://blog.objectmentor.com/articles/2008/06/22/observations-on-test-driving-user-interfaces" target="_blank">Observations on Test-Driving User Interfaces</a> by Dean Wampler. He makes quite a few good points as to why applying TDD to rich internett application user interfaces is very hard. There are two reasons why TDD is not being performed when building user interfaces:</p>
<ul>
<li>a wrong perspecktive on the purpose of testing</li>
<li>lack of good tool support with the correct perspecktive on testing</li>
</ul>
<h2>The purpose of testing</h2>
<p>Most developers and test tool makers have a perspective of testing as an exercise where the object is to <span style="text-decoration: underline;">find</span> defects. This is a perspective on things which led us to where we where a couple of years ago. With the introduction og eXtreme Programming and agile methods the perspective developers had on testing changed. Testing became an exercise which purpose was to <span style="text-decoration: underline;">prevent</span> defects from entering your code base.</p>
<p>Testing as a way of preventing defects is a view shared by Lean Software Development and Mary Popendieck goes into details about this in her book <a href="http://www.amazon.com/Implementing-Lean-Software-Development-Addison-Wesley/dp/0321437381" target="_blank">Implementing Lean Software Development: From Concept To Cash</a>. If you fail to convince your developers that this is the purpose of testing, I think you are going to fail at successfully working test driven. Testing to prevent defects is something which comes natural for interface developers as we have always been forced to continuously test our applications in numerous browsers while writing code. If this comes natural, how come test driven interface development is so hard?</p>
<h2>The Tools</h2>
<p>I agree with some of Dean Wampler&#8217;s points and I do think that lack of good tools might be part of the reason why test driving user interface development is hard. However I think the reason why the tool are inadequate is that they are created by people who don&#8217;t know enough or care enough about their target audience (to all of you who have written tools I apologize, but this is what it looks like from my point of view. If you are offended, just let me know and we can settle it off line). The tools for testing user interfaces tend to be intrusive, expensive and just too complicated to use.</p>
<p>Monster tools like <a href="https://h10078.www1.hp.com/cda/hpms/display/main/hpms_content.jsp?zn=bto&amp;cp=1-11-127-24^1352_4000_100__" target="_blank">Quick Test Pro</a> are so complex (just installing this monster is a pain) that they exclude some users. Not to mention the ridiculous price tag on this software. However these things aside the tool itself is just not good enough to make it worth while for the people actually implementing the user interface. They do not want a tool where you write some code in some macro- or script language. They do not want a 3 GB tool to install with a limited number of licenses.</p>
<p>What they do want is a simple, free and easy tool to help them work faster and with better quality. A testing tool which not only helps in <span style="text-decoration: underline;">finding</span> defects, but a tool which <span style="text-decoration: underline;">prevent</span> defects from entering their code. A tool which is none intrusive and can be used while writing code.</p>
<p>This is where most tools get it wrong too. They are tools created to finding defects and errors in an application. Usually you record a test script and then run that script later on in order to find defects. What these kinds of tools fails to do is to give developers a way of working which prevent defects from entering their application.</p>
<h2>One shining star</h2>
<p>During my time as an interface developer I have only found one tool which actually allow you to work Test Driven and which enables the developer to work with <span style="text-decoration: underline;">preventing</span> defects. The tool in question in is the free tool <a href="http://selenium.openqa.org/" target="_blank">Selenium</a>.</p>
<p>What makes <a href="http://selenium.openqa.org/" target="_blank">Selenium</a> so great is that it through it&#8217;s <a href="http://selenium.openqa.org/index.html#Selenium_IDE" target="_blank">Selenium IDE</a> provides developers with an actual tool which enables you to work test driven. By using the default view you can easily create simple test fixtures up front before coding and then run the test until the test passes. The Selenium IDE is a Firefox add on and hence fits naturaly into a user interface developers portfolio of tools. It&#8217;s small, portable and available on all platforms.</p>
<h2>The way forward</h2>
<p>I think the future for test driven interface development is very promising. Iterating and continuously testing is something which is in the blood of all experienced interface developers and I am certain that tool vendors will be capable of building tools which encourage test driven interface development.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.totalworldannihilation.org/blog/2008/06/27/test-dirving-user-interface-development/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The same small man. The same big mouth, but in a different tounge</title>
		<link>http://www.totalworldannihilation.org/blog/2008/06/13/the-same-small-man-the-same-big-mouth-but-in-a-different-tounge/</link>
		<comments>http://www.totalworldannihilation.org/blog/2008/06/13/the-same-small-man-the-same-big-mouth-but-in-a-different-tounge/#comments</comments>
		<pubDate>Fri, 13 Jun 2008 07:04:12 +0000</pubDate>
		<dc:creator>leftieFriele</dc:creator>
		
		<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://www.totalworldannihilation.org/blog/?p=56</guid>
		<description><![CDATA[If you&#8217;ve read anything on this blog you would probably have noticed that Enligh is not my native language. This is why I have always had two blogs in order not to have a confusing mix of English and Norwegian content on my blog. My Norwegian blog has been unavailable for some time due to [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve read anything on this blog you would probably have noticed that Enligh is not my native language. This is why I have always had two blogs in order not to have a confusing mix of English and Norwegian content on my blog. My Norwegian blog has been unavailable for some time due to the <a href="http://www.dallokken.com" target="_blank">dallokken.com</a> domain switching hosting provider to <a href="http://mediatemple.net" target="_blank">Media Temple</a>, but it is finally back on line. It does not have a lot of new content on it unfortunately, but I am working on that and I will publish some things there. It will be a blog which is a bit more local to Oslo, Norway and most of the topics will be related to the Norwegian marketplace.</p>
<p>Those of you who speak Norwegian can enjoy my blog <a href="http://dallokken.com/espen/2008/06/en-ny-star/" target="_self">&#8220;her er mitt arbeid&#8221;</a> and for those of you who do not speak Norwegian you can check out the <a href="http://translate.google.com/translate?u=http%3A%2F%2Fdallokken.com%2Fespen%2F&amp;hl=en&amp;ie=UTF8&amp;sl=no&amp;tl=en" target="_blank">Google translation</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.totalworldannihilation.org/blog/2008/06/13/the-same-small-man-the-same-big-mouth-but-in-a-different-tounge/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Unit-testing and how little things have changed</title>
		<link>http://www.totalworldannihilation.org/blog/2008/06/12/unit-testing-and-changed/</link>
		<comments>http://www.totalworldannihilation.org/blog/2008/06/12/unit-testing-and-changed/#comments</comments>
		<pubDate>Thu, 12 Jun 2008 14:51:34 +0000</pubDate>
		<dc:creator>leftieFriele</dc:creator>
		
		<category><![CDATA[work]]></category>

		<category><![CDATA[code complete]]></category>

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

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

		<category><![CDATA[unit testing]]></category>

		<guid isPermaLink="false">http://www.totalworldannihilation.org/blog/?p=45</guid>
		<description><![CDATA[This is actually a very old article which I wrote back in December 2006 over on my Norwegian blog. In an attempt to make that blog a bit less schizophrenic I thought I would move the English content over here. While looking at some of the old posts I think this one actually is quite [...]]]></description>
			<content:encoded><![CDATA[<p>This is actually a very old article which I wrote back in December 2006 over on my <a href="http://dallokken.com/espen/">Norwegian blog.</a> In an attempt to make that blog a bit less schizophrenic I thought I would move the English content over here. While looking at some of the old posts I think this one actually is quite good and I actually agree with my earlier statements from 2006 (which is quite unusual for me). Without further nonsense I here by present the old posting entitled:</p>
<h2>Why Unit-testing has &#8220;nothing&#8221; to do with testing</h2>
<p>I do not claim to be the master of testdriven developmen, but I have used a testdrvien approach for about two years now. What I have come to realize is that, for me as a programmer, my unit-tests are not most valueable as a way of testing.<br />
Sound stoopid, right? Hold on! Do not stop reading, theres an explaination to this somewhat bizzare statement. What I mean is that my unit-tests help me in a lot of other ways which are actulay more benefical for me as a programmer.</p>
<h2>New approach to an old technique</h2>
<p>A few years ago I read the first edition of &#8220;Code Complete&#8221;, which is a great book. I picked up a few tips which helped me improve my speed and accuracy while coding. One of the things was first document what the method should do before the signature, and then &#8220;code&#8221; the method by writing comments for what you want it to do. By doing this you can more easily see if what you wrote in the method body corresponds to the documentation in the header for the method. You will notice if you need to refactor you method and you can detect logic errors before writing a single line of code. I found this technique to be very useful and it helped me improve the quality of the code and I produced fewer errors in my code.</p>
<p>Unit-testing introduced a more extreme approach which is somewhat simular. Testdriven development evangelists says &#8220;You must write you tests first&#8221;. This is a new spin to the method mentioned in &#8220;Code Complete&#8221; by Steve McConnel. By writing the test first you can see if your component meet the requirements, and you will also be able to detect design errors early. In addition you will also write better code for the actual method since it will only meet the requirements in the unit-test.<br />
If you are not writing your tests first, you might as well just skip writing unit-tests. They will pretty much just test that the code you wrote runs, not if your component actualy does what it is supposed to. But, this topic has pretty much been covered by other people so I will leave it at that.<br />
To recap: writing tests first helps me trap design and requirements errors early and improves code quality.</p>
<h2>Having the courage to implement change</h2>
<p>Refactoring is a word that some people love, and some people think is just a word used by consultants to make money off of their mistakes. Either way, we all know that we somewhere down the line will have to change our code. Nobody writes perfect code that never needs change, that is just a fact.<br />
When the time comes for your component to change, what do you do?<br />
Do you start to sweat and suddenly develop a spiritual conciousness, or do you smile and see this as an opportunity to make the changes you have been dying to do for some time? If you have been a good boy or girl and written your unit-tests you will be in the latter category. This is one of the reasons why I have come to embrace unit-testing. It gives me the confidence to perform required changes. My unit-tests gives me the sound foundation to perform every required change in my application. No more prayers like, &#8220;please please let this change be a good one&#8221; to the allmight &#8220;Runtime God&#8221;.</p>
<h2>Going fast by never going back</h2>
<p>I have seen people estimating more hours because they are doing unit-testing. This is in my opinion dead wrong. This would be equivalent of saying &#8220;I will use the IntelliJ debugger, and that will take me 4 hours&#8221;. Writing unit-tests should be a natural part of the craft of writing code, therefor it makes no sense to add hours to a budget &#8220;because we are gonna unit-test&#8221;.<br />
By applying unit-tests in the way I have discussed earlier you will never use mour hours by adding unit-tests. That is because you will detect errors and trap design flaws earlier when writing tests up-front. You might spend an hour our two writing the tests, but you will also spend less time debugging your component. In other word you will go fast, by writing better code that you will not have to back and debug.<br />
Again, this is actualy nothing new. Writing tests first is just a new spin to an old software developement &#8220;truth&#8221;: you will go faster by trapping errors early.</p>
<h2>Summary</h2>
<p>Unit-testing has more to do with writing code than testing in a traditional way. I see unit-testing as a tool for:</p>
<ul>
<li>Trapping errors in code and design early</li>
<li>A safetynet when improving application designs by refactoring</li>
<li>Better understanding of the problem domain at an earlier stage in the development process</li>
</ul>
<h2>2008 Update</h2>
<p>Having lived and learned a little more over the past two years I think an update is required to what I wrote back when. Testing has another very important purpose which I did not see as clearly then. Which is that tests, if written in a good way, also acts as the best possible documentation about your problem domain and application. Allistar Cockburn mentions in his excellent book <a href="http://www.amazon.com/Agile-Software-Development-Cooperative-Game/dp/0321482751" target="_blank">Agile Software Development: The Cooperative Game</a> something that was originally written by XXX back in YYY about how documentation of projects is really difficult and the most important things are never put on paper. The most important thing is the &#8220;mental model&#8221; of those who developed the system. Without a knowledge of that model you will have a hard time taking over an existing project or adding new features to it.</p>
<p>I whole heartedly agree with this point and I think one of the places the model of the developers could be exposed is in the tests. By building a decent test harness you document how you want the system to work and you in turn expose some of the things you had to do when creating the application.<br />
One example is lets say you had a bug which made you have to change your architecture a bit. Following the practice of TDD you would first write a test for this and in the documentation for the test method you would write a small entry about what this test does. Then you would make the architectural change until the test passes. This would expose to people coming in later reading your test code what the reasons for the test and what it solved.</p>
<p>Besides the fact that tests help document the mental model of the developers I think I would not change much in the original article.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.totalworldannihilation.org/blog/2008/06/12/unit-testing-and-changed/feed/</wfw:commentRss>
		</item>
		<item>
		<title>throw new RuntimeException(&#8221;Blog post blog post&#8221;);</title>
		<link>http://www.totalworldannihilation.org/blog/2008/06/11/throw-new-runtimeexceptionblog-post-blog-post/</link>
		<comments>http://www.totalworldannihilation.org/blog/2008/06/11/throw-new-runtimeexceptionblog-post-blog-post/#comments</comments>
		<pubDate>Wed, 11 Jun 2008 06:36:17 +0000</pubDate>
		<dc:creator>leftieFriele</dc:creator>
		
		<category><![CDATA[Flex]]></category>

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

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

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

		<guid isPermaLink="false">http://www.totalworldannihilation.org/blog/?p=55</guid>
		<description><![CDATA[I don&#8217;t usually write about other people&#8217;s articles or write blog posts saying &#8220;read this great article&#8221;, but now I do. Read this great article called &#8220;ActionScript Collections and Functional Programming&#8221; by Bruce Eckel. It dives into details about, well you guessed it, collections and functional programming and how it relates to Action Script. Having [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t usually write about other people&#8217;s articles or write blog posts saying &#8220;read this great article&#8221;, but now I do. Read this great article called <a href="http://www.artima.com/weblogs/viewpost.jsp?thread=230610"><em>&#8220;<span class="ts">ActionScript Collections and Functional Programming&#8221;</span></em></a><span class="ts"> by Bruce Eckel. It dives into details about, well you guessed it, collections and functional programming and how it relates to Action Script. Having done a bit of AS coding in the past few months I greatly appreciate this article as it dives into details about an essential part of any programming language, lists. </span></p>
<p>When you write code you are using collections of items probably without giving it much thought. This is why I think this article is great because it makes you think about how small things in something as simple as collections can have a big impact on your code. When working with Flex the small things do have a tendency to get forgotten while working with monster components like the <em>DataGrid</em> or by wresteling with frameworks such as <em>Cairngorm</em>. While we get caught up in all the hassel with these larger parts of Flex the small things tends to be forgotten and as a result we get more problems. I&#8217;d like to thank Mr Eckel for writing this article and reminding me that the little things do actually count and now I can not wait to get started on one of the latest books I purchased: <a href="http://www.amazon.com/Beautiful-Code-Leading-Programmers-Practice/dp/0596510047" target="_blank">Beautiful Code</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.totalworldannihilation.org/blog/2008/06/11/throw-new-runtimeexceptionblog-post-blog-post/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Reducing waste with poll based project communication</title>
		<link>http://www.totalworldannihilation.org/blog/2008/05/05/reducing-waste-with-poll-based-project-communication/</link>
		<comments>http://www.totalworldannihilation.org/blog/2008/05/05/reducing-waste-with-poll-based-project-communication/#comments</comments>
		<pubDate>Mon, 05 May 2008 11:59:56 +0000</pubDate>
		<dc:creator>leftieFriele</dc:creator>
		
		<category><![CDATA[work]]></category>

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

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

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

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

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

		<category><![CDATA[last f.m.]]></category>

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

		<category><![CDATA[lean software development]]></category>

		<guid isPermaLink="false">http://www.totalworldannihilation.org/blog/?p=42</guid>
		<description><![CDATA[I learned about the Last F.M. developer setup when the two founders Matt Ogle and Anill Bawa Cavia when they talked at the Future Of Web Applications conference in London in 2007. In order to communicate with a distributed and ever increasing development team they used IRC as the basis of their communication. The IRCcat [...]]]></description>
			<content:encoded><![CDATA[<p>I learned about the <a href="http://last.fm" target="_blank">Last F.M.</a> developer setup when the two founders <em>Matt Ogle</em> and <em>Anill Bawa Cavia</em> when they talked at the <strong>Future Of Web Applications</strong> conference in <a href="http://www.futureofwebapps.com/past-events.html#londonOct07" target="_blank">London in 2007</a>. In order to communicate with a distributed and ever increasing development team they used IRC as the basis of their communication. The IRCcat bot is a smart little guy who lets everyone know what is going on. By writing some smart pieces of code they where able to integrate information from <a href="http://trac.edgewall.org/" target="_blank">Trac</a>, <a href="http://www.nagios.org/" target="_blank">Nagios</a> and other tools used in development to enable everyone to have all information available when they wanted. I thought this was a very sweet setup back when I worked at Ezmo so I decided to try and use it in my next job. Therefor I decided to check it out on my Windows machine first.</p>
<h2>Reducing waste and polling information</h2>
<p>One important aspect of Lean Software Development is reducing waste and I think that reducing waste in project communication is very important. By removing the need for a lot of manual communication about server status or events occurring in the different development environments you remove a lot of waste. Another principle is that you should poll information when you need it instead of pushing it onto people. By using IRC you enable developers to poll information when they are actually developing by allowing them to connect to IRC when they are actually developing or giving them access to IRC logs if they need to see what went on while they where in a meeting. If you where to use IM software for this you would push information and it will feel a lot more intrusive for developers.</p>
<h2>Installing IRCcat</h2>
<ol>
<li>Download a <a href="http://java.sun.com/javase/downloads/index.jsp" target="_blank">Java JDK</a> 1.5 or later, and point <em>JAVA_HOME</em> to this directory</li>
<li>Download <a href="http://ant.apache.org" target="_blank">Ant</a> and make it available in your <em>PATH</em></li>
<li>Download <a href="http://www.last.fm/user/RJ/journal/2008/01/21/627529/" target="_blank">IRCcat</a></li>
<li>Download the <a href="http://www.totalworldannihilation.org/blog/wp-content/uploads/2008/05/irccat-twa-howto.xml" target="_blank">attached configuration file</a></li>
<li>Run the command: <em>ant -Dirccat-howto.xml run</em></li>
<li>Viola! You should now see something similar to this:</li>
</ol>
<p><img class="alignnone size-medium wp-image-44" title="irccat-startup" src="http://www.totalworldannihilation.org/blog/wp-content/uploads/2008/05/irccat-startup.png" alt="IRCcat startup"  /></p>
<p>Uhm, so what did I just do? Well, IRCcat is a service which basically dispatches commands to an IRC server. You can &#8220;talk&#8221; to IRCcat and then have it communicate to the IRC channel and all it&#8217;s listeners. This samples uses the <a href="http://www.ircnet.com/" target="_blank">IRCnet</a> IRC network and connects to the channel <em>#TWA-IRCcat-howto</em>. Now connect to an IRCnet server with a regular IRC client (<a href="http://mirc.net/" target="_blank">mIRC</a>, <a href="http://www.pidgin.im/" target="_blank">Pidgin</a>, etc) and join the channel <em>#TWA-IRCcat-howto</em>. In this channel there should be a bot called <em>TWAcat</em>.</p>
<p>What we now need to do is to send some messages using IRCcat. Doing this is most easily done by downloading a tool called <a href="http://www.vulnwatch.org/netcat/" target="_blank">netcat</a> (<a href="http://en.wikipedia.org/wiki/Netcat" target="_blank">more on netcat at Wikipedia</a>) available on Unix and Windows. Unfortunately some virus protection software thinks netcat is a dangerous program and will prevent you from executing it, so you might have to stop any such applications when trying this out.</p>
<p>Having downloaded netcat and added it to your <em>path</em> you can now write the following command:<br />
<em>echo Hola el Mundo|nc  -w1 localhost 9999 </em></p>
<p>In your IRC client you should now see <em>TWAcat</em> say: &#8220;Hola el mundo&#8221;</p>
<h2>Where to go from here?</h2>
<p>What is cool about IRCcat is that it is very easy to write your own piece of code which reports statuses, errors, etc to your development team. This is really cool and I&#8217;m very much looking forward to see how this works out. Keep a lookout for upgrades by reading <a href="http://www.last.fm/user/RJ/journal/2008/01/21/627529/" target="_blank">the journal on Last F.M</a> and let me know if you have any problems with this sample.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.totalworldannihilation.org/blog/2008/05/05/reducing-waste-with-poll-based-project-communication/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Lean principles and how they&#8217;re applied everywhere</title>
		<link>http://www.totalworldannihilation.org/blog/2008/04/29/lean-principles-and-how-theyre-applied-everywhere/</link>
		<comments>http://www.totalworldannihilation.org/blog/2008/04/29/lean-principles-and-how-theyre-applied-everywhere/#comments</comments>
		<pubDate>Tue, 29 Apr 2008 10:59:01 +0000</pubDate>
		<dc:creator>leftieFriele</dc:creator>
		
		<category><![CDATA[work]]></category>

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

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

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

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

		<category><![CDATA[lean software development]]></category>

		<category><![CDATA[toyota production syste]]></category>

		<guid isPermaLink="false">http://www.totalworldannihilation.org/blog/?p=41</guid>
		<description><![CDATA[While listening to the BBC World Service, which I tend to do when I work from home, the program Global Business all of a sudden caught my attention when I heard the mention of Lean and the Toyota Manufacturing System. Having studied and applied Lean principles for a while I became interested in the program. [...]]]></description>
			<content:encoded><![CDATA[<p>While listening to the <a href="http://www.bbc.co.uk/worldservice/" target="_blank">BBC World Service</a>, which I tend to do when I work from home, the program Global Business all of a sudden caught my attention when I heard the mention of <em>Lean</em> and the <em>Toyota Manufacturing System</em>. Having studied and applied Lean principles for a while I became interested in the program. The focus of the program was how Lean was being applied to companies in the services industry who produce no physical products to apply quality control to still benefit from applying Lean principles to their way of doing business. The program outlines how companies such as <em>Amazon</em>, <em>GE Moneybank</em> and <em>gem</em> all use Lean principles in order to make more money and help grow their business.</p>
<h2>&#8220;Taking people seriously costs too much&#8221;</h2>
<p>The program interviews author of <a href="http://www.amazon.com/gp/product/0743299795/ref=reg_hu-wl_item-added" target="_blank">&#8220;The machine that changed the world: The story of Lean production&#8221;</a> James P. Womack of the <a href="http://www.lean.org/" target="_blank">Lean Enterprise Institute</a> who explains easily how for instance <em>Home Depot</em> and <em>Wall Mart</em> have disconnected themselves from customers by either off shoring customer services or using temporary unskilled workers instead of full time employees with actual. He goes on to explain how businesses who say <em>&#8220;taking people seriously costs too much&#8221;</em> are totally missing the point. I will not repeat everything he said, but instead encourage you to listen to the program (see details about this at the end of this post).</p>
<h2>Lean customer service</h2>
<p>One of the more surprising places that Lean has been applied is in call centers and the program shows how the <a href="http://www.the-gem.com/news/" target="_blank">Northern Ireland call center company gem</a> have grown their business by applying Lean principles to customer service. By treating customers as actual human beings as opposed to treating them as numbers in a queue. Gem employees and executives are all measured on customer satisfaction and not how. They provide value to their clients by providing a feedback loop back letting them know how they can improve their business.  Gem work with their clients</p>
<p>Steven Perry (I apologize if I spelled this wrong) of Transform also explains how they where hired by the government of Northern Ireland to try prevent jobs being off-shored and making their works important.  By applying Lean principles to call-center companies in Northern Ireland they are securing jobs and making companies grow. One amazing example is a call-center handling technical support for an airlines company which keeps getting complaints about the email system not working properly. When contacting the CEO of the company the call-center got a reply that it was too expensive to upgrade the email system and that people would had to live with a few quirks in the email system. The call-center company then looked at the emails and discovered that the emails contained shift rosters, lists of passengers transferring from the airline to other airline and details about parts not arriving on time. When providing these root causes to the CEO it was an obvious decision to upgrade the email system.<br />
The program also outlines how Lean principles when applied provides great value to companies providing services and how they transform themselves into management consulting companies and not just simple service companies.</p>
<h2>Lean banking?</h2>
<p><a href="http://www.gemoney.com/">GE Money Bank</a> measures customer satisfaction by using a simple survey with 5-6 customers and are not linked to change, growth or volume. Instead they measure customer satisfaction using <a href="http://en.wikipedia.org/wiki/Net_Promoter_Score" target="_blank">net promoter score</a>, which means asking customers, &#8220;would you recommend us/our product to your friends?&#8221;</p>
<p>Linking this to the Lean philosophy GE Moneybank sees an answer of &#8220;yes, I would recommend your product&#8221; as a much better indication for future growth.  Their business executives are all measured and paid according to these scores and this enables them to execute their business based on Lean principles and by doing this making billions of dollars.</p>
<h2>Lean in the software industry</h2>
<p>1) Lean does not only apply to companies manufacturing products</p>
<p>2) Lean is gaining momentum in most areas of business and will become the standard way of doing business also in the software industry.</p>
<p>The software industry have started on it&#8217;s path towards Lean by starting to apply agile principles to software development. But in order to make the industry more mature and help customers get better value for their investments in information technology I am certain that our industry too needs to apply these principles in order to everyone in the entire business to focus upon the customer. Agile only does this for a certain part of an organization whereas Lean has principles which more easily transcends into the management sphere because of it&#8217;s roots in the Toyota Manufacturing System.</p>
<h2>Iterate &#8220;leaning&#8221; the way in Norway</h2>
<p>(I sincerely apologize for the tabloid heading of this section, but I just could not resist the temptation and again I am sorry) Lean has not become very relevant in Norway yet and we are still getting used to the idea of applying Scrum and agile methods. However there is a Norwegian consulting company called <a href="http://www.iterate.no" target="_blank">Iterate</a> who both apply Lean to their clients, but also follow the same Lean principles to the way they run their own business. When talking with them you learn how Lean also can be applied to a company which makes money by billing hours.</p>
<p>I had the pleasure of being in contact with Iterate and it really is quite fascinating to learn how they apply Lean to a consulting company. By focusing internally on making sure their employees are treated as the knowledge workers they are and not cash-cows and by doing this providing their customers with excellent services by applying the same principles. They do not have what I call the <em>&#8220;Accenture focus&#8221;</em>, which means focusing upon getting the most number of hours squeezed out of any client, but instead treat the customer the same way as their own employees. Just like with call centers in Northern Ireland, <a href="http://www.iterate.no" target="_blank">Iterate</a> of Norway applies Lean principles in the the service industry and they both do it with success.</p>
<h2>How to listen to the program</h2>
<p><a href="http://downloads.bbc.co.uk/podcasts/radio/worldbiz/worldbiz_20080429-0030.mp3" target="_blank">Download the program</a> or <a href="http://www.bbc.co.uk/radio/podcasts/worldbiz/" target="_blank">subscribe to the Podcast</a> and look for the program called <em>Lean, Mean and at Your Service: 29th April 08</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.totalworldannihilation.org/blog/2008/04/29/lean-principles-and-how-theyre-applied-everywhere/feed/</wfw:commentRss>
<enclosure url="http://downloads.bbc.co.uk/podcasts/radio/worldbiz/worldbiz_20080429-0030.mp3" length="11211711" type="audio/mpeg" />
		</item>
		<item>
		<title>Buzzword sums it all up</title>
		<link>http://www.totalworldannihilation.org/blog/2008/04/15/buzzword-sums-it-all-up/</link>
		<comments>http://www.totalworldannihilation.org/blog/2008/04/15/buzzword-sums-it-all-up/#comments</comments>
		<pubDate>Tue, 15 Apr 2008 08:43:27 +0000</pubDate>
		<dc:creator>leftieFriele</dc:creator>
		
		<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://www.totalworldannihilation.org/blog/?p=39</guid>
		<description><![CDATA[Just recently I got a new computer and not wanting to use Microsoft Office for writing documents I thought I would give the Adobe acquisition Buzzword a chance. I have used GoogleDocs for a while and it works ok, but I wanted to see if the Flex based Buzzword was any better.
I started off writing [...]]]></description>
			<content:encoded><![CDATA[<p>Just recently I got a new computer and not wanting to use Microsoft Office for writing documents I thought I would give the Adobe acquisition <a href="http://www.buzzword.com">Buzzword</a> a chance. I have used <a href="http://docs.google.com">GoogleDocs</a> for a while and it works ok, but I wanted to see if the Flex based <a href="http://www.buzzword.com">Buzzword</a> was any better.</p>
<p>I started off writing some technical documentation and found the word processor to do the job. I could insert images and format lists which is basically all I would do for any document. What is missing is more short cut keys and some other minor things, but all in all I thought the service was cool. I haven&#8217;t gotten the chance to try the collaboration features yet, which really is one of the coolest features in Google Doc&#8217;s.</p>
<p>Anyway, while I was writing my document I had to spend some quality time catching up on my RSS feeds. When I went back to Buzzword it had a really nice surprise for me which really shows how one simple design on a feature shows that a company &#8220;gets it&#8221;. What usually is an annoying feature that you don&#8217;t want to see was transformed into something cute and unexpected. Just look at the screenshot below, there is no way you can be angry for having to log back in when you get prompted this image.<br />
<a href="http://www.totalworldannihilation.org/blog/wp-content/uploads/2008/04/image0011.png"><img class="aligncenter size-medium wp-image-40" title="Buzzword screen shot" src="http://www.totalworldannihilation.org/blog/wp-content/uploads/2008/04/image0011-300x189.png" alt="sign-back-in-screenshot" width="300" height="189" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.totalworldannihilation.org/blog/2008/04/15/buzzword-sums-it-all-up/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Cairngorm: a tired old horse that should be put down</title>
		<link>http://www.totalworldannihilation.org/blog/2008/04/11/cairngorm-a-tired-old-horse-that-should-be-put-down/</link>
		<comments>http://www.totalworldannihilation.org/blog/2008/04/11/cairngorm-a-tired-old-horse-that-should-be-put-down/#comments</comments>
		<pubDate>Fri, 11 Apr 2008 15:04:41 +0000</pubDate>
		<dc:creator>leftieFriele</dc:creator>
		
		<category><![CDATA[Flex]]></category>

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

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

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

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

		<guid isPermaLink="false">http://www.totalworldannihilation.org/blog/?p=34</guid>
		<description><![CDATA[Being a Java developer I felt that Cairngorm was a God sent as it provided me with a familiar way of constructing an application architecture. This made the process of starting developing in Flex a lot less complicated than if I where to start from scratch. In my old company Ezmo we built an online [...]]]></description>
			<content:encoded><![CDATA[<p>Being a Java developer I felt that <a href="http://labs.adobe.com/wiki/index.php/Cairngorm">Cairngorm</a> was a God sent as it provided me with a familiar way of constructing an application architecture. This made the process of starting developing in Flex a lot less complicated than if I where to start from scratch. In my old company Ezmo we built an online music service using the Cairngorm framework. We where very happy in the beginning and we really felt that Cairngorm helped us a lot as we didn&#8217;t have to learn too much about the inner workings of Flex and Action Script in order to start shipping working software.</p>
<p>As we continued growing our application I could not help to notice that there really was a few things about the framework that really started to degrade the quality of our code base and really made our application harder to maintain.</p>
<h2>Boilerplate code</h2>
<p>Writing a Cairngorm application involves <span style="text-decoration: underline;">a lot</span> of <a href="http://en.wikipedia.org/wiki/Boilerplate_(text)">boilerplate code</a>. In order to get just a simple command going you need to create 2/3 new classes and write 20/30 lines of code which provides no value what so ever.<br />
I really feel the Cairngorm framework should try and encapsulate more of the inner workings and hence saving developers a lot of time and effort. When designing a framework I feel you should have the approach the guys developing Spring Framework for Java has: to make development simpler. Cairngorm does not make development simpler and as your application grows Cairngorm really starts to slow you down.</p>
<h2>More code, more problems</h2>
<p>Numerous studies has shown that the more lines of code you have in your application, the higher is the potential for bugs. Therefor it would be beneficial for an application framework such as Cairngorm to let developers write less code. In my experience Cairngorm does quite the oposite. I have compared an application created using Cairngorm to the same application written from scratch with a custom architecture and Cairngorm adds numerous classes and several hundred lines of code (I&#8217;ll provide samples of this later on).</p>
<h2>Feels like EJB 2.0</h2>
<p>When I work with Cairngorm I get the same feeling as I did back when I had to work with EJB 2.0. It feels like a plastic bag that&#8217;s constantly over your head while you try do develop your application. The framework is intrusive and continues to force you to write tons of useless code and transforms all applications intro dinosaurs that become hard to maintain and really hard for new people to learn. Regardless of all the patterns used in Cairngorm, it is not easy for new developers to start developing when they have to related to such a huge number of classes.</p>
<h2>MVC is probably not what you need</h2>
<p>In my experience most applications don&#8217;t need to implement the Model Control View pattern in order to provide a decent application architecture. Especially I feel this is the case for Flex, you really don&#8217;t want to mimic a Java web application when you have such a great framework as Flex!</p>
<h2>A plead to Adobe Consulting</h2>
<p>Listen Adobe Consulting, either you try and upgrade your framework to something that fulfills the demands of developers in 2008 or you release it as Open Source. Right now all the new things in Caringorm are related to their ridiculously expensive Live Cycle Data Service, nothing in regards to making development faster and easier. If you don&#8217;t have the time or resources to do this, release it and maybe the community can help out (I am fully aware that I should put my money where my mouth is and develop my own framework, but this is not something I have time to do right now).</p>
<h2>Here is what you should do</h2>
<p>Having put down the Cairngorm framework I guess you want to know what to do? OK, I&#8217;ll try and elaborate some of my thought on how you best construct and application architecture in Flex.</p>
<h2>Model Locator &amp; Business Delegate</h2>
<p>There are two valuable things in  Cairngorm which I would continue to use (but I would probably just develop those classes my self for each project):</p>
<ul>
<li>Model Locator</li>
<li>Business Delegate</li>
</ul>
<p>All the command, event, front controller mumbo jumbo is just there for the pattern horny architects who does no actual coding and have a need to have as many patterns as possible in every application architecture the work on.<br />
Now here is why I feel these things make sense for almost any project. The Model Locator pattern, as Adobe calls it, is a great way to control data in your application. Combining the Model Locator with the built in feature of <em>data binding</em> in Flex that is a really powerful combo. If you combine this with a Business Delegate class you have pretty much all you need (you may not actually need that class either, it is not very hard to write one on your own).</p>
<h2>Why settle for just one model?</h2>
<p>If you decide to throw out most of Cairngorm and write your own architecture I would advice you to use two types of Models: Presentations Model and Server Models.<br />
Having a one-to-one relation between the server side services and Server Models provides you with a seperation between server side data and the presentation data. Server Models should be responsible for retrieving their own data (that&#8217;s right, no events/commands needed). Presentation Models can use one or more Server Models, and once again using data binding to control updates. I think this provides a really simple, but yet very scalable, application architecture.</p>
<h2>Update</h2>
<p>I am terribly sorry about the mistake of not remembering that Cairngorm is Open Source. Since I wrote this I have been notified about some other articles dealing with the same issue and I think the best one yet is an article called <a href="http://nwebb.co.uk/blog/?p=168" target="_blank">Using Cairngorm &#038; Thoughts On Handling Those Pesky Singletons</a></li>
<p>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.totalworldannihilation.org/blog/2008/04/11/cairngorm-a-tired-old-horse-that-should-be-put-down/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
