<?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>Tom&#039;s blog &#187; development</title>
	<atom:link href="http://tomkordys.net/blog/tag/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://tomkordys.net/blog</link>
	<description>freelance flash/flex/air developer</description>
	<lastBuildDate>Wed, 28 Apr 2010 21:31:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Away3d training</title>
		<link>http://tomkordys.net/blog/2010/04/28/away3d-training/</link>
		<comments>http://tomkordys.net/blog/2010/04/28/away3d-training/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 21:31:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[flash away3d pv3d 3d]]></category>

		<guid isPermaLink="false">http://tomkordys.net/blog/?p=122</guid>
		<description><![CDATA[If you are interested in building flash sites in 3d you should definitely sign up for Away3d training with one of its founders, Rob Bateman. If you haven&#8217;t heard about Away3d yet definitely check out away3d.com.
More info on the actual training here and here
This training is part of LFPUG training, where training groups are small [...]]]></description>
			<content:encoded><![CDATA[<p>If you are interested in building flash sites in 3d you should definitely sign up for Away3d training with one of its founders, <a href="http://www.infiniteturtles.co.uk/blog/">Rob Bateman</a>. If you haven&#8217;t heard about Away3d yet definitely check out <a href="http://away3d.com/">away3d.com</a>.<br />
More info on the actual training <a href="http://www.infiniteturtles.co.uk/blog/away3d-international-training-events">here</a> and <a href="http://www.lfpug.com/the-beginners-guide-to-away3d-05-2010/">here</a></p>
<p>This training is part of LFPUG training, where training groups are small (max 15 ppl), venue is great and the price is only £200+VAT (lunch included!). It is really great value for money all thanks to <a href="http://www.tink.ws/blog/">Tink</a>. I attended the training myself last year and I highly recommend it. </p>
]]></content:encoded>
			<wfw:commentRss>http://tomkordys.net/blog/2010/04/28/away3d-training/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Working with AIR2.0 beta and nativeProcess &#8211; walkthrough</title>
		<link>http://tomkordys.net/blog/2009/11/30/working-with-air2-0-beta-and-nativeprocess-walkthrough/</link>
		<comments>http://tomkordys.net/blog/2009/11/30/working-with-air2-0-beta-and-nativeprocess-walkthrough/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 16:56:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[adt]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[air apps]]></category>
		<category><![CDATA[air2.0beta]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[native process]]></category>

		<guid isPermaLink="false">http://tomkordys.net/blog/?p=97</guid>
		<description><![CDATA[Like I mentioned in my previous post I decided to wrap up what I&#8217;ve learned working with AIR2.0 and share it with community. Air2 beta was released 2 days before I was told to research on a scenario of running a native application along with AIR app. There are a few solutions available that can [...]]]></description>
			<content:encoded><![CDATA[<p>Like I mentioned in my previous post I decided to wrap up what I&#8217;ve learned working with AIR2.0 and share it with community. Air2 beta was released 2 days before I was told to research on a scenario of running a native application along with AIR app. There are a few solutions available that can already do it and you don&#8217;t actually need to use AIR2 nativeProcess if you have similar requirement but I decided to look into AIR2 a bit closer.<br />
Because the app is not going to be publicly available and it is going to be installed manually along with runtime (not over the web) the risk of the app misbehaving or not working at all is massively reduced. That&#8217;s only IF. The big IF was if the application is going to behave as expected and after putting a few lines of code I must admit that it does. If it hasn&#8217;t I would have probably gone with <a href="http://shu-player.com/">Shu</a> or <a href="http://shu-player.com/">Zinc</a>. But luckily I didn&#8217;t have to thanks to nativeProcess fuctionality available in Air2.</p>
<p>So, what can you do with nativeProcess? You can run any native process on user&#8217;s machine (exe for Win users, dmz for Mac).<br />
In my case I was porting an online app to work offline and the problem was that app was heavily reliable on external services and making it work without those simply wasn&#8217;t going to work. I had to have services running on localhost and serving whatever the live service would have served. Thank God it only had to work on Windows but I will explain why later.</p>
<p><strong>Prerequisites</strong><br />
In order to get anything done and actually to be able to test anything there are some prerequisites like I mentioned in previous post, which is getting the runtime and overlaying Flex SDK with AIR SDK. The next step is to change descriptor namespace to</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">xmlns=&quot;http://ns.adobe.com/air/application/2.0beta&quot;</div></div>
<p>. The next thing in order to get access to nativeProcess is to set up one more parameter in the descriptor.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;supportedProfiles&gt;extendedDesktop&lt;/supportedProfiles&gt;</div></div>
<p>.<br />
This was a really gotcha because I found one article not stating anything about it, second one stating it should already be there and doing more research I discovered it has to be added manually. That&#8217;s all what&#8217;s required to take advantage of a nativeProcess</p>
<p>I would expect those descriptor changes to be included in final release of AIR2. I assume the xml namespace will be generated automatically and supportedProfiles is going to be commented out like the rest of params you can set in the descriptor file.</p>
<p><strong>Using nativeProcess</strong><br />
First thing to do is worth checking in native process is available by checking if</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">NativeProcess.isSupported</div></div>
<p>returns true.<br />
If it does, the rest should look like this:</p>
<div class="codecolorer-container actionscript3 default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="actionscript3 codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> file <span style="color: #000066; font-weight: bold;">:</span> File<span style="color: #000066; font-weight: bold;">;</span><br />
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> nativeProcessStartupInfo <span style="color: #000066; font-weight: bold;">:</span> NativeProcessStartupInfo<span style="color: #000066; font-weight: bold;">;</span><br />
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> nativeProcess <span style="color: #000066; font-weight: bold;">:</span> NativeProcess<span style="color: #000066; font-weight: bold;">;</span><br />
<br />
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> preinitializeHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=event%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:event.html"><span style="color: #004993;">Event</span></a><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span><br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>NativeProcess<span style="color: #000066; font-weight: bold;">.</span>isSupported<span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;NativeProcess.isSupported&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//get the directory</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; file = File<span style="color: #000066; font-weight: bold;">.</span>applicationDirectory<span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// point to the file</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; file = file<span style="color: #000066; font-weight: bold;">.</span>resolvePath<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;bin/mynativeProccess.exe&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//define process startup information</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; nativeProcessStartupInfo = <span style="color: #0033ff; font-weight: bold;">new</span> NativeProcessStartupInfo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; nativeProcessStartupInfo<span style="color: #000066; font-weight: bold;">.</span>workingDirectory = File<span style="color: #000066; font-weight: bold;">.</span>applicationDirectory<span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; nativeProcessStartupInfo<span style="color: #000066; font-weight: bold;">.</span>executable = file<span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">//instatiate the process</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; nativeProcess = <span style="color: #0033ff; font-weight: bold;">new</span> NativeProcess<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// start the process</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; nativeProcess<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">start</span><span style="color: #000000;">&#40;</span>nativeProcessStartupInfo<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<span style="color: #000000;">&#125;</span></div></div>
<p>Setting the workingDirectory on nativeProcessStartupInfo to be application directory is required if you need the process to know where the files are. Running the exe standalone was showing the process folder to be where it was called from, but running it through AIR was changing it to C://Documents and Settings/user folder for some strange reason.</p>
<p>That was it for me. I didn&#8217;t have to write any data to the process directly because my service was doing it for me. However if you need to communicate with the process you can do it.<br />
Here is an article on how to do it:<br />
<a href="http://www.adobe.com/devnet/air/flex/quickstart/interacting_with_native_process.html">http://www.adobe.com/devnet/air/flex/quickstart/interacting_with_native_process.html</a></p>
<p>Other thing worth mentioning is the fact that AIR will kill the process you have started when you exit the AIR application. There is no need for additional handler to kill it. You can also stop the native process anytime you like by calling</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">nativeProcess.exit()</div></div>
<p>.</p>
<p><strong>Packaging it all up</strong><br />
At this stage everyting seems to be working as expected so it is time to release the app. Because I am using Eclipse with FlexBuiler plugin (3.0) I would normally do Project -> Export Release Build from the navigation, but when you are wrapping a native process this option is not available to you. You need to use ADT in order to achieve this (more on ADT <a href="http://help.adobe.com/en_US/FlashPlatform/develop/air/building_apps/WS5b3ccc516d4fbf351e63e3d118666ade46-7fd6.html">here</a>).</p>
<p>First thing to do would be to add FlexSDK+AIRSDK/bin folder to PATH in Environment Variables. This will allow you to type &#8220;adt&#8221; in any folder or your machine from the command line. I recommend checking you have the correct version by typing</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">adt - version</div></div>
<p>to see if you are using the right version of ADT. If you get &#8220;2.0.xxxxxx&#8221; you are good to go. I only realised that after a couple of attempts and I was getting really frustrated by ADT misbehaving. I was pointing to ADT in a different SDK and version of it was 1.5. This version of ADT didn&#8217;t quite understand what it had to do.</p>
<p>Moving forward was getting the certificate. You need it for ADT to publish an app and the easiest way to get it is simply by publishing the application through Project -> Export Release Build. There is an option there to publish certificate as well. I think that&#8217;s the easiest and quickest way to get one.</p>
<p>With all those tasks done, the next step is to finally run ADT and get the actual AIR application. So, from the command line, go to your bin folder of your project where your descriptor.xml and application.swf is located along the all the files you want to include (your should have your native process there) and run:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">adt -package -storetype pkcs12 -keystore yourCertificate.p12<br />
-storepass yourPassword -target<br />
native yourApplicationName.exe<br />
yourDescriptorFile.xml yourApplication.swf<br />
yourFolderToInclude1 yourFileToInclude2 ...</div></div>
<p>Make sure it&#8217;s all in one line as well.</p>
<p>This should result in ADT spitting out yourApplicationName.exe which is a native AIR installation file. Good enough for me. I am working on a PC, I get an exe I can run, it&#8217;s all good. Hold on, what if I wanted to release it for a Mac as well? That simply wouldn&#8217;t work, it turns out I would need a mac to do it!</p>
<p>In my case this wouldn&#8217;t work anyways, because my nativeProcess is a service build on Microsoft .NET, but hypothetically I could have had someone written the same functionality of my native process for a Mac. Then I could do a simple check of system capabilities and launch appropriate native process dependent on that. This scenario shows how with using native process you loose the key AIR feature, which is AIR being cross-platform. &#8220;Loose&#8221; is maybe a bit too strong, but making it harder and more confusing for a developer to develop cross platform. I wonder why this is done in such a weird way without the ability to publish to multiple platforms. If you have Flex+ AIR SDK installed on your machine it means you actually have both runtimes: Win and Mac. They both sit in SDK/runtimes folder and this is what ADT needs, unless there is something else that needs including and is probably licensed. I don&#8217;t see any other explanation for this. Also worth mentioning is the fact that Adobe doesn&#8217;t mention anything on how to run a native process on Linux.</p>
<p><strong>Conclusion</strong><br />
New features of AIR 2 are really impressive. I am particularly interested in multitouch and gestures. Native applications have also a great potential. But I am a bit concerned about security here, especially if a developer has bad intentions. Imagine you had a worm packaged with your air app or any other form of malicious crap. It does sound scary. Apart from that I don&#8217;t see anything else that would do more harm than good. The same applies to beta apart from the fact it&#8217;s only a beta.</p>
<p>Releasing the app as AIR2 beta app is not something I would recommend unless you will have control over the machines it will be installed on. If you release your app as Air2 beta it will only work on a machine with this specific runtime installed. The runtime will not update itself from 1.5 to 2.0 beta, like it has for example from 1.4 to 1.5 when application needed it. In order to take the advantage of those new features in 2 beta the  runtime needs to be installed manually. According to Developer FAQ runtime will upgrade itself automatically only to final 2.0 runtime when it&#8217;s released but it&#8217;s got nothing to do the same with beta. Also Air 2 beta will expire.</p>
<p>Because you can only have 1 runtime installed if you decide to go with this beta you put at risk all other AIR apps a user can be running. I have had the beta runtime installed for over 2 weeks now, I am running a few AIR apps almost the whole time (BBC iPlayer, TweetDeck) and I haven&#8217;t noticed anything wrong with the runtime. None of the applications have never crashed or anything like it, but the fact it is only a beta proves Adobe still isn&#8217;t totally confident with it.</p>
<p>If you want to play with it I would highly recommend checking out release notes:<br />
<a href="http://labs.adobe.com/wiki/index.php/AIR_2:Release_Notes">http://labs.adobe.com/wiki/index.php/AIR_2:Release_Notes</a><br />
for what&#8217;s new, what the known bugs are, etc. and reading the Developer FAQ:<br />
<a href="http://labs.adobe.com/wiki/index.php/AIR_2:Developer_FAQ">http://labs.adobe.com/wiki/index.php/AIR_2:Developer_FAQ</a></p>
<p>You will notice some inconsistencies in the documentation, but if you have time and enjoy investigating, it might actually be loads of fun. I really enjoyed it.</p>
<p>Any questions, problems, suggestions just give me a shout. </p>
]]></content:encoded>
			<wfw:commentRss>http://tomkordys.net/blog/2009/11/30/working-with-air2-0-beta-and-nativeprocess-walkthrough/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Dependency Injection, frameworks and other latest AS3 trends, Robotlegs, Dawn, Parsley?</title>
		<link>http://tomkordys.net/blog/2009/11/09/dependency-injection-frameworks-and-other-latest-as3-trends-robotlegs-dawn-parsley/</link>
		<comments>http://tomkordys.net/blog/2009/11/09/dependency-injection-frameworks-and-other-latest-as3-trends-robotlegs-dawn-parsley/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 11:21:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[cairngorm]]></category>
		<category><![CDATA[dawn]]></category>
		<category><![CDATA[Dependency Injection]]></category>
		<category><![CDATA[DI]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[mate]]></category>
		<category><![CDATA[parsley]]></category>
		<category><![CDATA[robotlegs]]></category>

		<guid isPermaLink="false">http://tomkordys.net/blog/?p=81</guid>
		<description><![CDATA[Attending last LFPUG meetup got me thinking about all the latest Flash and Flex development, especially in the way in which this development is going. I think the community is becoming much more mature and this can be observed by the number of frameworks that have recently poped up. Everyone is blogging about it, and [...]]]></description>
			<content:encoded><![CDATA[<p>Attending last <a href="http://www.lfpug.com">LFPUG</a> meetup got me thinking about all the latest Flash and Flex development, especially in the way in which this development is going. I think the community is becoming much more mature and this can be observed by the number of frameworks that have recently poped up. Everyone is blogging about it, and you can actually get lost in all those differences each of the frameworks has. But almost all the frakeworks are build on design paterns, which is definitely a good thing. When it comes to Design Patterns it is pretty straight forward. If you don&#8217;t know what they are I suggest doing some research because using design patterns makes your code much more elegant and structured.<br />
Here is what wikipedia says, and remember that wikipedia is ALWAYS right: </p>
<blockquote><p>n software engineering, a design pattern is a general reusable solution to a commonly occurring problem in software design. A design pattern is not a finished design that can be transformed directly into code. It is a description or template for how to solve a problem that can be used in many different situations. Object-oriented design patterns typically show relationships and interactions between classes or objects, without specifying the final application classes or objects that are involved.</p></blockquote>
<p>The whole article can be found <a href="http://en.wikipedia.org/wiki/Design_pattern_%28computer_science%29">here</a>.</p>
<p>Bear in mind that not all the design patterns apply to AS3 because of it&#8217;s uniqueness (being an OOP language on client side, not server side). Practical use of design patterns in AS3 was well presented by <a href="http://blog.eamonnfaherty.co.uk/">Eamonn Faherty</a> during the LFPUG&#8217;s first session. Eamonn seemed to be pretty confident talking about various patterns and I highly recommend you watch the presentation on <a href="http://www.lfpug.com/practical-design-patterns-for-actionscript-30/">LFPUG&#8217;s site</a></p>
<p>If that&#8217;s not enough for you, you can always get O&#8217;reilly&#8217;s book for your iPhone/iPod &#8220;Actionscript 3 Design Patterns&#8221;. Simply search for &#8220;O&#8217;reilly Design Patterns&#8221; in the app store and this book should come up. I got it myself and I find it really handly to have it will me all the time even if you are only using it to show off what cool apps have. It does the job.  </p>
<p>Second session on Frameworks was presented by <a href="http://www.bigroom.co.uk/blog/">Richard Lord</a>. Richard is well known in the flash community especially because he&#8217;s the man behind <a href="http://flintparticles.org/">Flint</a>, the particle system for flash. That is not the only thing Richard is well known for. Second thing is frameworks. He was even presenting on this year&#8217;s Flash on the Beach about frameworks and if you look at his blog it looks like he can call himself an expert. I didn&#8217;t make it Richards presentation on FOTB because the conference room got filled out to the max. So for those who had seen it, I recommend you watch what he presented on LFPUG because it seemed that what he added to his FOTB presentation was the most interesting stuff, mainly Parsley and Robotlegs.</p>
<p>I assume all of us heard of <a href="http://opensource.adobe.com/wiki/display/cairngorm/Cairngorm">Cairngorm</a>, <a href="http://puremvc.org/">PureMVC</a> and roughty heard of <a href="http://mate.asfusion.com/">Mate</a> and <a href="http://swizframework.org/">Swiz</a>.<br />
We constantly hear to stay away from Cairngorm because it&#8217;s simply shite (although many of the people who say that have never actually used it), PureMVC is not fun to work with, Mate being only flex framework and Swiz being apparently really good but also working only with flex. </p>
<p>I must admit I am a fan of PureMVC because I believe days of cowboy coding are over. There has to be a unified way of writing code in this industry and PureMVC was the first one to make it happen, especially in the flash department. It&#8217;s got it&#8217;s pros and cons, but it definitely serves it&#8217;s purpose. Code in pureMVC is (usually) neatly organized and if you don&#8217;t know it, it means you are way behind. </p>
<p>So what is next?<br />
To me it looks like the next big thing is Dependecy Injection and frameworks build on it. Basically all the frameworks apart from Cairngorm and PureMVC rely on DI. The easiest definition I found:</p>
<blockquote><p>At the simplest, Dependency Injection is that act of supplying objects with their instance variables or properties. When you pass a variable to the constructor of a class, you are using Dependency Injection. When you set a property on a class, you are using Dependency Injection. If you aren’t coding your AS3 in a strictly procedural or linear fashion, the odds are that you are making use of Dependency Injection right now.</p></blockquote>
<p>Dependecy Injection always comes with a second term Inversion Of Control. IoC container is nothing else than a container that uses DI, it&#8217;s pretty straight forward.</p>
<p>DI and IoC are just one of many things that came to Actioscript from other OOP languages. And I think it&#8217;s great. It means we are not re-inventing the wheel, we simply apply the best patterns, aka problem solvers from much more mature languages like Java to AS. </p>
<p>So, looking at what we have available in terms of DI and IoC in Actionscript are the following:</p>
<p><a href="http://www.springactionscript.org/">Spring Actionscript</a> (formerly known as Prana).<br />
Prana was the first framework using Inversion of Control for ActionScript 3.0. It was nothing else that a port of Spring Framework for Java. I have never used and I don&#8217;t think many people actually have. I think it is mosty the Java reference that puts people off but that&#8217;s just my opinion. </p>
<p><a href="http://code.google.com/p/smartypants-ioc/">SmartyPants IOC</a><br />
SmartyPants apart from it&#8217;s really interesting name it is the one that started the whole Dependency Injection trend. SmartyPants is not a framework itself it is only the IOC container. It is a bit verbose but it&#8217;s pretty good to get your head around DI, because it is the only thing it covers.</p>
<p>And here is where we come to the main reason why I wanted to write this post.</p>
<p><a href="http://www.robotlegs.org/">Robotlegs</a><br />
Robotloegs is awesome. Robotlegs is a MVCS framework based on on Dependency Injection using Flash Events. Why MVCS? Well the author, Shaun, decided to split the model tier of the architecture into Model itself, accessed via internal API and the service where the external data is loaded into the application. Which sounds pretty resonable approach and it&#8217;s a minor change in terms of MVC approach. I personally quite like it. THe next thing you would expect is SmartyPants to handle DI. Wrong! Guys working on Robotlegs decided to write their own dependecy injection tailored to Robotlegs. And so they did giving it anoter original name <a href="http://github.com/tschneidereit/SwiftSuspenders">SwiftSuspenders</a>. Cool thing about Robotlegs it that you are not limited to using SwiftSuspenders. You can choose your own Dependency Injector if you don&#8217;t like the one it comes with by default. I started digging a few days ago into RobotLegs and I must admit it is really fun thing to work with.<br />
It&#8217;s not what we had with pureMVC where you were told how to use it and that was it.<br />
There are a lot of discussions how Robotlegs should evolve, what should be added, removed and if you have anything good to suggest, you will be heard.<br />
I suggest you start following the <a href="http://groups.google.com/group/robotlegs">Robotlegs google group</a>.</p>
<p>I personally think it will be the next big framework, the pureMVC 2.0. The sooner you get into it the better. It works with Flex as well as Flash, which many of those other frameworks lack, they have no love for Flash. But is it the only solution that works with Flash as well as Flex? Certainly not. </p>
<p>Other player here is <a href="http://www.spicefactory.org/parsley/">Parsley</a>. Parsley has been developed by PowerFlasher, same guys who developed FDT. I haven&#8217;t played with it yet, it is definitely on my list. But following people opinions (which I don&#8217;t think is the best thing to do), I hear although it is pretty well documented, there is no community behind this framework. This is not gonna put me off but it definitely is a huge disadvantage. </p>
<p>Is that all?<br />
There is one more candidate on the horizon. Probably not many people have heard about this framework. It&#8217;s called <a href="http://wiki.github.com/sammyt/dawn/">Dawn</a>. Dawn relies on <del datetime="2009-11-19T10:52:12+00:00">SmartyPants</del> it&#8217;s own DI and is also inspired by <a href="http://code.google.com/p/google-guice/">Guice</a> (just like the SmartyPants itself). If you are into checking it out, I suggest you visit their site and if you live around London, Sam, the author, will be presenting it on next <a href="http://www.meetup.com/flexlondon/">FLUG</a> on 17th of November 2009.</p>
<p><strong>Summary</strong><br />
Robotlegs is gaining loads of momentum, it is definitely worth checking it out. I guess the whole DI stuff if fairly new and it is interesting how things are gonna go with it. But keep your eyes open on Parsley as this it the framework that apparently Adobe uses and their Caringorm 3 is pretty much gonna be like Parsley, from what I&#8217;ve heard. Also have a look at Dawn it might turn out to be also big. </p>
<p>If you have any questions, comments, or you disagree let me know <img src='http://tomkordys.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://tomkordys.net/blog/2009/11/09/dependency-injection-frameworks-and-other-latest-as3-trends-robotlegs-dawn-parsley/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
	</channel>
</rss>
