<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1674709460586515543</id><updated>2011-11-27T16:09:45.435-08:00</updated><category term='asp'/><category term='swiz'/><category term='.net'/><category term='flashvars'/><category term='actionscript'/><category term='maps'/><category term='fluint'/><category term='esri'/><category term='patterns'/><category term='flex'/><title type='text'>odoenet</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://odoenet.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1674709460586515543/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://odoenet.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>odoenet</name><uri>http://www.blogger.com/profile/17277007302886956525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1674709460586515543.post-9001396654323219933</id><published>2010-01-06T14:28:00.000-08:00</published><updated>2010-01-06T15:46:16.809-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='flex'/><category scheme='http://www.blogger.com/atom/ns#' term='flashvars'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='asp'/><title type='text'>Flex, FlashVars and your ASP.NET page</title><content type='html'>&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;So, I spent some time earlier today researching an issue that I had some trouble finding a straightforward answer for. A current project I am working on is a Flex Application that will be embedded inside an ASP.NET page. I needed for the ASP.NET page to pass some credentials and variables to the Flex Application that will be used to process some data. Seems pretty straightforward, and I know it can be done, I just haven't done it before. My .NET is a bit rusty, and the folks I'm working with have not tried passing variables to a Flex application or Flash file before. Now, I knew this could be accomplished via FlashVars inside an HTML page. The question I had was how to pass dynamic variables into the FlashVars via .NET and utilize those inside my Flex Application.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;That particular subject was tougher to track down than I thought. Most of the information I found was using some Visual Studio Add-In tool to display Flash files, or some forum would have a response to try &lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;lt;%= %&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt; and see if that worked, without much more detail. Now I realize, that if you are an ASP.NET guy, it makes perfect sense. For those of us with weak ASP foo, I realized that would give me a variable, but how to populate that variable? So I dug around some more, experimented, failed some more and after about 45 minutes of toying around, I found that I could create an asp Label in the ASP page, and use the  property to assign variables in my FlashVars. There is a ton of information out there on how to read FlashVars from Actionscript, so I won't bore you with details on that, but I will post my code below. Unfortunately, aspx pages won't work with my hosting, so I can't post a live example, but I think I've made them simple enough that you can figure it out.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;My Flex Application that will be compiled as FlashVars.swf&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;mx:Application&lt;br /&gt;xmlns:mx="http://www.adobe.com/2006/mxml"&lt;br /&gt;layout="vertical"&lt;br /&gt;addedToStage="init()"&amp;gt;&lt;br /&gt;&amp;lt;mx:Script&amp;gt;&lt;br /&gt;&amp;lt;![CDATA[&lt;br /&gt;[Bindable]&lt;br /&gt;private var _name : String;&lt;br /&gt;&lt;br /&gt;[Bindable]&lt;br /&gt;private var _session : String;&lt;br /&gt;&lt;br /&gt;private function init() : void {&lt;br /&gt;_name   = Application.application.parameters.name;&lt;br /&gt;_session   = Application.application.parameters.session;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;]]&amp;gt;&lt;br /&gt;&amp;lt;/mx:Script&amp;gt;&lt;br /&gt;&amp;lt;mx:Style&amp;gt;&lt;br /&gt;Label {&lt;br /&gt;fontFamily: Arial;&lt;br /&gt;fontSize: 14;&lt;br /&gt;fontWeight: bold;&lt;br /&gt;}&lt;br /&gt;&amp;lt;/mx:Style&amp;gt;&lt;br /&gt;&amp;lt;mx:Label text="Name: { _name }" /&amp;gt;&lt;br /&gt;&amp;lt;mx:Label text="Session: { _session }" /&amp;gt;&lt;br /&gt;&amp;lt;/mx:Application&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Here is what the aspx page looks like.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;lt;%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt;&lt;br /&gt;&amp;lt;head runat="server"&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;style type="text/css"&amp;gt;&lt;br /&gt;.style1&lt;br /&gt;{&lt;br /&gt;  font-family: Arial;&lt;br /&gt;  font-weight: bold;&lt;br /&gt;}&lt;br /&gt;&amp;lt;/style&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;form id="form1" runat="server"&amp;gt;&lt;br /&gt;&amp;lt;div class="style1"&amp;gt;&lt;br /&gt;&amp;lt;asp:Label ID="Label1" runat="server" Text="My Name: "&amp;gt;&amp;lt;/asp:Label&amp;gt;&lt;br /&gt;&amp;lt;asp:Label ID="MyName" runat="server" Text="myName"&amp;gt;&amp;lt;/asp:Label&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;div class="style1"&amp;gt;&lt;br /&gt;&amp;lt;asp:Label ID="Label4" runat="server" Text="Session: "&amp;gt;&amp;lt;/asp:Label&amp;gt;&lt;br /&gt;&amp;lt;asp:Label ID="SessionLabel" runat="server" Text="Session"&amp;gt;&amp;lt;/asp:Label&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;!-- SWF in ASP.NET --&amp;gt;&lt;br /&gt;&amp;lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"&lt;br /&gt;codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"&lt;br /&gt;width="500" height="500" id="myFlex" viewastext&amp;gt;&lt;br /&gt;&amp;lt;param name=myswf value="swf/FlashVars.swf"&amp;gt;&lt;br /&gt;&amp;lt;param name=quality value=autohigh&amp;gt;&lt;br /&gt;&amp;lt;param name=bgcolor value=black&amp;gt;&lt;br /&gt;&amp;lt;param name=”menu” value=”false” /&amp;gt;&lt;br /&gt;&amp;lt;param name="FlashVars" value=”init=yes&amp;amp;check=true&amp;amp;name=&amp;lt;%=MyName.Text%&amp;gt;&amp;amp;session=&amp;lt;%=SessionLabel.Text%&amp;gt;&amp;amp;”&amp;gt;&lt;br /&gt;&amp;lt;embed src="swf/FlashVars.swf" flashvars=”init=yes&amp;amp;check=true&amp;amp;name=&amp;lt;%=MyName.Text%&amp;gt;&amp;amp;session=&amp;lt;%=SessionLabel.Text%&amp;gt;&amp;amp;” quality=high bgcolor=#FFFFFF width="30" height="56"&lt;br /&gt;name="myswf" type="application/x-shockwave-flash"&lt;br /&gt;pluginspage="http://www.macromedia.com/go/getflashplayer"&amp;gt;&lt;br /&gt;&amp;lt;/embed&amp;gt;&lt;br /&gt;&amp;lt;/object&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:Georgia, serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Here is the key part from above. This is your FlashVars that has values that are tied to Lables in the asp page whose values are changed from the code-behind. It should be pretty simple to change this with any data you want .NET to pass on.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&amp;lt;param name="FlashVars" value=”init=yes&amp;amp;check=true&amp;amp;name=&amp;lt;%=MyName.Text%&amp;gt;&amp;amp;session=&amp;lt;%=SessionLabel.Text%&amp;gt;&amp;amp;”&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Here is the code-behind for the aspx page.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;&lt;br /&gt;public partial class _Default : System.Web.UI.Page&lt;br /&gt;{&lt;br /&gt;protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;this.MyName.Text = "odoenet";&lt;br /&gt;this.SessionLabel.Text = Session.SessionID.ToString();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:Georgia, serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;You can make this label hidden or maybe find a different way to bind your FlashVars. I just found this to be the simplest way to show how it can be done. If someone has a better solution or experience with this, please let me know.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;It might also interest some of you to check out &lt;/span&gt;&lt;a href="http://www.adobe.com/devnet/flex/articles/communicating_flex_dotnet_05.html"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;this page&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; about passing data to and from .NET web services and Flex applications. I was looking for this to find out how I can pass either an Array or as it turns out an ArrayCollection to a .NET Web Service to update a database.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Again, I realize this isn't ground-breaking material here, but I thought that if I had a tough time finding a straight answer, maybe some else will too and this might help them out.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1674709460586515543-9001396654323219933?l=odoenet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://odoenet.blogspot.com/feeds/9001396654323219933/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://odoenet.blogspot.com/2010/01/flex-flashvars-and-your-aspnet-page.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1674709460586515543/posts/default/9001396654323219933'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1674709460586515543/posts/default/9001396654323219933'/><link rel='alternate' type='text/html' href='http://odoenet.blogspot.com/2010/01/flex-flashvars-and-your-aspnet-page.html' title='Flex, FlashVars and your ASP.NET page'/><author><name>odoenet</name><uri>http://www.blogger.com/profile/17277007302886956525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1674709460586515543.post-3960651768501450394</id><published>2009-12-11T23:45:00.000-08:00</published><updated>2009-12-12T00:32:57.629-08:00</updated><title type='text'>ESRI Flex Map with Robotlegs</title><content type='html'>&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Well, I'm not really one to leave well enough alone and I just had to give another Flex framework a try for my ESRI Flex mapping needs. My latest victim was &lt;a href="http://www.robotlegs.org/"&gt;Robotlegs&lt;/a&gt;. If you look at my earlier blog postings, you might have seen me mention that my first Flex framework was Cairngorm. I didn't really dislike Cairngorm, but after some conferences and reading around, I felt like I should expand my Framework horizons. Most recently I have been using Swiz with a lot of success. I think I use Swiz in the most minimal way possible, which is actually something for a future blog posting.&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;But I had also tried at one point to give Robotlegs a try. I had worked through some of the docs, but had not really dived into any of the examples. So I finally decided that I needed to get my feet wet a bit and dived into &lt;a href="http://www.vimeo.com/7524637"&gt;some&lt;/a&gt; &lt;a href="http://www.vimeo.com/7569666"&gt;reading&lt;/a&gt; &lt;a href="http://joelhooks.com/"&gt;material&lt;/a&gt;. Joel Hooks had a posting of a &lt;a href="http://joelhooks.com/2009/11/14/texflex09-robotlegs-slides-and-a-robotlegs-t-shirt-giveaway/"&gt;presentation&lt;/a&gt; that I particularly enjoyed. So after some trial and error, I think I wrapped my head around the basics of Robotlegs. Like Swiz, Robotlegs utilizes metadata to support &lt;a href="http://wiki.github.com/robotlegs/robotlegs-framework/best-practices#dependencyinjection"&gt;Dependency Injection&lt;/a&gt; in the framework. I'll be honest here, I'm spoiled, I don't know how to do dependency injection in Flex/AS3 manually. Adding that to my list of things to learn. Anyway, this makes tying classes and events together pretty simple.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;After a couple of hours of watching videos and creeping through some examples, I was able to come up with this &lt;a href="http://odoe.net/thelab/flex/robotlegsmap/RobotLegsMap.html"&gt;example&lt;/a&gt;, with &lt;a href="http://odoe.net/thelab/flex/robotlegsmap/srcview/index.html"&gt;view source&lt;/a&gt; enabled of course. Now, as far as Flex Mapping applications go, this is about as simple as it gets and as far as I wanted to go tonight as it's getting late. But the basics are in there. You have a map, with it's layers and extent tied to a model. You have a datagrid tied to a custom ListCollection ( I took portions of this from another project I'm working on ) and a graphicslayer that gets highlighted when you click on the datagrid. And of course a QueryTask to handle getting attribute information. Most folks that work with Flex Maps using the ESRI Flex API will be familiar with this and realize this is probably the starting point for about 90% of your projects.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Now on to my impressions of Robotlegs. I will say this, Robotlegs got me in the mindset of the &lt;a href="http://en.wikipedia.org/wiki/Single_responsibility_principle"&gt;Single Responsibility Principle&lt;/a&gt; when I was going through my project. For example, I have a command to query the States Service and a command o handle the results. In most of my recent work, I had one controller doing both those tasks. Now, I'm not going to go "programmer purgatory" for using my controllers that way and the only coding cookie I'll get for wanting to follow that principle is the sugar cookies my wife and kids make, but it is one of those things I have found makes maintaining and testing of code easier. My only complaint would be is that I found, even looking at examples, is that the code started looking a little "Cairngormish". By that I mean, I had to manually wire my events to my commands. This started looking an awful lot like the FrontControllers I'd seen in previous apps.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;One other thing bothered me, but I'm sure it has more to do with my following examples as opposed to really knowing how to use the framework is the need to override functions and extend Robotlegs classes for everything. Something I have been trying to do, is keep 3rd party APIs that aren't specific to the output of my app as minimal as possible. That's actually a topic for a later post, but it was something I found odd as I worked through my first real attempt. But like I said, I have a feeling that as I get more familiar with Robotlegs, I can find a nice balance to keep the framework implementation as minimal as possible. Something I really liked was the Mediator for views. I have been using the Presentation Model on my most recent work app and I'm a big fan of using a model for my view that can be tested independently. The Mediator class in Robotlegs is a very nice way of keeping your views as "dumb" as possible.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;So, that's it for my first run at Robotlegs. I'm going to dive into it some more and try some things to see how I like using it most. I'm sure the more I use it, the more I'll enjoy it. It's nice having another tool in my Flex toolbox that I can pound on something with.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1674709460586515543-3960651768501450394?l=odoenet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://odoenet.blogspot.com/feeds/3960651768501450394/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://odoenet.blogspot.com/2009/12/esri-flex-map-with-robotlegs.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1674709460586515543/posts/default/3960651768501450394'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1674709460586515543/posts/default/3960651768501450394'/><link rel='alternate' type='text/html' href='http://odoenet.blogspot.com/2009/12/esri-flex-map-with-robotlegs.html' title='ESRI Flex Map with Robotlegs'/><author><name>odoenet</name><uri>http://www.blogger.com/profile/17277007302886956525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1674709460586515543.post-8778843536669686099</id><published>2009-12-09T08:06:00.001-08:00</published><updated>2009-12-12T09:37:52.224-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='flex'/><category scheme='http://www.blogger.com/atom/ns#' term='maps'/><category scheme='http://www.blogger.com/atom/ns#' term='esri'/><category scheme='http://www.blogger.com/atom/ns#' term='actionscript'/><title type='text'>Highlight Map from List Items</title><content type='html'>&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;I was inspired by &lt;a href="http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2009/02/19/Sychronizing-map-and-datagrid-interaction-with-the-ArcGIS-API-for-Flex.aspx"&gt;this posting&lt;/a&gt; on the ESRI ArcGIS Server Blog filed in the Flex tag, that linked your graphics on a map with a DataGrid. This is a useful function and one I thought could be encapsulated into it's own task. In my case, I just had a need to highlight a graphic on my map that was associated with a list. I did not need to highlight the list when I hovered over the map because I have designed my Graphics with tooltips and felt that two-way binding would be "too much" flash for business purposes. You certainly encapsulate that function and if I were to do so, would probably build it into a utility type of class. With that said, here is the code.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;package net.odoe.model.graphic&lt;br /&gt;{&lt;br /&gt;import com.esri.ags.Graphic;&lt;br /&gt;import com.esri.ags.geometry.Geometry;&lt;br /&gt;import com.esri.ags.layers.GraphicsLayer;&lt;br /&gt;import com.esri.ags.symbol.SimpleFillSymbol;&lt;br /&gt;import com.esri.ags.symbol.SimpleLineSymbol;&lt;br /&gt;import com.esri.ags.symbol.SimpleMarkerSymbol;&lt;br /&gt;import com.esri.ags.symbol.Symbol;&lt;br /&gt;&lt;br /&gt;public class HighlightGraphic extends Graphic&lt;br /&gt;{&lt;br /&gt;protected var _defaultSymbol : Symbol = new Symbol();&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* This function will save the default graphic symbology&lt;br /&gt;* highlight the graphic for the currently selected item.&lt;br /&gt;* @param data that holds attribute information; i.e. from a ListEvent (event.itemRenderer.data).&lt;br /&gt;* @param graphicsLayer that holds the graphics that can be selected.&lt;br /&gt;* @return a higlighted graphic.&lt;br /&gt;*&lt;br /&gt;*/&lt;br /&gt;public function setHighlightGraphic( data : Object, graphicsLayer : GraphicsLayer ) : Graphic {&lt;br /&gt; if( graphicsLayer ) {&lt;br /&gt;   _defaultSymbol = findGraphicByAttribute( data , graphicsLayer).symbol;&lt;br /&gt;   return featureHighlight( data, graphicsLayer );&lt;br /&gt; }&lt;br /&gt; return new Graphic();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;* This function will reset the previously selected graphic&lt;br /&gt;* to its default symbology.&lt;br /&gt;* @param data that holds attribute information; i.e. from a ListEvent (event.itemRenderer.data).&lt;br /&gt;* @param graphicsLayer that holds the graphics that can be selected.&lt;br /&gt;* @return default graphic.&lt;br /&gt;*&lt;br /&gt;*/&lt;br /&gt;public function resetDefaultGraphic( data : Object, graphicsLayer : GraphicsLayer ) : Graphic {&lt;br /&gt; if( graphicsLayer ) {&lt;br /&gt;   var _graphic : Graphic = findGraphicByAttribute( data, graphicsLayer );&lt;br /&gt;   _graphic.symbol = _defaultSymbol;&lt;br /&gt;   return _graphic;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; return new Graphic();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//------------------------------------------------------------------------------------------------------&lt;br /&gt;//----PROTECTED METHODS---------------------------------------------------------------------------------&lt;br /&gt;//------------------------------------------------------------------------------------------------------&lt;br /&gt;protected function findGraphicByAttribute( attributes : Object, graphicsLayer : GraphicsLayer ) : Graphic {&lt;br /&gt;       for each( var graphic : Graphic in graphicsLayer.graphicProvider ) {&lt;br /&gt;           if ( graphic.attributes == attributes )&lt;br /&gt;           {&lt;br /&gt;               return graphic;&lt;br /&gt;           }&lt;br /&gt;       }       &lt;br /&gt;       return new Graphic();&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   protected function featureHighlight( data : Object, graphicsLayer : GraphicsLayer ) : Graphic {&lt;br /&gt;     if( graphicsLayer ) {&lt;br /&gt;       var _graphic : Graphic = findGraphicByAttribute( data, graphicsLayer );&lt;br /&gt;       _graphic.symbol = highLightSymbol( _graphic.geometry );&lt;br /&gt;       return _graphic;&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;     return new Graphic();&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   protected function highLightSymbol( geometry : Geometry ) : Symbol {&lt;br /&gt;     if( geometry.type == Geometry.POLYLINE ) {&lt;br /&gt;       var _highlightLineSymbol : SimpleLineSymbol = new SimpleLineSymbol;&lt;br /&gt;   _highlightLineSymbol.color = 0xFF00FF;&lt;br /&gt;   _highlightLineSymbol.width = 10;&lt;br /&gt;&lt;br /&gt;   return _highlightLineSymbol;&lt;br /&gt;     }&lt;br /&gt;     if( geometry.type == Geometry.MAPPOINT ) {&lt;br /&gt;   var _outline : SimpleLineSymbol = new SimpleLineSymbol;&lt;br /&gt;   _outline.style = "solid";&lt;br /&gt;   _outline.color = 0x0000CD;&lt;br /&gt;   _outline.width = 2;&lt;br /&gt;&lt;br /&gt;   var _highlightPtSymbol : SimpleMarkerSymbol = new SimpleMarkerSymbol;&lt;br /&gt;   _highlightPtSymbol.style = "circle";&lt;br /&gt;   _highlightPtSymbol.color = 0xFF00FF;&lt;br /&gt;   _highlightPtSymbol.size = 15;&lt;br /&gt;   _highlightPtSymbol.alpha = 1;&lt;br /&gt;   _highlightPtSymbol.outline = _outline;&lt;br /&gt;&lt;br /&gt;   return _highlightPtSymbol;&lt;br /&gt;     }&lt;br /&gt;     if( geometry.type == Geometry.POLYGON ) {&lt;br /&gt;   var _outlinePoly : SimpleLineSymbol = new SimpleLineSymbol();&lt;br /&gt;   _outlinePoly.style = "solid";&lt;br /&gt;   _outlinePoly.color = 0x0000CD;&lt;br /&gt;   _outlinePoly.width = 2;&lt;br /&gt;&lt;br /&gt;       var _highlightPolySymbol : SimpleFillSymbol = new SimpleFillSymbol;&lt;br /&gt;   _highlightPolySymbol.style = "solid";&lt;br /&gt;   _highlightPolySymbol.color = 0x00FFFF;&lt;br /&gt;   _highlightPolySymbol.alpha = 0.3;&lt;br /&gt;   _highlightPolySymbol.outline = _outlinePoly;&lt;br /&gt;&lt;br /&gt;   return _highlightPolySymbol;&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;     return new Symbol();&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;I have made the functions in here protected, as I found a need at a later time to extend this class and override the protected function findGraphicByAttribute to recognize a particular attribute field (i.e. graphic.attributes.Name == attributes.Name) and not just all attributes.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;I made an example of the function just like the one on the ESRI ArcGIS Server Blog using my class.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;It can be found &lt;a href="http://odoe.net/thelab/flex/highlightmap/Index.html"&gt;here&lt;/a&gt; with &lt;a href="http://odoe.net/thelab/flex/highlightmap/srcview/index.html"&gt;View Source&lt;/a&gt; enabled. Hope this benefits someone.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1674709460586515543-8778843536669686099?l=odoenet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://odoenet.blogspot.com/feeds/8778843536669686099/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://odoenet.blogspot.com/2009/12/highlight-map-from-list-items.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1674709460586515543/posts/default/8778843536669686099'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1674709460586515543/posts/default/8778843536669686099'/><link rel='alternate' type='text/html' href='http://odoenet.blogspot.com/2009/12/highlight-map-from-list-items.html' title='Highlight Map from List Items'/><author><name>odoenet</name><uri>http://www.blogger.com/profile/17277007302886956525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1674709460586515543.post-7510766408944242164</id><published>2009-11-04T10:52:00.000-08:00</published><updated>2009-11-04T12:04:16.635-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='patterns'/><category scheme='http://www.blogger.com/atom/ns#' term='swiz'/><category scheme='http://www.blogger.com/atom/ns#' term='esri'/><title type='text'>ESRI Flex Application using Presentation Model Pattern with Swiz</title><content type='html'>&lt;span class="Apple-style-span"  style="color:#FFFFFF;"&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;So continuing on my quest to be a better developer, I have really dived in deep to the &lt;a href="http://swizframework.org/"&gt;Swiz framework&lt;/a&gt;.I have learned quite a bit since my last postings and I think I have gotten a really solid grasp on how to leverage the framework to meet my needs. Inspired by Ben Clinkinbeard's &lt;a href="http://www.benclinkinbeard.com/2009/05/swiz-example-application-with-presentation-model-pattern/"&gt;Presentation Model Pattern using Swiz&lt;/a&gt;, I set out to try and build an ESRI web mapping sample in the same manner.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;a href="http://odoe.net/thelab/flex/swizmappresentationmodel/SwizMapPresentationModel.html"&gt;This is my result&lt;/a&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;So, I read through some of &lt;a href="http://martinfowler.com/eaaDev/PresentationModel.html"&gt;this&lt;/a&gt; in addition to Ben's example above and this how I interpreted using the Presentation Model Pattern.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://odoe.net/thelab/flex/swizmappresentationmodel/presomodel.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 453px; height: 454px;" src="http://odoe.net/thelab/flex/swizmappresentationmodel/presomodel.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;( I prefer yellow sticky notes for complex explanations )&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;What I liked about this pattern was that I'm able to keep the view as dumb as possible, so less can go wrong from here. The Presentation Model represents what happens in the view including values and events. The Presentation Model is responsible for dispatching events you would normally dispatch from the view. Controller does the work, utilizing delegates when needed and updating Autowired values to the model. If you look at the &lt;a href="http://odoe.net/thelab/flex/swizmappresentationmodel/srcview/index.html"&gt;source&lt;/a&gt; for my example, you'll see I made some comments about having issues with a couple of Autowired items that I could not get to update directly in the Controller, I had to set custom setValues(value:Object) setters for the model and use that. I would prefer the Controller not even be aware of the model, and I think I may be able to accomplish this with an IEventDispatcher and using the Controller as a Protocol in my SwizConfig, but for the points I was trying to illustrate, I don't think it was really needed here.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;You may also notice I am using &lt;a href="http://opensource.adobe.com/wiki/display/flexunit/FlexUnit+4+feature+overview"&gt;FlexUnit 4&lt;/a&gt; to do some testing. I am just now starting to utilize unit testing as I build my applications and FlexUnit 4 has some nice features I am playing with. Testing is part of the reason I want to try and keep my Presentation Models and my Controllers as independent of each other as much as I can, to prevent any funny business from occurring when I try to maintain my tests as an application grows.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;This is just another of my experiments in my quest to be a better developer. As I have said before, I just kind of fell into this, so a lot of these concepts are still new to me. I'm fairly comfortable with the &lt;a href="http://resources.esri.com/arcgisserver/apis/flex/"&gt;ESRI Flex API&lt;/a&gt; at this point. Now, I'm trying to really grasp how to use design patterns and testing practices to improve my work.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="line-height: 18px; font-family:arial, helvtica, sans-serif;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="color:#FFFFFF;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1674709460586515543-7510766408944242164?l=odoenet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://odoenet.blogspot.com/feeds/7510766408944242164/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://odoenet.blogspot.com/2009/11/esri-flex-application-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1674709460586515543/posts/default/7510766408944242164'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1674709460586515543/posts/default/7510766408944242164'/><link rel='alternate' type='text/html' href='http://odoenet.blogspot.com/2009/11/esri-flex-application-using.html' title='ESRI Flex Application using Presentation Model Pattern with Swiz'/><author><name>odoenet</name><uri>http://www.blogger.com/profile/17277007302886956525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1674709460586515543.post-3484491154542391006</id><published>2009-10-23T21:28:00.000-07:00</published><updated>2009-10-24T14:28:05.340-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='flex'/><category scheme='http://www.blogger.com/atom/ns#' term='swiz'/><category scheme='http://www.blogger.com/atom/ns#' term='esri'/><title type='text'>Swiz and the ESRI API, we meet again.</title><content type='html'>&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;So, I spent quite a bit of time this week really trying to wrap my head around using the Swiz framework with the &lt;/span&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;ESRI&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; Flex &lt;/span&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;API&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;. I found the actual &lt;/span&gt;&lt;/span&gt;&lt;a href="http://swizframework.org/"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Swiz website&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;, which somehow never came up in all my earlier research. It gave me some details on things I wasn't clear on before.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;I also found this video by Joe &lt;/span&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Rinehart&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;, &lt;/span&gt;&lt;/span&gt;&lt;a href="http://www.firemoss.com/index.cfm/2009/10/21/Swiz-in-20-minutes-video--byebye-boilerplate"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Swiz in 20 minutes&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Videos like this are great, because it just helps to hear and see someone go &lt;/span&gt;&lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_3"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;through it&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; from start to finish. With my new found information, I was ready to tackle a new version of the application I posted earlier. What I have found, is the Swiz framework really gives you a lot of freedom in how you actually want to write your code. How I use it in my style, may not work for someone e&lt;/span&gt;&lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_4"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;lse's&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; style. I really like that. You can also get a good explanation of the framework and metadata &lt;/span&gt;&lt;a href="http://swizframework.org/docs/getting-started/"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;here&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;So, rewrote my previous example, to incorporate a tighter distinction between views and controllers. Found &lt;/span&gt;&lt;/span&gt;&lt;a href="http://odoe.net/thelab/flex/swizmapsimple/SwizMapSimple.html"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;here&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; (source available).&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;I now make liberal use of the &lt;/span&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Autowire&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; &lt;/span&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;metadata&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;, which links all my functions and variables through my beans. I'm also making good use of the Mediate tag, that will capture events.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;For example, in my Controller, I have this.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="color:#CCFFFF;"&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;public static const QUERY_LAYER : String = "queryLayer";&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#CCFFFF;"&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Then, from any other view or controller, I can use this.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#CCFFFF;"&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;Swiz.dispatchEvent( new Event( LayerController.QUERY_LAYER ) );&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="color:#CCFFFF;"&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;In my Controller, I have this.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="color:#CCFFFF;"&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;[Mediate( event="queryLayer" )]&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;public function queryStateLayer() : void {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;trace( "begin queryStateLayer" );&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;Swiz.dispatchEvent( new Event( LayerController.LOAD_STARTED ) );&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;var query:Query = new Query();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;query.returnGeometry = false;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;query.outFields = [ "STATE_NAME", "AREA" ]&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;query.where = "STATE_NAME &lt;&gt; ''";&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;AsyncToken( stateDelegate.execute( query ).addResponder( new Responder( state_results, state_fault ) ) );&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Using the Mediate metadata, telling it to watch for the "&lt;/span&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_20"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;queryLayer&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;" event, it will fire this function whenever that occurs.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;As can be seen above, I am using the &lt;/span&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_21"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;AsynToken&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; function to call a delegate that will execute my query task. You don't need to use a delegate. You could execute your task directly in the controller. I like to keep my delegates separate only because it makes sense to me, as my first framework was &lt;/span&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_22"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Cairngorm&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; and that was pretty standard. I also think it keeps the controller a little cleaner.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;My biggest hurdles were trying to interpret many of the Swiz tutorials to fit into an application with an &lt;/span&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_23"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;ESRI&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; Map control, where you want interaction between the map, the layers and your controls. Swiz now supports adding Views to your beans, although from what I have read, you may want to do so only in special circumstances. But that could be another option, is to add the Map into your beans and open it up to all controllers and functions in your application.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;One big hurdle that I have not been able to figure out is Unit Testing with the Swiz framework. I have tried with &lt;/span&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_24"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Fluint&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; and Flex Unit to no avail, although I have heard that the &lt;/span&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_25"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Autowire&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; and separation of  controllers should really make this a simple task, especially in &lt;/span&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_26"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Fluint&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;. When I try in &lt;/span&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_27"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Fluint&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;, I load my beans in override &lt;/span&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_28"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;setUp&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;. I &lt;/span&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_29"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Autowire&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; my controller and models as I think I should. I can dispatch an event to my controller and my trace show that my app runs just as it should, but when I check an &lt;/span&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_30"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Autowired&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; value such as an &lt;/span&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_31"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;ArrayCollection&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;, it's null, even though it should not be. It's driving me nuts. I'm having the same issue with Flex Unit, my application traces show everything runs, but at the end, my &lt;/span&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_32"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Autowire&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; values are still null.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;If someone could look at my example and maybe write a quick &lt;/span&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_33"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Fluint&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; or Flex Unit test for say the &lt;/span&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_34"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;StateListCollection&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;, I would be eternally grateful as it would really just push me in the right direction. I was hoping to incorporate unit testing from the very beginning of all my future applications, but this is really just killing me now.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1674709460586515543-3484491154542391006?l=odoenet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://odoenet.blogspot.com/feeds/3484491154542391006/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://odoenet.blogspot.com/2009/10/swiz-and-esri-api-we-meet-again.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1674709460586515543/posts/default/3484491154542391006'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1674709460586515543/posts/default/3484491154542391006'/><link rel='alternate' type='text/html' href='http://odoenet.blogspot.com/2009/10/swiz-and-esri-api-we-meet-again.html' title='Swiz and the ESRI API, we meet again.'/><author><name>odoenet</name><uri>http://www.blogger.com/profile/17277007302886956525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1674709460586515543.post-2771083579996105829</id><published>2009-10-18T18:03:00.000-07:00</published><updated>2009-10-24T13:48:23.485-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='flex'/><category scheme='http://www.blogger.com/atom/ns#' term='maps'/><category scheme='http://www.blogger.com/atom/ns#' term='swiz'/><category scheme='http://www.blogger.com/atom/ns#' term='fluint'/><title type='text'>Mapping apps with Flex, Swiz and Fluint</title><content type='html'>&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;I have been developing with Flex for about a year now and so far it has been a really fun experience. I am by no means a trained developer, I just happened to have taken some some C++ and VB6 courses in school and fell into it.&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;That being said, I had very little clue how to use a framework when developing, much less how (or why for that matter) to do unit testing. I saw a great presentation at the &lt;/span&gt;&lt;a href="http://proceedings.esri.com/library/userconf/devsummit09/index.html"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;ESRI 2009 Developer Summit&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; last year on &lt;/span&gt;&lt;a href="http://resources.esri.com/arcgisserver/apis/flex/index.cfm?fa=mediaGalleryDetails&amp;amp;mediaID=6D74B9C4-1422-2418-345AC9BAFA21FB23"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Flex Best Practices&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;. It was in that session that I learned how much I had been doing wrong. I guess, I shouldn't say wrong, after all, the application I was working on worked. Problem was, when someone wanted to add a new feature or change the way something worked, I found myself spending a lot of time trying to fix things I had broken by doing so.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;That's when I first started using &lt;/span&gt;&lt;a href="http://opensource.adobe.com/wiki/display/cairngorm/Cairngorm;jsessionid=3ED7D3EB32D8CEF3025F23B2CAEA24E7"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Cairngorm&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;. &lt;/span&gt;&lt;a href="http://www.davidtucker.net/category/cairngorm/"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;This site&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; has some great articles and videos on Cairngorm. That's where I learned how to use it. Cairngorm seemed like a great way to organize my code and in the end it just made sense. It can be a little clunky and as I have read elsewhere a bit heavy on boiler plate code. You launch an event that's tied to a command that executes a delegate and then process the results updating your model. Makes perfect sense to me. Then I discovered unit testing. It was discussed in that presentation I mentioned, but I didn't think it really applied to me. After all, I was the only person developing this application and why would I need unit testing, Cairngorm kept everything organized for me. That is until my model got a bit large, my commands dispatched more events to more commands, I was using timers to keep consecutive asynchronous tasks to the same functions from overlapping and I found a change here would break something somewhere else and would go unnoticed until I tried to show someone something cool I had done only to find something else didn't work (yeah, that looks really cool).&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;So, like any Flex developer would do (I actually have no idea what a real Flex developer would do) I tried out&lt;/span&gt;&lt;a href="http://opensource.adobe.com/wiki/display/flexunit/FlexUnit"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; FlexUnit&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;. FlexUnit worked and looked good too. However, have you ever tried to do unit testing with Cairngorm and FlexUnit? Do a web search on that particular subject. It took me a few tries, but I got something working. I realized at this point why Test Driven Driven development has such a good reputation. It works. I've decided to approach all my future projects this way.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;But I thought this post was titled "Mapping apps with Flex, Swiz and Fluint", why am I rambling on about Cairngorm and FlexUnit? This is my first blog post, give me a break. Did I mention that the only Flex development I have done is mapping applications with &lt;/span&gt;&lt;a href="http://resources.esri.com/arcgisserver/apis/flex/"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;ESRI's Flex API&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;? Now, I know I'm not alone in having my first Flex experience be with the ESRI Flex API. It's fairly new and it's a niche market. We are a niche group. Now out of that group of ESRI Flex API developers (I use the term developer loosely for myself) also use a Framework of some sort? Okay now, I know this list might be short, but out of that group, how many are doing or attempted test driven development?&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;You can see where I might have been frustrated trying to research that particular subject. When dealing with a mapping application, there is a lot going on. You have a map that you might want multiple functions to access and adjust an extent for, you have multiple map services that you want exposed to other functions so you can turn off layers or adjust transparencies, not mention use query tasks or identify (I'm sure it's just as bad for you real Flex developers if not worse). A framework really lets you get a good grasp on these things. Utilizing testing of some sort is just a cherry on top. Because of some frustrations I had with Cairngorm, I decided to research some more frameworks that I thought lent themselves quite well to mapping applications specifically.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;That's when I turned to &lt;/span&gt;&lt;a href="http://code.google.com/p/swizframework/"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Swiz&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;. I really did not like Swiz when I looked at it. I mean, come on, Beans? I thought that was a Java thing? But I decided to buckle down and really take a crack at it. So I took one of the&lt;/span&gt;&lt;a href="http://resources.esri.com/help/9.3/arcgisserver/apis/flex/samples/index.html"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; ESRI Samples&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; from their website and adjusted it to work in the Swiz framework with some minor tweaks to display a grid of state names. That took me a full Saturday. Being the overambitious glutton for punishment that I am, I decided to try to do some unit testing with &lt;/span&gt;&lt;a href="http://code.google.com/p/fluint/"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Fluint&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;. But why not Flex Unit you might ask? Fluint was touted at the 2009 Developer Summit I went to as being a little more robust. Plus, I figured, I wanted to learn something new. Fluint has some nice features, and I think the most powerful is the ability to add steps to your test and then run it.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;So, after spending all weekend, reading multiple tutorials, multiple blogs and forum posts, I got a working, testable (and passing thank goodness) application put together. I figured, someone out there, might be in my situation. Using the ESRI Flex API, trying to wrap their heads around a framework and maybe, just maybe trying to do some unit testing. I did not find a specific example like that anywhere. If you got one, please share it.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Remember, in &lt;a href="http://odoe.net/thelab/flex/swizmapfluint/Index.html"&gt;my example&lt;/a&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; (view source available), I am probably doing a lot wrong. I have my map in my Beans (that sounds hilarious) with a controller, a delegate and a component to control my list of states. I'm kind of thinking that in the way I'm using it, my Beans replace my model. It exposes what I want to everything else in my application. Originally, my map was just part of a single component with a datagrid. I parted it out, so that I could add a function to zoom to a state on a datagrid double click. I need my map accessible outside that page. I probably make some wrong assumptions here, but I haven't tried that part yet.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;If you are curious on what sites I used as references, here is a list.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.briankotek.com/blog/index.cfm/2009/1/8/Using-Swiz-Part-1-Initial-Setup"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Brian Kotek&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; had an awesome 5-part series on Swiz. There is supposed to be more coming, so I'm sure I'll change how I use it as I learn more of the stuff he didn't post yet. Not to knock the Swiz &lt;/span&gt;&lt;a href="http://code.google.com/p/swizframework/wiki/GettingStarted"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Getting Started&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; page, but I had a tough time really grasping it with their walk-through.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;This &lt;/span&gt;&lt;a href="http://www.insideria.com/2008/10/automated-testing-and-you-self.html"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;insideria article&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; gave me a good start at using Fluint. The Fluint &lt;/span&gt;&lt;a href="http://code.google.com/p/fluint/wiki/GettingStarted"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Getting Started&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; pages were a big help as well.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;And if you bothered reading all this, I assume you are interested in Mapping applications using Flex with a framework while taking advantage of unit tests. I hope I have helped in your unholy quest. &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Sorry, if this wasn't "tutorial" or more specific. If someone has questions (all one of you), I'll try to answer them the best I can. The couple of guys linked above know more than I do about Swiz and Fluint, but I have a newbie perspective on it when it comes to the mapping stuff if you need it. I'll probably still use Cairngorm for stuff already done that way, so might post an example up with that later on. I'm hoping to tackle &lt;/span&gt;&lt;a href="http://mate.asfusion.com/"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Mate&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; next weekend, so we'll see how that one goes.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1674709460586515543-2771083579996105829?l=odoenet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://odoenet.blogspot.com/feeds/2771083579996105829/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://odoenet.blogspot.com/2009/10/mapping-apps-with-flex-swiz-and-fluint.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1674709460586515543/posts/default/2771083579996105829'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1674709460586515543/posts/default/2771083579996105829'/><link rel='alternate' type='text/html' href='http://odoenet.blogspot.com/2009/10/mapping-apps-with-flex-swiz-and-fluint.html' title='Mapping apps with Flex, Swiz and Fluint'/><author><name>odoenet</name><uri>http://www.blogger.com/profile/17277007302886956525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
