<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Flex Best Practices &#8211; Events</title>
	<atom:link href="http://www.unitedmindset.com/jonbcampos/2009/08/12/flex-best-practices-events/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.unitedmindset.com/jonbcampos/2009/08/12/flex-best-practices-events/</link>
	<description>Blog on technology and software development typically around Adobe Flash, Flex, and AIR.</description>
	<lastBuildDate>Wed, 25 Jan 2012 11:21:07 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Jonathan Campos</title>
		<link>http://www.unitedmindset.com/jonbcampos/2009/08/12/flex-best-practices-events/#comment-223</link>
		<dc:creator>Jonathan Campos</dc:creator>
		<pubDate>Fri, 14 May 2010 13:47:13 +0000</pubDate>
		<guid isPermaLink="false">http://unitedmindset.com/jonbcampos/?p=675#comment-223</guid>
		<description>@manimaran Have you followed these steps?: http://opensource.adobe.com/wiki/display/flexpmd/FlexPMD+Eclipse+plugin

This is a video created by Adobe that walks you through step by step. And since Flash Builder is built on Eclipse, these instructions are 100% applicable to Flash Builder.</description>
		<content:encoded><![CDATA[<p>@manimaran Have you followed these steps?: <a href="http://opensource.adobe.com/wiki/display/flexpmd/FlexPMD+Eclipse+plugin" rel="nofollow">http://opensource.adobe.com/wiki/display/flexpmd/FlexPMD+Eclipse+plugin</a></p>
<p>This is a video created by Adobe that walks you through step by step. And since Flash Builder is built on Eclipse, these instructions are 100% applicable to Flash Builder.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Manimaran</title>
		<link>http://www.unitedmindset.com/jonbcampos/2009/08/12/flex-best-practices-events/#comment-222</link>
		<dc:creator>Manimaran</dc:creator>
		<pubDate>Fri, 14 May 2010 07:43:40 +0000</pubDate>
		<guid isPermaLink="false">http://unitedmindset.com/jonbcampos/?p=675#comment-222</guid>
		<description>Can you please tell me the guidelines to setup the FlexPMD in my Flash Builder , i followed the given steps , but when i run FlexPMD it is not showing any violations in the code eventhough the code has.</description>
		<content:encoded><![CDATA[<p>Can you please tell me the guidelines to setup the FlexPMD in my Flash Builder , i followed the given steps , but when i run FlexPMD it is not showing any violations in the code eventhough the code has.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Campos</title>
		<link>http://www.unitedmindset.com/jonbcampos/2009/08/12/flex-best-practices-events/#comment-221</link>
		<dc:creator>Jonathan Campos</dc:creator>
		<pubDate>Thu, 18 Mar 2010 16:36:59 +0000</pubDate>
		<guid isPermaLink="false">http://unitedmindset.com/jonbcampos/?p=675#comment-221</guid>
		<description>Completely agree. FlexPMD and FlexCPD are amazing and great tools!</description>
		<content:encoded><![CDATA[<p>Completely agree. FlexPMD and FlexCPD are amazing and great tools!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ashish Desai</title>
		<link>http://www.unitedmindset.com/jonbcampos/2009/08/12/flex-best-practices-events/#comment-220</link>
		<dc:creator>Ashish Desai</dc:creator>
		<pubDate>Thu, 18 Mar 2010 16:33:18 +0000</pubDate>
		<guid isPermaLink="false">http://unitedmindset.com/jonbcampos/?p=675#comment-220</guid>
		<description>User FlexPMD and FlexCPD to enforce the best practices in your code base.  You can configure it in flash builder and Flex Builder. Below is the link you might be interested in http://opensource.adobe.com/wiki/display/flexpmd/FlexPMD. We religiously follow these in all our development tasks.

You can create your custom rulesets to enforce more specific best practices.</description>
		<content:encoded><![CDATA[<p>User FlexPMD and FlexCPD to enforce the best practices in your code base.  You can configure it in flash builder and Flex Builder. Below is the link you might be interested in <a href="http://opensource.adobe.com/wiki/display/flexpmd/FlexPMD" rel="nofollow">http://opensource.adobe.com/wiki/display/flexpmd/FlexPMD</a>. We religiously follow these in all our development tasks.</p>
<p>You can create your custom rulesets to enforce more specific best practices.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Campos</title>
		<link>http://www.unitedmindset.com/jonbcampos/2009/08/12/flex-best-practices-events/#comment-219</link>
		<dc:creator>Jonathan Campos</dc:creator>
		<pubDate>Sun, 27 Dec 2009 18:21:48 +0000</pubDate>
		<guid isPermaLink="false">http://unitedmindset.com/jonbcampos/?p=675#comment-219</guid>
		<description>@ashok If you haven&#039;t gotten into Flex/AS3 programming too much I would think Mate would help you get along rather quickly as it is mainly a tag based mvc framework. If you are feeling up on your skills, try Parsley or Robotlegs. Two frameworks that rely on IOC (Inversion of Control) and are gaining lots of popularity. Finally the de-facto is Cairngorm, a framework that most developers start. You could try also try PureMVC, though I feel it takes a lot of setup to get going. I hope that helps. These days I use each of these frameworks at some level and feel they are all strong frameworks, so I would say pick one and just get started.</description>
		<content:encoded><![CDATA[<p>@ashok If you haven&#8217;t gotten into Flex/AS3 programming too much I would think Mate would help you get along rather quickly as it is mainly a tag based mvc framework. If you are feeling up on your skills, try Parsley or Robotlegs. Two frameworks that rely on IOC (Inversion of Control) and are gaining lots of popularity. Finally the de-facto is Cairngorm, a framework that most developers start. You could try also try PureMVC, though I feel it takes a lot of setup to get going. I hope that helps. These days I use each of these frameworks at some level and feel they are all strong frameworks, so I would say pick one and just get started.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ashok</title>
		<link>http://www.unitedmindset.com/jonbcampos/2009/08/12/flex-best-practices-events/#comment-218</link>
		<dc:creator>Ashok</dc:creator>
		<pubDate>Sun, 27 Dec 2009 07:20:26 +0000</pubDate>
		<guid isPermaLink="false">http://unitedmindset.com/jonbcampos/?p=675#comment-218</guid>
		<description>Hi Jonathan,

We are going to develop a large application which will be ported on web and desktop (AIR). can you suggest any good MVC framework for beginning with?</description>
		<content:encoded><![CDATA[<p>Hi Jonathan,</p>
<p>We are going to develop a large application which will be ported on web and desktop (AIR). can you suggest any good MVC framework for beginning with?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Campos</title>
		<link>http://www.unitedmindset.com/jonbcampos/2009/08/12/flex-best-practices-events/#comment-217</link>
		<dc:creator>Jonathan Campos</dc:creator>
		<pubDate>Tue, 27 Oct 2009 20:37:50 +0000</pubDate>
		<guid isPermaLink="false">http://unitedmindset.com/jonbcampos/?p=675#comment-217</guid>
		<description>as always, feel free to ask anything!</description>
		<content:encoded><![CDATA[<p>as always, feel free to ask anything!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AllynWA</title>
		<link>http://www.unitedmindset.com/jonbcampos/2009/08/12/flex-best-practices-events/#comment-216</link>
		<dc:creator>AllynWA</dc:creator>
		<pubDate>Tue, 27 Oct 2009 20:34:39 +0000</pubDate>
		<guid isPermaLink="false">http://unitedmindset.com/jonbcampos/?p=675#comment-216</guid>
		<description>And there you have it...my ClientDAO class has two methods:

getSitesByClientID( id:int );
getUsersByClientID( id:int );

with a common event handler:

private function getResults_success( e:ResultEvent ):void {
	var token:AsyncToken = e.token;
	var result:XML = e.result as XML;
	clearBusyCursor();

	if ( token != null ) {
		switch ( token.marker ) {
			case UserEvent.SAVE:
				dispatchEvent( new UserEvent( UserEvent.SAVE, result ) );
				break;

			case SiteEvent.SAVE:
				dispatchEvent( new SiteEvent( SiteEvent.SAVE, result ) );
				break;
		}
	}
}

Hmmm...

This also ties across to your MVC article. I&#039;m trying to overlay some of those good concepts here...I have a ways to go :-)

Thanks again.</description>
		<content:encoded><![CDATA[<p>And there you have it&#8230;my ClientDAO class has two methods:</p>
<p>getSitesByClientID( id:int );<br />
getUsersByClientID( id:int );</p>
<p>with a common event handler:</p>
<p>private function getResults_success( e:ResultEvent ):void {<br />
	var token:AsyncToken = e.token;<br />
	var result:XML = e.result as XML;<br />
	clearBusyCursor();</p>
<p>	if ( token != null ) {<br />
		switch ( token.marker ) {<br />
			case UserEvent.SAVE:<br />
				dispatchEvent( new UserEvent( UserEvent.SAVE, result ) );<br />
				break;</p>
<p>			case SiteEvent.SAVE:<br />
				dispatchEvent( new SiteEvent( SiteEvent.SAVE, result ) );<br />
				break;<br />
		}<br />
	}<br />
}</p>
<p>Hmmm&#8230;</p>
<p>This also ties across to your MVC article. I&#8217;m trying to overlay some of those good concepts here&#8230;I have a ways to go <img src='http://www.unitedmindset.com/jonbcampos/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Thanks again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Campos</title>
		<link>http://www.unitedmindset.com/jonbcampos/2009/08/12/flex-best-practices-events/#comment-215</link>
		<dc:creator>Jonathan Campos</dc:creator>
		<pubDate>Tue, 27 Oct 2009 19:41:34 +0000</pubDate>
		<guid isPermaLink="false">http://unitedmindset.com/jonbcampos/?p=675#comment-215</guid>
		<description>Events don&#039;t need to be globally unique. If I said they had to be that was a mistake.

However, I would guess what is happening is one of your components/classes are firing off an event and your metadata is no set properly or you are firing a user save event when you meant a site save event (or vica-versa).

The only time you will want to worry about a globally unique is when you are working with a global event handler or central dispatcher.</description>
		<content:encoded><![CDATA[<p>Events don&#8217;t need to be globally unique. If I said they had to be that was a mistake.</p>
<p>However, I would guess what is happening is one of your components/classes are firing off an event and your metadata is no set properly or you are firing a user save event when you meant a site save event (or vica-versa).</p>
<p>The only time you will want to worry about a globally unique is when you are working with a global event handler or central dispatcher.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AllynWA</title>
		<link>http://www.unitedmindset.com/jonbcampos/2009/08/12/flex-best-practices-events/#comment-214</link>
		<dc:creator>AllynWA</dc:creator>
		<pubDate>Tue, 27 Oct 2009 19:29:15 +0000</pubDate>
		<guid isPermaLink="false">http://unitedmindset.com/jonbcampos/?p=675#comment-214</guid>
		<description>Great work, Jonathan...I found this really useful and well explained. Could you talk a bit about the string names you give to your event constants. Do they have to be globally-unique?

I had a recent hairball I chased for a bunch of time where I had a SiteEvent and a UserEvent that both had SAVE types. I kept getting an error thrown that a SiteEvent couldn&#039;t be coerced to UserEvent, and nowhere could I determine that I was mixing them up in handler routines. The problem went away when I made the constants in the two classes different:

public class SiteEvent extends Event {
  public static const SAVE:String = &quot;save&quot;;
}
public class UserEvent extends Event {
  public static const SAVE:String = &quot;save&quot;;
}

became...

public class SiteEvent extends Event {
  public static const SAVE:String = &quot;site_save&quot;;
}
public class UserEvent extends Event {
  public static const SAVE:String = &quot;user_save&quot;;
}

Thanks for your thoughts.</description>
		<content:encoded><![CDATA[<p>Great work, Jonathan&#8230;I found this really useful and well explained. Could you talk a bit about the string names you give to your event constants. Do they have to be globally-unique?</p>
<p>I had a recent hairball I chased for a bunch of time where I had a SiteEvent and a UserEvent that both had SAVE types. I kept getting an error thrown that a SiteEvent couldn&#8217;t be coerced to UserEvent, and nowhere could I determine that I was mixing them up in handler routines. The problem went away when I made the constants in the two classes different:</p>
<p>public class SiteEvent extends Event {<br />
  public static const SAVE:String = &#8220;save&#8221;;<br />
}<br />
public class UserEvent extends Event {<br />
  public static const SAVE:String = &#8220;save&#8221;;<br />
}</p>
<p>became&#8230;</p>
<p>public class SiteEvent extends Event {<br />
  public static const SAVE:String = &#8220;site_save&#8221;;<br />
}<br />
public class UserEvent extends Event {<br />
  public static const SAVE:String = &#8220;user_save&#8221;;<br />
}</p>
<p>Thanks for your thoughts.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

