<?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: The Flex Code-Behind Pattern</title>
	<atom:link href="http://blog.vivisectingmedia.com/2008/04/the-flex-code-behind-pattern/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.vivisectingmedia.com/2008/04/the-flex-code-behind-pattern/</link>
	<description>Looking at the world of media: from music to RIA.</description>
	<lastBuildDate>Mon, 23 Nov 2009 08:39:09 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jovica Aleksic</title>
		<link>http://blog.vivisectingmedia.com/2008/04/the-flex-code-behind-pattern/comment-page-1/#comment-944</link>
		<dc:creator>Jovica Aleksic</dc:creator>
		<pubDate>Fri, 09 Oct 2009 12:19:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.vivisectingmedia.com/2008/04/the-flex-code-behind-pattern/#comment-944</guid>
		<description>&lt;p&gt;We are also using the code-behind approach in a large project, and I am quite happy with it too.
It reminds me of PHP Smarty template engine, where you would write the logic in a php file, and the layout in a tpl file, where you would use html tags with variables in curly brackets, just as you do in Flex. &lt;/p&gt;

&lt;p&gt;The only &quot;problem&quot; I encountered with this approach is that you definitely always have to define a layout in MXML and copy-paste markup there, even if you could basically use most of the layout and components from another MXML file. So, say you have two quite similar components, in logic as well as in layout, just one of them has some button and some checkbox extra. You will extends the base class and add the two variables for checkbox and button, but for the MXML, you will have to copy all the markup, and additionally put the checkbox and button in there.
Still, this is far better than workarounds like this one: 
http://loopmode.de/host/flex/ExtendedMxmlComponenentTest/ExtendedMxmlComponentTest.html
http://loopmode.de/host/flex/ExtendedMxmlComponenentTest2/ExtendedMxmlComponentTest.html
(it was a reply to a question of how to extends MXML-only components, replacing children)&lt;/p&gt;

&lt;p&gt;So, we use our base classes for all kinds of logic and extending, and in the end, the component always receives an own Layout definition in form of a MXML class.
Would be fine if we could mix the approach of my example links with the code-behind approach, but I can&#039;t think of a way at the moment.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>We are also using the code-behind approach in a large project, and I am quite happy with it too.
It reminds me of PHP Smarty template engine, where you would write the logic in a php file, and the layout in a tpl file, where you would use html tags with variables in curly brackets, just as you do in Flex. </p>

<p>The only &#8220;problem&#8221; I encountered with this approach is that you definitely always have to define a layout in MXML and copy-paste markup there, even if you could basically use most of the layout and components from another MXML file. So, say you have two quite similar components, in logic as well as in layout, just one of them has some button and some checkbox extra. You will extends the base class and add the two variables for checkbox and button, but for the MXML, you will have to copy all the markup, and additionally put the checkbox and button in there.
Still, this is far better than workarounds like this one: 
<a href="http://loopmode.de/host/flex/ExtendedMxmlComponenentTest/ExtendedMxmlComponentTest.html" rel="nofollow">http://loopmode.de/host/flex/ExtendedMxmlComponenentTest/ExtendedMxmlComponentTest.html</a>
<a href="http://loopmode.de/host/flex/ExtendedMxmlComponenentTest2/ExtendedMxmlComponentTest.html" rel="nofollow">http://loopmode.de/host/flex/ExtendedMxmlComponenentTest2/ExtendedMxmlComponentTest.html</a>
(it was a reply to a question of how to extends MXML-only components, replacing children)</p>

<p>So, we use our base classes for all kinds of logic and extending, and in the end, the component always receives an own Layout definition in form of a MXML class.
Would be fine if we could mix the approach of my example links with the code-behind approach, but I can&#8217;t think of a way at the moment.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan</title>
		<link>http://blog.vivisectingmedia.com/2008/04/the-flex-code-behind-pattern/comment-page-1/#comment-923</link>
		<dc:creator>Jonathan</dc:creator>
		<pubDate>Sat, 26 Sep 2009 01:49:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.vivisectingmedia.com/2008/04/the-flex-code-behind-pattern/#comment-923</guid>
		<description>&lt;p&gt;So, when you defined your package name I believe that you&#039;ve made a typo.  Shouldn&#039;t it read &quot;com.vivisectingmedia.demo&quot;? Good example this helped me a lot.  Thanks!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>So, when you defined your package name I believe that you&#8217;ve made a typo.  Shouldn&#8217;t it read &#8220;com.vivisectingmedia.demo&#8221;? Good example this helped me a lot.  Thanks!</p>]]></content:encoded>
	</item>
	<item>
		<title>By: James Polanco</title>
		<link>http://blog.vivisectingmedia.com/2008/04/the-flex-code-behind-pattern/comment-page-1/#comment-921</link>
		<dc:creator>James Polanco</dc:creator>
		<pubDate>Fri, 25 Sep 2009 05:19:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.vivisectingmedia.com/2008/04/the-flex-code-behind-pattern/#comment-921</guid>
		<description>&lt;p&gt;artigat1,
Sorry for the late reply... catching up on a serious backlog of work.&lt;/p&gt;

&lt;p&gt;If you are checking back I would be curious to hear more about what you are trying to do.  Are you trying to create objects via ActionScript and then set properties via MXML?&lt;/p&gt;

&lt;p&gt;I don&#039;t think that will be possible since the MXML is causing the compiler to create the instances you define.&lt;/p&gt;

&lt;p&gt;Now, if you are talking about using states to manipulate objects you create, that should be possible, as long as you expose the property on the backing class as a public [Bindable] value.  Then you can access this via MXML and call setProperty or such.&lt;/p&gt;

&lt;p&gt;To offer any more help I would need to see more concrete examples...&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>artigat1,
Sorry for the late reply&#8230; catching up on a serious backlog of work.</p>

<p>If you are checking back I would be curious to hear more about what you are trying to do.  Are you trying to create objects via ActionScript and then set properties via MXML?</p>

<p>I don&#8217;t think that will be possible since the MXML is causing the compiler to create the instances you define.</p>

<p>Now, if you are talking about using states to manipulate objects you create, that should be possible, as long as you expose the property on the backing class as a public [Bindable] value.  Then you can access this via MXML and call setProperty or such.</p>

<p>To offer any more help I would need to see more concrete examples&#8230;</p>]]></content:encoded>
	</item>
	<item>
		<title>By: James Polanco</title>
		<link>http://blog.vivisectingmedia.com/2008/04/the-flex-code-behind-pattern/comment-page-1/#comment-920</link>
		<dc:creator>James Polanco</dc:creator>
		<pubDate>Fri, 25 Sep 2009 05:14:42 +0000</pubDate>
		<guid isPermaLink="false">http://blog.vivisectingmedia.com/2008/04/the-flex-code-behind-pattern/#comment-920</guid>
		<description>&lt;p&gt;rdeman,
That should not be the case, we use the code behind for the root Application MXML file for all our projects and setting the width, height and framerate for the application in the MXML works fine.&lt;/p&gt;

&lt;p&gt;Are you overriding these with compiler statements?  In the backing ActionScript?  I would look for other causes that would block these values from being set via the MXML because the code-behind shouldn&#039;t disable this.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>rdeman,
That should not be the case, we use the code behind for the root Application MXML file for all our projects and setting the width, height and framerate for the application in the MXML works fine.</p>

<p>Are you overriding these with compiler statements?  In the backing ActionScript?  I would look for other causes that would block these values from being set via the MXML because the code-behind shouldn&#8217;t disable this.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: rdeman</title>
		<link>http://blog.vivisectingmedia.com/2008/04/the-flex-code-behind-pattern/comment-page-1/#comment-919</link>
		<dc:creator>rdeman</dc:creator>
		<pubDate>Thu, 24 Sep 2009 14:38:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.vivisectingmedia.com/2008/04/the-flex-code-behind-pattern/#comment-919</guid>
		<description>&lt;p&gt;Very nice introduction to the Code Behind pattern in Flex. 1 question:
setting the width, height framerate, etc. do no longer work in the MXML main file :-/&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Very nice introduction to the Code Behind pattern in Flex. 1 question:
setting the width, height framerate, etc. do no longer work in the MXML main file :-/</p>]]></content:encoded>
	</item>
	<item>
		<title>By: artigat1</title>
		<link>http://blog.vivisectingmedia.com/2008/04/the-flex-code-behind-pattern/comment-page-1/#comment-897</link>
		<dc:creator>artigat1</dc:creator>
		<pubDate>Wed, 05 Aug 2009 10:47:16 +0000</pubDate>
		<guid isPermaLink="false">http://blog.vivisectingmedia.com/2008/04/the-flex-code-behind-pattern/#comment-897</guid>
		<description>&lt;p&gt;I like the idea of this code behind a lot. One problem I seem to be having though is creating a new instance of an object in actionscript code and then trying to set elements within the mxml for that object. &lt;br&gt;&lt;br&gt;It seems that I need to add the object before I can change any of the elements or properties. Is that correct? The project I&#039;m working on requires a number of objects to be set in memory ready to be added when required. This might include setting the text of a label, but also it&#039;s position or styles or any number of other things. &lt;br&gt;&lt;br&gt;I&#039;ve tried moving the super.initialize() into the constructor, but that doesn&#039;t seem to work. Have you encountered this problem before?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I like the idea of this code behind a lot. One problem I seem to be having though is creating a new instance of an object in actionscript code and then trying to set elements within the mxml for that object. <br /><br />It seems that I need to add the object before I can change any of the elements or properties. Is that correct? The project I&#39;m working on requires a number of objects to be set in memory ready to be added when required. This might include setting the text of a label, but also it&#39;s position or styles or any number of other things. <br /><br />I&#39;ve tried moving the super.initialize() into the constructor, but that doesn&#39;t seem to work. Have you encountered this problem before?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: J2EE Code Behind for Flex / Actionscript Developers &#171; timshaya</title>
		<link>http://blog.vivisectingmedia.com/2008/04/the-flex-code-behind-pattern/comment-page-1/#comment-885</link>
		<dc:creator>J2EE Code Behind for Flex / Actionscript Developers &#171; timshaya</dc:creator>
		<pubDate>Wed, 22 Apr 2009 19:23:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.vivisectingmedia.com/2008/04/the-flex-code-behind-pattern/#comment-885</guid>
		<description>&lt;p&gt;[...] J2EE Code Behind for Flex / Actionscript&#160;Developers  Just re-stumbled upon Ted Patrick&#8217;s post on using the Code Behind technique in Flex with Actionscript. Ted wrote about how he used it in .NET and in Flex. There&#8217;re more explanations of Code Behind here and here. [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[...] J2EE Code Behind for Flex / Actionscript&nbsp;Developers  Just re-stumbled upon Ted Patrick&#8217;s post on using the Code Behind technique in Flex with Actionscript. Ted wrote about how he used it in .NET and in Flex. There&#8217;re more explanations of Code Behind here and here. [...]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Emre Selen</title>
		<link>http://blog.vivisectingmedia.com/2008/04/the-flex-code-behind-pattern/comment-page-1/#comment-804</link>
		<dc:creator>Emre Selen</dc:creator>
		<pubDate>Sat, 18 Oct 2008 08:55:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.vivisectingmedia.com/2008/04/the-flex-code-behind-pattern/#comment-804</guid>
		<description>&lt;p&gt;That was just the case I was wondering about. Thanks a lot. Nice and simple. Just on point.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>That was just the case I was wondering about. Thanks a lot. Nice and simple. Just on point.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Rafael Santos</title>
		<link>http://blog.vivisectingmedia.com/2008/04/the-flex-code-behind-pattern/comment-page-1/#comment-795</link>
		<dc:creator>Rafael Santos</dc:creator>
		<pubDate>Fri, 29 Aug 2008 12:22:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.vivisectingmedia.com/2008/04/the-flex-code-behind-pattern/#comment-795</guid>
		<description>&lt;p&gt;Fantastic article..... Good straight forward information.... Direct and compact....&lt;br&gt;It helped me understand more about how Flex/AS works and how this interaction should be handled....&lt;br&gt;Thanks&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Fantastic article&#8230;.. Good straight forward information&#8230;. Direct and compact&#8230;.<br />It helped me understand more about how Flex/AS works and how this interaction should be handled&#8230;.<br />Thanks</p>]]></content:encoded>
	</item>
	<item>
		<title>By: James</title>
		<link>http://blog.vivisectingmedia.com/2008/04/the-flex-code-behind-pattern/comment-page-1/#comment-777</link>
		<dc:creator>James</dc:creator>
		<pubDate>Tue, 29 Apr 2008 14:11:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.vivisectingmedia.com/2008/04/the-flex-code-behind-pattern/#comment-777</guid>
		<description>&lt;p&gt;I am glad this helped clear up some of the pitfalls.  When we first adopted this pattern on the project Webnesto is referring to in his comment, we would definitely had some challenges with the initial implementation.  I have a feeling I missed a few other less common pitfalls we stumbled upon during the that project and other ones I have have used it on.   At this point it has become more second nature, so what was once an &quot;workaround&quot; is now just how I code. If you, or anyone else, has some issues or questions about the pattern please let me know and I will reply and/or update the post with recommendations.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I am glad this helped clear up some of the pitfalls.  When we first adopted this pattern on the project Webnesto is referring to in his comment, we would definitely had some challenges with the initial implementation.  I have a feeling I missed a few other less common pitfalls we stumbled upon during the that project and other ones I have have used it on.   At this point it has become more second nature, so what was once an &#8220;workaround&#8221; is now just how I code. If you, or anyone else, has some issues or questions about the pattern please let me know and I will reply and/or update the post with recommendations.</p>]]></content:encoded>
	</item>
</channel>
</rss>
