<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Cranky Bit &#187; Flex</title>
	<atom:link href="http://blog.crankybit.com/tags/adobe/flex/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.crankybit.com</link>
	<description>Take a byte out of tech!</description>
	<lastBuildDate>Wed, 09 Mar 2011 17:23:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Notes: Improved Flash Remoting and Adobe AIR Integration in ColdFusion 9</title>
		<link>http://blog.crankybit.com/notes-max09-improved-flash-remoting-and-air-in-cf9/</link>
		<comments>http://blog.crankybit.com/notes-max09-improved-flash-remoting-and-air-in-cf9/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 00:57:25 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[MAX2009]]></category>
		<category><![CDATA[ORM]]></category>

		<guid isPermaLink="false">http://blog.crankybit.com/?p=334</guid>
		<description><![CDATA[These notes are taken at Adobe MAX 2009. You can use HTTPService, WebService, RemoteObject components in Flex to pull data in different ways. Now what about ColdFusion 9? ColdFusion&#8217;s Flash Remoting has been improved. So Flash applications that have ColdFusion 9 as a backend will interact much faster, and it can handle circular references. There [...]]]></description>
			<content:encoded><![CDATA[<p>These notes are taken at Adobe MAX 2009.</p>
<p>You can use HTTPService, WebService, RemoteObject components in Flex to pull data in different ways. Now what about ColdFusion 9?</p>
<p>ColdFusion&#8217;s Flash Remoting has been improved. So Flash applications that have ColdFusion 9 as a backend will interact much faster, and it can handle circular references.</p>
<p>There is now direct data translation between ActionScript and CF types, instead of previously having an intermediate Java layer that handled this. This involves changes in services-config.xml, but no code changes are required in your apps. Support for the old style remoting is still present for backward compatibility.</p>
<p>So how much faster is it? Drastically faster. Easily x9 faster, and that increases as the number of transactions occurs, according to the whitepaper Adobe has released about it.</p>
<p><strong>BlazeDS.</strong> ColdFusion 9 is now integrated with BlazeDS as the default installation.</p>
<p><strong>Configuration File.</strong> Services-Config.xml is now split into 4 files. There are a handful of ColdFusion-specific properties under the channel definition now. An &#8220;enable-small-messages&#8221; property is there and should be set to &#8220;false&#8221;. This is important for the new Flash Remoting in CF9, because BlazeDS&#8217;s default is &#8220;true&#8221;. </p>
<p>There is an AMFChannel component in Flex for the new Flash Remoting (Note: You can alternatively tell the AMFChannel component to have enableSmallMessages=&#8221;false&#8221;). Finally, the endpoint class is changed for the new CF9 one.</p>
<p><strong>Offline AIR apps with ColdFusion 9</strong></p>
<p>Now the fun stuff. ColdFusion 9 has an ORM for AIR! Build offline AIR apps without the SQL mess and conflict handling. There is a CF-AIR persistent framework for SQLite on the client side. CF keeps track of all updates to local database and synchronizes with the server, including conflict resolution.</p>
<p>By having ORM on the client- and server-side, these two are integrated through the CF-AIR persistent framework.</p>
<p>In the application code for the demo, there were customer.cfc and address.cfc persistent objects. Then a sync CFC is used for providing the fetch and sync functions for communication with the AIR client.</p>
<p>Step #1: Create the persistent CFCs.</p>
<p>Step #2: Create the sync CFC. He called it custmgr.cfc. The CFC has implements=&#8221;ISyncManager&#8221; as an attribute. Then you have fetch() and sync() methods that handle the transactions. Here you can provide your logic for handling certain scenarios, such as conflicts.</p>
<p>Step #3: On client side, create equivalent AS classes that map to the CFC via the [RemoteClass(alias="")] metadata tag.</p>
<p>Step #4: Use the CF-built AIR libraries provided to fetch data from server, with the SyncManager component. It&#8217;s very simple, practically just point it to the sync CFC and do a fetch() method. To work with the database, you then openSession() and can create new AS objects and call save() on the session to insert/update/etc.  Finally, using commit() will commit the results and invoke the sync() process.</p>
<p>On the client side, it can receive conflict notification and receive both versions of the data so that you can decide what to do with the conflict.</p>
<p>It is very exciting to have some help implementing synchronization without having to purchase LCDS. Using the CF9/AIR integration libraries will be very nice.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crankybit.com/notes-max09-improved-flash-remoting-and-air-in-cf9/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Notes: Migrating from Flex 3 to Flex 4</title>
		<link>http://blog.crankybit.com/notes-migrating-from-flex-3-to-flex-4/</link>
		<comments>http://blog.crankybit.com/notes-migrating-from-flex-3-to-flex-4/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 18:57:16 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[MAX2009]]></category>

		<guid isPermaLink="false">http://blog.crankybit.com/?p=331</guid>
		<description><![CDATA[These are notes from Adobe MAX 2009. This session will help us see what problems we may encounter moving to Flex 4, as well as what new features we can use. Packages. The old mx packages are still there. But now everything new is in the spark packages. Why two different packages? At first, they [...]]]></description>
			<content:encoded><![CDATA[<p>These are notes from Adobe MAX 2009. This session will help us see what problems we may encounter moving to Flex 4, as well as what new features we can use.</p>
<p><strong>Packages.</strong> The old mx packages are still there. But now everything new is in the spark packages. Why two different packages? At first, they had them all in the same package, but the component had a prefix for the new version. It wasn&#8217;t received well. So instead, Adobe just put the new components in new namespaces.</p>
<p>The MX namespace is also called &#8220;Halo&#8221;. Don&#8217;t consider it a &#8220;legacy&#8221; namespace. These are still fully supported. Spark is all of the new stuff. The general MXML has a new 2009 namespace, but the legacy namespace is still supported.</p>
<p><strong>Graphics</strong></p>
<p>You can add graphic primitives enabling you to draw lines, ellipses, and curves, directly within the MXML. With the new FXG file format, you can import a graphic in as a vector graphic that appears as code. Cool. Using a static FXG image is great for icons or other static simple images, because its rendering is faster than an MXML graphic container.</p>
<p><strong>Flex States</strong></p>
<p>Instead of using AddChild and RemoveChild for changing states, you have includeIn=&#8221;" and excludeIn=&#8221;" attributes that go directly on components. What&#8217;s more, you can set various attributes of a component for the different states by using a dot notation. For instance, title.mystate=&#8221;Title&#8221;. This seems like a pretty drastic change.</p>
<p>With states, you have to use the OLD way with the 2006 namespace, and you have to use the NEW way with the 2009 namespace.</p>
<p><strong>Skinning</strong></p>
<p>Components all have separate skin files. This will allow you to create a custom skin for any component easily.</p>
<p><strong>Common migration issues</strong></p>
<p>Type selectors need namespaces now in your Flex CSS. For instance, if you&#8217;re styling a button, Flex doesn&#8217;t know if it is a Spark button or a Halo button. So you need to define the namespace in your stylesheet and update your selectors accordingly.</p>
<p>You must compile against Flash Player 10. This won&#8217;t be an issue if you use Flash Builder 4 with Flex 4.</p>
<p>Application.application should now be renamed to FlexGlobals.topLevelApplication. Just a direct rename.</p>
<p>RSLs are on by default.</p>
<p>The &#8220;Declarations&#8221; tag is a problem child. In Flex 4, anything that is not a display object or default property must be within the fx:Declarations tag. Even tags like RadioButtonGroup. Formatters, Effects, RPC stuff, Validators, etc. need to go in the Declarations.</p>
<p>&#8220;If Looks Could Kill.&#8221; The default theme is now Spark, which looks different than the old Halo theme. You can switch back to the Halo theme. To do so, turn on &#8220;Use Flex 3 compatibility mode&#8221; in the project properties, or go into the &#8220;Flex Theme&#8221; panel and change the theme (this is the preferred way).</p>
<p>If moving to Flex 4, try to use as many Spark components as you can. They <em>should</em> play nicely with MX components. You can intermix them together. Caveats: (1) The graphic primitives cannot go in an MX component, just wrap them with a group; (2) you cannot put MX components in Spark containers; (3) MX effects do not work on Spark graphic primitives; (4) MX navigators (ViewStack, Accordion, etc) should use NavigatorContent component.</p>
<p>Other things to watch out for:</p>
<ul>
<li>Spark components don&#8217;t support the Halo theme.</li>
<li>Cannot create spark component based itemRenderers for MX List based components</li>
<li>APIs between MX and Spark components are different (e.g. addChild vs. addElement)!</li>
<li>When using MX and Spark components together, you may see a text difference since they are themed differently. There is a TLFText theme that can help with this.</li>
</ul>
<p>So, migrating an app from Flex 3 to Flex 4 is a bit of a slippery slope. And even just beginning to use Flex 4 with current Flex 3 knowledge will require a bit of a slowdown as you undo some of those brain synapses to do things the new Flex 4 way. But these changes going forward are good for the Flex framework.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crankybit.com/notes-migrating-from-flex-3-to-flex-4/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Looping Through Datagrid Rows in Flex</title>
		<link>http://blog.crankybit.com/looping-through-datagrid-rows-in-flex/</link>
		<comments>http://blog.crankybit.com/looping-through-datagrid-rows-in-flex/#comments</comments>
		<pubDate>Thu, 05 Jun 2008 18:22:54 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[General Web Dev.]]></category>

		<guid isPermaLink="false">http://blog.crankybit.com/?p=301</guid>
		<description><![CDATA[It wasn't readilly apparent to me how to loop through some datagrid rows in Flex. Finally, I came across Abdul Qabiz's DataGridDataExporter class, which basically does just that. The key is to set up a cursor that will loop through the Data Provider for the datagrid. Something like this: PLAIN TEXT ACTIONSCRIPT: var dp:Object=MyDG.dataProvider; var [...]]]></description>
			<content:encoded><![CDATA[<p>It wasn't readilly apparent to me how to loop through some datagrid rows in Flex. Finally, I came across Abdul Qabiz's <a href="http://www.abdulqabiz.com/blog/archives/flash_and_actionscript/datagriddataexporter.php" target="_blank">DataGridDataExporter class,</a> which basically does just that.</p>
<p>The key is to set up a cursor that will loop through the Data Provider for the datagrid.</p>
<p>Something like this:</p>
<p><div class="igBar"><span id="lactionscript-2"><a href="#" onclick="javascript:showCodeTxt('actionscript-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">ACTIONSCRIPT:</span>
<div id="actionscript-2">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> dp:<span style="color: #0066CC;">Object</span>=MyDG.<span style="color: #006600;">dataProvider</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">var</span> cursor:IViewCursor=dp.<span style="color: #006600;">createCursor</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">while</span><span style="color: #66cc66;">&#40;</span> !cursor.<span style="color: #006600;">afterLast</span> <span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #808080; font-style: italic;">// Access each column field like: cursor.current.MyFieldName</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>cursor.<span style="color: #006600;">current</span>.<span style="color: #006600;">MyFieldName</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #808080; font-style: italic;">// Obviously don't forget to move to next row:</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; cursor.<span style="color: #006600;">moveNext</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
</p>
<p>That's all there is to it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crankybit.com/looping-through-datagrid-rows-in-flex/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Note for Flex Newbie: Test Your HTML Wrapper</title>
		<link>http://blog.crankybit.com/flex-newbie-test-html-wrapper/</link>
		<comments>http://blog.crankybit.com/flex-newbie-test-html-wrapper/#comments</comments>
		<pubDate>Mon, 07 Apr 2008 11:48:57 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[General Web Dev.]]></category>

		<guid isPermaLink="false">http://blog.crankybit.com/flex-newbie-test-html-wrapper/</guid>
		<description><![CDATA[Note to self (the Flex newbie): Test your HTML wrapper for your SWF files to make sure that the user experience is a good one when you're setting up your Flex apps on your site! I took the HTML wrapper generated by Flex Builder and modified it to fit into my page. While doing so, [...]]]></description>
			<content:encoded><![CDATA[<p>Note to self (the Flex newbie): Test your HTML wrapper for your SWF files to make sure that the user experience is a good one when you're setting up your Flex apps on your site! I took the HTML wrapper generated by Flex Builder and modified it to fit into my page. While doing so, I forgot to include the playerProductInstall.swf file with my app, so when a browser with an older Flash Player viewed the page, the JavaScript I had in place to call playerProductInstall.swf would hang since it couldn't find it. The detection for when no Flash Player is present at all (or only a <u>really</u> old version) was also a bit ungraceful.</p>
<p>But I was clueless to these poor experiences since I hadn't tested these scenarios. Fortunately, my app was <em>just</em> released, and only to a beta crowd.</p>
<p>To test the absence of Flash Player, you can download a <a href="http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_14157" target="_blank">Flash Player Uninstaller</a> and uninstall Flash Player.  I'm not sure what the best way is to install and test an old version of the Flash Player; I just had a virtual machine that had an old version on it, so I used that because it was convenient. If you google for "<a href="http://www.google.com/search?q=download+flash+player+8" target="_blank">download flash player 8</a>", there are some non-Adobe links that appear to be valid links, but I did not try these.</p>
<p>Adobe has a <a href="http://www.adobe.com/devnet/flashplayer/detection_installation.html" target="_blank">Flash Player Detection and Installation</a> support page that is helpful as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crankybit.com/flex-newbie-test-html-wrapper/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Notes: Adobe AIR Local Data Storage Options</title>
		<link>http://blog.crankybit.com/notes-adobe-air-local-data-storage-options/</link>
		<comments>http://blog.crankybit.com/notes-adobe-air-local-data-storage-options/#comments</comments>
		<pubDate>Wed, 26 Mar 2008 17:13:10 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[General Web Dev.]]></category>
		<category><![CDATA[Webinars]]></category>

		<guid isPermaLink="false">http://blog.crankybit.com/notes-adobe-air-local-data-storage-options/</guid>
		<description><![CDATA[The following are my notes during the Adobe AIR Local Data Storage Options webinar that was presented during Adobe Developer Week. It was presented by Greg Hamer and the slides and demo code are already online. Before getting started, note how Microsoft and Adobe are taking two different approaches: Microsoft is trying to bring the [...]]]></description>
			<content:encoded><![CDATA[<p>The following are my notes during the Adobe AIR Local Data Storage Options webinar that was presented during <a href="http://adobe.com/go/2008_developer_week" target="_blank">Adobe Developer Week</a>. It was presented by Greg Hamer and the slides and demo code are already <a href="http://halcyonsolutions.net/presos/08/airsql/" target="_blank">online</a>.</p>
<p>Before getting started, note how Microsoft and Adobe are taking two different approaches: Microsoft is trying to bring the .Net desktop development community to the web. Adobe is conversely trying to bring web developers to the desktop! (<a href="http://www.news.com/8301-10784_3-9789007-7.html" target="_blank">Kevin Lynch</a>)</p>
<p>There are four main options for AIR local storage: Local Shared Objects, File System, Encrypted Local Store, and the embedded SQLite database. Shared Objects are available in the Flash Player as well; all of these options are obviously available in AIR. Note that the data size limitation for Shared Objects does not exist in the AIR runtime!</p>
<p><strong>Performance considerations.</strong> Shared Objects read and write very quickly. File system access and encrypted local stores are typically be slow in writing. Embedded SQLite databases are typically the best combination of speed and random access of items. Greg highlighted the AIR_LocalStorage_Demo app created by Jason Williams that demonstrates the speeds of the four storage methods.</p>
<p><strong>Local Shared Objects.</strong> You can serialize memory resident data structures. Great! However, it runs in <em>synchronous</em> mode.</p>
<p><strong>Encrypted Local Store.</strong> Used to store sensitive data. The price is the slow write speeds.  Also runs in synchronous mode. All data is serialized using ByteArray.</p>
<p><strong>File System. </strong>Obviously important for management of documents. Can run in sync and async mode. The File and FileStream objects work together to point to a file and read/write data. The File object helps remove you from the pain of dealing with Mac vs. Windows environments with properties like File.userDirectory, File.documents.Directory, File.desktopDirectory, etc. It also has methods for opening Open and Save dialog boxes native to the environment as well as copying/moving/deletion methods.</p>
<p><strong>Embedded SQLite Database.</strong>  Nice thing about them is that they are self-contained in a single file and require no external software installation to begin using them (support is built into the AIR runtime). Even supports transactions. And the database supports large amounts of data: SQLite has a theoretical limit of over 2TB. Supports ANSI-SQL 92.</p>
<p>However, it's not a full-blown enterprise database server, obviously. So you lose things like stored procedures, enforcing data type constraints, foreign key constraints, and primary keys must be integers. It also isn't a multiuser environment.</p>
<p><strong>Session evaluation. </strong>I am unhappy to say that I was disappointed with the session. It was high-level, the coverage of code samples (when they weren't passed over completely) consisted of merely reading the code back to us. I recommend viewing the recording if you have zero knowledge of data storage in Flex and AIR, as it would serve as a decent first-baby-step introduction for you.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crankybit.com/notes-adobe-air-local-data-storage-options/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>The Solution to Flex Remoting Over SSL</title>
		<link>http://blog.crankybit.com/flex-remoting-over-ssl/</link>
		<comments>http://blog.crankybit.com/flex-remoting-over-ssl/#comments</comments>
		<pubDate>Tue, 25 Mar 2008 12:21:52 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[General Web Dev.]]></category>
		<category><![CDATA[How To]]></category>

		<guid isPermaLink="false">http://blog.crankybit.com/flex-remoting-over-ssl/</guid>
		<description><![CDATA[If you've tried calling ColdFusion CFCs with RemoteObject over SSL in your Flex apps, you probably feel my pain already, because you have either tried to get it working and gave up, or had a heck of a time getting it working. Adobe's documentation for this specific need wasn't helpful to me, and discussion about [...]]]></description>
			<content:encoded><![CDATA[<p>If you've tried calling ColdFusion CFCs with RemoteObject over SSL in your Flex apps, you probably feel my pain already, because you have either tried to get it working and gave up, or had a heck of a time getting it working. Adobe's documentation for this specific need wasn't helpful to me, and discussion about it online is relatively sparse and unsure as well, from what I've seen. My intranet environment at work demanded that I get remote communication with CFCs working over SSL, so as I neared completion of my first couple Flex apps, I needed to get an understanding of this issue. Hopefully it will be useful to others.</p>
<p><strong>So, what's the problem? </strong>In a nutshell, when you try to use the RemoteObject component in a Flex app to communicate with CFCs, the default installation of ColdFusion 8 and Flex Builder 3 will compile your app to communicate with the ColdFusion server over HTTP (http://yourserver.com/flex2gateway/), <em>not</em> over HTTPS (https://yourserver.com/flex2gateway/cfamfsecure), regardless of whether the SWF was loaded over HTTPS or not.</p>
<p>If your site exists in both HTTP and HTTPS, you may not even be aware this is happening. I wasn't aware of it while I was developing on my local machine. But our production server hosts its site <em>only </em>in HTTPS and the site on port 80 is a nearly empty site that redirects all requests to the SSL-protected version of the site. So this behavior broke my Flex app.</p>
<p>If your site exists only in SSL or sensitive data is being transmitted to and from the Flex app and the CFCs, you probably are trying to get RemoteObject to communicate over SSL.</p>
<p><strong>Quick workarounds.</strong> If you have time and leniency to skirt the issue, you can avoid the RemoteObject/SSL issue. You can always use the HTTPService and WebService components instead of RemoteObject. But like most workarounds, this has its disadvantages and limits you from the benefit of using RemoteObject.</p>
<p>I imagine you also could set up a ColdFusion mapping to make the CFCs available on the HTTP site, but this solution is viable only if you really don't care about security, in which case you probably wouldn't have your site wrapped in SSL anyway.</p>
<p><strong>The solution.</strong> What makes the solution tricky is that there are a few things that have to be configured properly, and there are some pitfalls along the way that can be misleading.  The primary solution lies in some changes to the ColdFusion server's config files <em>services-config.xml</em> and <em>remoting-config.xml</em>. These both reside in <em>{ColdFusion installation}</em>\wwwroot\WEB-INF\flex\. For instance, on my Windows workstation, this is located at c:\ColdFusion8\wwwroot\WEB-INF\flex\.</p>
<p><strong>1. Add the secure channel to remoting-config.xml.</strong> ColdFusion 8 already has a channel in its configuration for RemoteObject over SSL--it is called "my-cfamf-secure"--it just isn't configured to be used. So you have to add the "my-cfamf-secure" channel to remoting-config.xml. To do this, add &lt;channel ref="my-cfamf-secure" /&gt; to the &lt;default-channels&gt; node and the &lt;channels&gt; node for the "ColdFusion" destination.</p>
<p>In other words, your new remoting-config.xml file should look like this:</p>
<div class="igBar"><span id="lxml-6"><a href="#" onclick="javascript:showCodeTxt('xml-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">XML:</span>
<div id="xml-6">
<div class="xml">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;</span>?xml <span style="color: #000066;">version</span>=<span style="color: #ff0000;">"1.0"</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">"UTF-8"</span>?<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;service</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"remoting-service"</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"flex.messaging.services.RemotingService"</span> <span style="color: #000066;">messageTypes</span>=<span style="color: #ff0000;">"flex.messaging.messages.RemotingMessage"</span><span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;adapters<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;adapter</span>-definition <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"cf-object"</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"coldfusion.flash.messaging.ColdFusionAdapter"</span> <span style="color: #000066;">default</span>=<span style="color: #ff0000;">"true"</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;adapter</span>-definition <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"java-object"</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"flex.messaging.services.remoting.adapters.JavaAdapter"</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/adapters<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;default</span>-channels<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;channel</span> <span style="color: #000066;">ref</span>=<span style="color: #ff0000;">"my-cfamf-secure"</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;channel</span> <span style="color: #000066;">ref</span>=<span style="color: #ff0000;">"my-cfamf"</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/default</span>-channels<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;destination</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"ColdFusion"</span><span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;channels<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;channel</span> <span style="color: #000066;">ref</span>=<span style="color: #ff0000;">"my-cfamf-secure"</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;channel</span> <span style="color: #000066;">ref</span>=<span style="color: #ff0000;">"my-cfamf"</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/channels<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;properties<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;source<span style="font-weight: bold; color: black;">&gt;</span></span></span>*<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/source<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- define the resolution rules and access level of the cfc being invoked --&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;access<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Use the ColdFusion mappings to find CFCs, by default only CFC files under your webroot can be found. --&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;use</span>-mappings<span style="font-weight: bold; color: black;">&gt;</span></span>false<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/use</span>-mappings<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- allow &quot;public and remote&quot; or just &quot;remote&quot; methods to be invoked --&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;method</span>-access-level<span style="font-weight: bold; color: black;">&gt;</span></span>remote<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/method</span>-access-level<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/access<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;property</span>-case<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- cfc property names --&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;force</span>-cfc-lowercase<span style="font-weight: bold; color: black;">&gt;</span></span>false<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/force</span>-cfc-lowercase<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- Query column names --&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;force</span>-query-lowercase<span style="font-weight: bold; color: black;">&gt;</span></span>false<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/force</span>-query-lowercase<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- struct keys --&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;force</span>-struct-lowercase<span style="font-weight: bold; color: black;">&gt;</span></span>false<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/force</span>-struct-lowercase<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/property</span>-case<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/properties<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/destination<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/service<span style="font-weight: bold; color: black;">&gt;</span></span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>This brings me to the first pitfall to watch out for. Be sure to list &lt;channel ref="my-cfamf-secure" /&gt; <em>ahead of</em> &lt;channel ref="my-cfamf" /&gt; so that ColdFusion will try the secure channel <em>first</em>. </p>
<p><strong>2. Add a property to make IE happy.</strong> At this point, your configuration will be adequate for Firefox. However, IE still seems to get tripped up and tries to access the insecure channel. To fix this, just add &lt;add-no-cache-headers&gt;false&lt;/add-no-cache-headers&gt; to the &lt;properties&gt; node of the &lt;channel-definition&gt; nodes for "my-cfamf" and "my-cfamf-secure" in services-config.xml. </p>
<p>I won't display the entire services-config.xml file here, but your "my-cfamf" channel definition will now look like this:</p>
<div class="igBar"><span id="lxml-7"><a href="#" onclick="javascript:showCodeTxt('xml-7'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">XML:</span>
<div id="xml-7">
<div class="xml">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;channel</span>-definition <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"my-cfamf"</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"mx.messaging.channels.AMFChannel"</span><span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;endpoint</span> <span style="color: #000066;">uri</span>=<span style="color: #ff0000;">"http://{server.name}:{server.port}{context.root}/flex2gateway/"</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"flex.messaging.endpoints.AMFEndpoint"</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;properties<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;polling</span>-enabled<span style="font-weight: bold; color: black;">&gt;</span></span>false<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/polling</span>-enabled<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;serialization<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;instantiate</span>-types<span style="font-weight: bold; color: black;">&gt;</span></span>false<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/instantiate</span>-types<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/serialization<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;add</span>-no-cache-headers<span style="font-weight: bold; color: black;">&gt;</span></span>false<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/add</span>-no-cache-headers<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/properties<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/channel</span>-definition<span style="font-weight: bold; color: black;">&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>And the "my-cfamf-secure" channel definition:</p>
<div class="igBar"><span id="lxml-8"><a href="#" onclick="javascript:showCodeTxt('xml-8'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">XML:</span>
<div id="xml-8">
<div class="xml">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;channel</span>-definition <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"my-cfamf-secure"</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"mx.messaging.channels.SecureAMFChannel"</span><span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;endpoint</span> <span style="color: #000066;">uri</span>=<span style="color: #ff0000;">"https://{server.name}:{server.port}{context.root}/flex2gateway/cfamfsecure"</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"flex.messaging.endpoints.SecureAMFEndpoint"</span><span style="font-weight: bold; color: black;">/&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;properties<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;polling</span>-enabled<span style="font-weight: bold; color: black;">&gt;</span></span>false<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/polling</span>-enabled<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;serialization<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;instantiate</span>-types<span style="font-weight: bold; color: black;">&gt;</span></span>false<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/instantiate</span>-types<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/serialization<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;add</span>-no-cache-headers<span style="font-weight: bold; color: black;">&gt;</span></span>false<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/add</span>-no-cache-headers<span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/properties<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/channel</span>-definition<span style="font-weight: bold; color: black;">&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>Some more pitfalls to consider.</strong> These can be really misleading, making you think your changes aren't working.</p>
<p><strong>A.</strong> Flex Builder incorporates these settings into your app when it compiles the SWF. Go to your Flex project's properties, under "Flex Compiler", and you'll see a reference to your services-config.xml file. <em>If your SWF is compiled on a workstation that hasn't had these changes, it will not work on your server, even if you did change your server's config files.</em> So be sure that your local installation of ColdFusion has its services-config.xml and remoting-config.xml files updated just like your production server. </p>
<p><strong>B.</strong> On a related note, be sure to <em>recompile</em> an app if you've compiled it before making these config changes. You can recompile in Flex Builder by going to Project &gt; Clean. That option will ensure that you have a clean, recompiled SWF. </p>
<p><strong>C.</strong> If your SWF file is actually served on port 80, it will not be allowed to communicate over the secure channel unless you tell it that it is permissible to do so by setting up a crossdomain.xml file. Check out Shannon Whitley's post <a href="http://www.voiceoftech.com/swhitley/?p=117">SSL, crossing domains, and Flex</a> to read a bit on that.</p>
<p><strong>Tools for the job.</strong> With the right tools, you can test all of these things out on your own. For instance, <a href="http://www.getfirebug.com/">Firebug</a> and <a href="http://www.fiddlertool.com/">Fiddler</a> are great tools for Firefox and IE respectively that clearly show your Flex app's behavior, and whether it is attempting to access the secure or insecure channel. They also show the app attempting to access a crossdomain.xml file when the SWF file was loading over HTTP, because it's first attempt is to make a cross-domain connection to the secure HTTPS channel.</p>
<p>The great thing about this configuration is that your SWFs will use the secure channel when they can, but silently fail over to the insecure channel. So your development workstation doesn't have to use SSL, but your compiled apps will utilize it when you move them to your production server. This is cleaner than setting up a separate "Destination" in remoting-config.xml, or other solutions that require changes to your app's code. Alas, I am still green in the Flex universe and don't claim anything different. Nevertheless, this solution is working perfectly for me and I hope it proves useful for you.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crankybit.com/flex-remoting-over-ssl/feed/</wfw:commentRss>
		<slash:comments>63</slash:comments>
		</item>
		<item>
		<title>iPhone AIR?</title>
		<link>http://blog.crankybit.com/iphone-air/</link>
		<comments>http://blog.crankybit.com/iphone-air/#comments</comments>
		<pubDate>Tue, 04 Mar 2008 22:16:03 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Gadgets]]></category>
		<category><![CDATA[General Web Dev.]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[iPod/iPhone]]></category>

		<guid isPermaLink="false">http://blog.crankybit.com/iphone-air/</guid>
		<description><![CDATA[So, with Apple preparing to hold an iPhone Software Roadmap event this Thursday, people are eagerly anticipating news about how Apple will handle an SDK for the iPhone environment. Many developers were frustrated--and many web developers had our curiosities pleasantly piqued--when Apple initially announced that "software" would be available for the iPhone in the form [...]]]></description>
			<content:encoded><![CDATA[<p>So, with Apple preparing to hold an <a href="http://www.appleinsider.com/articles/08/02/27/apple_to_hold_iphone_software_roadmap_media_event_next_week.html" target="_blank">iPhone Software Roadmap event</a> this Thursday, people are eagerly anticipating news about how Apple will handle an SDK for the iPhone environment.</p>
<p>Many developers were frustrated--and many web developers had our curiosities pleasantly piqued--when Apple initially announced that "software" would be available for the iPhone in the form of Ajax web applications. Naturally, many of the disappointed folks were irritated because the web platform is something that they're entirely unfamiliar with, probably having backgrounds in Objective C or something similar; probably a minority were disappointed because their target application legitimately could not be powered by HTML and Ajax.</p>
<p>That said, it is indeed a very thought-provoking concept: Using web technology as your application environment. As most web developers will attest to, there honestly isn't that much that a typical application does that cannot be accomplished with web technology. With the advent of Ajax frameworks, applications built with web technology can have very similar responsiveness and dynamics of a "classic" application. Especially when you remove the burden of cross-browser compatibility, in the iPhone's case.</p>
<p>But with the iPhone/iPod Touch scenario, it is irritating that the application <em>has</em> to reside in Safari and <em>has</em> to be loaded off the web. It almost feels as if Apple was trying to push something that wasn't...quite...ready. Something like <a href="http://www.adobe.com/go/air" target="_blank">AIR</a>!</p>
<p>AIR accomplishes everything that Apple was suggesting for the iPhone environment, but for the desktop. Use web technology, but write a "compiled", stand-alone application that really doesn't even have to use the web. Use HTML. Use Ajax. Use Flex and Flash. Have a nice encapsulated application on your desktop. Especially when you throw the Flash technology into the platform, it is now a very capable environment for a large variety of applications, without being constrained to the browser. Wouldn't it be great if that same cross-platform environment, AIR, worked on the iPhone as well?</p>
<p>Oops, Flash technology isn't currently supported by the iPhone. That is actually another source of contention. And the AIR environment <u>does</u> lose some of its punch without Flash and Flex, even though its HTML/Ajax implementation can do a very decent job with most typical applications.</p>
<p>Steve Jobs has <a href="http://www.apple.com/pr/library/2007/06/11iphone.html" target="_blank">made it clear</a> that he likes the idea of web technology powering iPhone apps. Now, consider some of the  facts. Apple announces the iPhone SDK will be released in February, and then fails to deliver. Meanwhile, Flash still isn't found on the iPhone, and Adobe "invents the wheel" by getting web technology to drive native apps through its work with AIR. Is there a common theme with these events? Perhaps something like: <em><strong>Are Apple and Adobe working together to get the much-needed Flash technology onto the iPhone and, subsequently, releasing an SDK that uses AIR technology, with hooks into the iPhone system just like AIR currently has hooks into the Linux, Windows, and Mac OS X desktop operating systems? </strong></em></p>
<p>It wouldn't be the first time Apple has had to wait for its partners, or take the heat for them. For instance, Apple has clearly been taking a lot of heat for many factors of the iPhone that are clearly not in Apple's interest, but in AT&amp;T's.</p>
<p>And this scenario would fit the circumstances around Adobe's development of AIR. Adobe has been working on AIR since well before the iPhone was released, but AIR wasn't officially released until <em>February 25, 2008. </em>Even if Apple and Adobe <u>were</u> working closely together, there just hasn't been enough time for AIR to get released <em>and </em>hooks to be developed to provide iPhone-specific functionality in AIR. Adobe has understandably concerned itself with its own business first. With that done, attention can turn to Apple to support them in concluding their own business.</p>
<p>Of course, this prediction is a reflection of my own desires as much as it fits the circumstances. As a developer that uses Adobe technology including Flex and AIR, and an Apple enthusiast for more than 20 years, I would love to see things happen this way. Undoubtedly we will have a clearer idea of Apple's iPhone development roadmap after this Thursday.</p>
<p>As if the thought of an "iPhone AIR" isn't confusing enough. <img src='http://blog.crankybit.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crankybit.com/iphone-air/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Notes: BlazeDS Revealed!</title>
		<link>http://blog.crankybit.com/notes-blazeds-revealed/</link>
		<comments>http://blog.crankybit.com/notes-blazeds-revealed/#comments</comments>
		<pubDate>Fri, 29 Feb 2008 00:10:23 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[General Web Dev.]]></category>
		<category><![CDATA[Webinars]]></category>

		<guid isPermaLink="false">http://blog.crankybit.com/notes-blazeds-revealed/</guid>
		<description><![CDATA[These are notes from the presentation by Tom Jordahl about BlazeDS. History lesson. Flex 1.0 introduced MXML. Originally built to be a server-based compiler. Flex 2.0 fine-tuned the product. ActionScript 3 was introduced, the Eclipse-based IDE was developed, and the server-side component was renamed Flex Data Services. That server-side product continued development and was renamed [...]]]></description>
			<content:encoded><![CDATA[<p>These are notes from the presentation by Tom Jordahl about <a href="http://opensource.adobe.com/blazeds" target="_blank">BlazeDS</a>.</p>
<p><strong>History lesson. </strong>Flex 1.0 introduced MXML. Originally built to be a <em>server-based </em>compiler. Flex 2.0 fine-tuned the product. ActionScript 3 was introduced, the Eclipse-based IDE was developed, and the server-side component was renamed Flex Data Services. That server-side product continued development and was renamed eventually to LiveCycle Data Services. Finally, a free portion was released as BlazeDS. So, its heart and heritage is in the development of Flex.</p>
<p><strong>So what is BlazeDS?</strong>  The part that lets your Flash/Flex app have remoting and messaging services via web services, remote objects, data push, etc.</p>
<p><em>Remoting.</em> Used to be Flash Remoting. Allows mx:RemoteObject tag be used to make RPC calls to the server.  Allows you to use CFCs and ActionScript or MXML together! Works with Java classes too, but obviously it is very nicely integrated with ColdFusion. This is the most familiar purpose for this kind of tool. But what else can BlazeDS do?</p>
<p><em>Messaging. </em>Publish and Subscribe functionality becomes trivial. We can have real-time pushes over the web. What exactly does this mean? Your Flash/Flex apps can push data from one client to the next without refreshes or polling the server.</p>
<p>These services use AMF (Action Messaging Format). It is fast and small: Rather than being verbose text, it is a compact binary protocol. Not that you would ever have to know that, because it just happens behind the scenes. And its specs have been released, which means it can be supported by open source and third party developers.</p>
<p>So why would you still get LCDS? Well, you get certified builds with warranty coverage and support. You're paying for Adobe to back the product. There will even be an LCDS "Community Edition" that will basically be BlazeDS with this support. Somewhat reminiscent to Red Hat vs. CentOS: Why get Red Hat when CentOS is everything Red Hat is? Because Red Hat has official support for its product. So Adobe is making the technology freely available, and giving you the option to pay for support and official builds and bug fixes.</p>
<p>LCDS "Enterprise Edition" is still the mother of data services. This version adds the data management capability of data services.</p>
<p>The installation of ColdFusion 8 gives you the free express edition of LCDS. But this is a single CPU license. If it doesn't meet your needs, you can configure BlazeDS for ColdFusion 8. But to do this, you WILL have to remove the LCDS Express Edition that installed with CF8. Now, if you're just using Flash Remoting, there isn't any burning need to go to BlazeDS with CF8. However, the messaging features have no CPU restrictions with BlazeDS, so if you are using the messaging features, you may want to go with BlazeDS.</p>
<p>What do you use with BlazeDS vs. LCDS? LCDS has the data management features: Real-time data updates, conflict detection, caching, paging, more!  RTMP channels: Direct socket connection to server, instead of the more resource-expensive HTTP. Scalability is also better with LCDS.</p>
<p>Tom indicated that Flex and BlazeDS will not be standing still. He certainly implied that <a href="http://en.wikipedia.org/wiki/Silverlight" target="_blank">Silverlight</a> is in Adobe's sights by indicating that it is "nipping at [Flex's] heels", suggesting that the AIR, Flex, and BlazeDS technologies will be progressing in development at a rapid pace by Adobe.</p>
<p>Tom explained BlazeDS and LCDS very clearly, albeit at a quick pace at first. My development rarely calls for the messaging features that would especially drive me to BlazeDS, but even so, it was beneficial to understand what BlazeDS is and it is good to know even when a product is <em>not </em>needed in your development arsenal, as in my case. For me, I will be using remoting only, so will stick with LCDS Express that comes with CF8.</p>
<p>Thanks, Tom.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crankybit.com/notes-blazeds-revealed/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>CF8, AJAX, Flex, AIR: There&#8217;s Room For Everyone</title>
		<link>http://blog.crankybit.com/cf8-ajax-flex-air-theres-room-for-everyone/</link>
		<comments>http://blog.crankybit.com/cf8-ajax-flex-air-theres-room-for-everyone/#comments</comments>
		<pubDate>Thu, 19 Jul 2007 12:03:56 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[General Web Dev.]]></category>
		<category><![CDATA[IT Industry]]></category>

		<guid isPermaLink="false">http://blog.crankybit.com/cf8-ajax-flex-air-theres-room-for-everyone/</guid>
		<description><![CDATA[The ColdFusion community has been paying attention to IT journalism lately, for better or worse, and for good reason. Our environment is especially in a state of flux; many of us may had been concerned about the future of ColdFusion given Adobe's acquisition of Macromedia, but those fears were allayed, especially now with Adobe making [...]]]></description>
			<content:encoded><![CDATA[<p>The ColdFusion community has been paying attention to IT journalism lately, for <a href="http://www.pbs.org/cringely/pulpit/2007/pulpit_20070629_002360.html" target="_blank">better</a> or <a href="http://www.softwaredeveloper.com/features/ghosts-in-machine-071207/" target="_blank">worse</a>, and for good reason. Our environment is especially in a state of flux; many of us may had been concerned about the future of ColdFusion given Adobe's acquisition of Macromedia, but those fears were allayed, especially now with Adobe making it so clear that they have invested respectable time and resources into improving ColdFusion with CF8. But the results of the acquisition are only just beginning to emerge. And as Adobe's strategy becomes clearer, it is very evident that they are putting arguably <em>more</em> resources into <em>other</em> technology like Flash and Flex.</p>
<p>What ultimately prompted my thoughts was the article <a href="http://weblog.infoworld.com/yager/archives/2007/07/web_20_needs_ad.html" target="_blank">Web 2.0 Needs Adobe</a> by Tom Yager. His discussion is very flattering for Adobe, although ColdFusion isn't mentioned anywhere. Neither is it mentioned in Cringley's equally flattering article <span><a href="http://www.pbs.org/cringely/pulpit/2007/pulpit_20070629_002360.html" target="_blank">An AIR of Invisibility</a>. There's a reason for this. They're focusing on the <em>user interface </em>of apps, which is really what defines the perception of how responsive and powerful an app can be. Fretting about ColdFusion getting the back seat is like fretting that your favorite athlete wasn't nominated for an Oscar; it wasn't really up for consideration.</span></p>
<p>So, user interface. Now that's something to fret about. Many of us don't like to think about the UI, and that has to change! User interface has always been important when users form their impression of an app, and that high priority is applying more heavily to web apps as they begin to vie for user acceptance with their heavier desktop brethren.</p>
<p>Most ColdFusion developers are using HTML for their user interface. An industry migration will hopefully migrate that median toward AJAX-enhanced HTML or Flex interfaces for web apps, and of course AIR for desktop apps. ColdFusion won't be going anywhere, as our internet connectivity is always going to need a server-side component.</p>
<p>So how are we to react to these articles' evaluations of AJAX and Flex? In a way, they are depicting JavaScript (and thus AJAX) as a dinosaur with wings. It is powerful, it got a shot in the arm with the popularity of AJAX, and it can do amazing things. But it's still a "dinosaur". It is old technology trying to keep up. Enter Flash and Flex. The new kids on the block. They're more modern--but they've had time to mature--and they just out-perform AJAX in what they can accomplish. Now tack on thoughts about how much AJAX functionality Adobe has put into CF8. What's the point if AJAX is inferior to Flex? What does it all mean?</p>
<p>It's a big internet out there. Various scenarios call for various solutions! Whereas it is a good idea for us as ColdFusion application developers to learn Flex and start using it when UI needs call for it, the ultimate point is that we <em>start improving</em> our UIs from plain HTML. Start putting more effort into the user interface. We've had it easy in the past when simpler, less sophisticated interfaces were accepted on the web, and that time is coming to an end as the web pushes forward as a viable application platform.</p>
<p>Is it urgent that we start learning Flex? I feel that AJAX and Flex will be sharing the web application space for a long time. Yes, Flex and Flash might be Adobe's ticket for bringing web apps to the next level, but their commitment to AJAX is very clear. That is evident in the AJAX support in CF8 and AIR. Learn Flex if you can. If it's just too much for you to handle right now, AJAX is a fine step--more palatable and familiar for HTML developers--that will let you focus on the more important point: Improving your app's user interface.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crankybit.com/cf8-ajax-flex-air-theres-room-for-everyone/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Notes: LiveCycle Data Services</title>
		<link>http://blog.crankybit.com/notes-livecycle-data-services/</link>
		<comments>http://blog.crankybit.com/notes-livecycle-data-services/#comments</comments>
		<pubDate>Sat, 30 Jun 2007 15:41:18 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://blog.crankybit.com/notes-livecycle-data-services/</guid>
		<description><![CDATA[LiveCycle Data Services used to be separate from CF. Now they are together, so you don't have to configure the RMI to have them talk to each other. With it, using AS3 and Flash Remoting, you can do stuff like invoke CFC methods from within ActionScript!  No Flex server is involved. Messaging. Publish and subscribe. [...]]]></description>
			<content:encoded><![CDATA[<p>LiveCycle Data Services used to be separate from CF. Now they are together, so you don't have to configure the RMI to have them talk to each other.</p>
<p>With it, using AS3 and Flash Remoting, you can do stuff like invoke CFC methods from within ActionScript!  No Flex server is involved.</p>
<p><strong>Messaging.</strong> Publish and subscribe. I say hello and everyone will listen to me. Someone says goodbye and I hear, and know not to talk to them anymore. ColdFusion can be both a Producer and a Consumer. Publish with sendGatewayMessage() and subscribe with an event gateway CFC.</p>
<p>New in CF8? Faster. Now uses Java API instead of that RMI.  Starting with CF8, it is included right in the CF installer. An express version comes right with CF8.</p>
<p>Not many notes on this, I wasn't following too closely since we won't be getting LCDS, at least not until I'm more heavy into Flex.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crankybit.com/notes-livecycle-data-services/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CFUnited 2007 Preconference Classes</title>
		<link>http://blog.crankybit.com/cfunited-2007-preconference-classes/</link>
		<comments>http://blog.crankybit.com/cfunited-2007-preconference-classes/#comments</comments>
		<pubDate>Wed, 27 Jun 2007 01:25:14 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[General Web Dev.]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://blog.crankybit.com/cfunited-2007-preconference-classes/</guid>
		<description><![CDATA[I attended Rob Gonda's "FLEX Intensive for ColdFusion Developers" class on Monday and Peter Bell's "Practical Code Generation: By Example" class on Tuesday. I didn't take any notes during Rob's class, as we spent practically the entire class scouring through FLEX examples. I did take notes during Peter's class during the discourse sections of his [...]]]></description>
			<content:encoded><![CDATA[<p>I attended <a href="http://www.robgonda.com/">Rob Gonda</a>'s "FLEX Intensive for ColdFusion Developers" class on Monday and <a href="http://www.pbell.com/">Peter Bell</a>'s "Practical Code Generation: By Example" class on Tuesday.</p>
<p>I didn't take any notes during Rob's class, as we spent practically the entire class scouring through FLEX examples. I did take notes during Peter's class during the discourse sections of his class.</p>
<p><strong>FLEX Intensive for ColdFusion Developers</strong></p>
<p>I have two reasons for learning FLEX: (1) I am interested in developing <a href="http://labs.adobe.com/technologies/air/">AIR</a> applications, and I'd like to do some of the more advanced functionality, which requires FLEX. (2) After learning the basics of FLEX, I want to try to use FLEX for some enhanced form functionality!</p>
<p>I think I'd only want to write full-fledged FLEX apps when writing AIR apps. To do this, Rob recommended the official <a href="http://labs.adobe.com/wiki/index.php/Cairngorm">Cairngorm</a> microarchitecture, although <a href="http://www.model-glue.com/flex.cfm">Model Glue: FLEX</a> is now a new option to look into as well. He also recommended using <a href="http://www.ericfeminella.com/blog/cairngen/">Cairngen</a> to get things set up and started with Cairngorm.</p>
<p>Rob usually <em>does</em> include the compiled FLEX SWFs in his Subversion repository. He will have the FLEX source in one directory outside of the web directory, and have the binary output directory be the assets directory within the web directory. This way, the compiled FLEX is ready to be used within the web app, and everything can just be committed to the repository.</p>
<p>Rob recommends using <a href="http://blog.deconcept.com/swfobject/">SWFObject</a> for deploying the SWFs. </p>
<p>Finally, he recommended the <a href="http://labs.adobe.com/wiki/index.php/Flex_Framework:FABridge">FLEX-AJAX Bridge</a>.</p>
<p><strong>Practical Code Generation: By Example</strong></p>
<p>Peter Bell's class was amazing. Even if you decide to use frameworks, you can automate work or application generation by using code generation. Below are my notes from his class.</p>
<p>Active generation (can regenerate as requirements change, and custom code is in separate files) is better, although passive generation (can generate once, but requires tweaking, and cannot regenerate) is faster to implement.</p>
<p><em>Methods for creating the code. </em></p>
<p>Concatenation: Code stored in a variable. &lt;cfset ScriptHTML="&lt;cfquery&gt;..&lt;/cfquery&gt;"&gt;. Good for when there’s variables, looping, etc. When there is a lot of specialized processing.</p>
<p>Templating: Much better. Template-based approach is easier to read and takes up less space. Good for mainly fixed code. Simple models. And it’s an approach we are familiar. ColdFusion itself is a manner of building HTML templates that get modified by the code.</p>
<p><em>Anatomy of a Generator.</em></p>
<ul>
<li>Metadata (List of fields, etc). Could be in database, XML, etc.</p>
<li>Template.
<li>Iterator. We immediately think, “For each business object, do…”
<li>Orchestrator.
</ul>
<p><em>Metadata.</em></p>
<p>Use ColdFusion to build structs. Use XML. Or even flat text in a particular format. Any are fine. </p>
<p><em>Template.</em></p>
<p>XSL, CF Template. We will use CF Template because its readability is so much better than XSL.</p>
<p><em>Iterator.</em></p>
<p>Generate n files. One DAO per business object. One template per screen. Need filter support.</p>
<p><em>Orchestrator.</em></p>
<p>Generate m collections of n files. Tell it what metadata to use with what template, iterating how many times, and how to generate the filenames.</p>
<p><em>Extending Generated Code.</em></p>
<p>Need to mix the custom modifications with the standard generated code.</p>
<p>Protected blocks.  Mark where generated code exists with a special string, and generator will not touch code inside custom blocks. Can actually be harder to write a generator using this method too. So this method is out of favor.</p>
<p>Inheritance.  Just generate the standard CFCs, and you can have custom decorators that inherit the standard CFCs.</p>
<p>Events.  Have custom code that looks for events, and when particular events are thrown by the standard code, the custom code method would generate.</p>
<p>Mixins.  You basically put a <cfinclude> right into the standard code so that the custom code can be inserted right into the execution stream. Of course, this introduces lots of conflicts since you’re sharing the time and space with all of your standard code.</p>
<p>Aspect Oriented Programming (AOP).  When someone calls this method, before, after, or during that, call some custom code.</p>
<p><em>Frameworks vs. Code Generation</em></p>
<p>Remember when there was the initial conflict between compiled vs. interpreted languages? Same consideration for frameworks vs. code generation. Not either/or. Typically there will be a combination of generated code vs. frameworks you use. Intellectual property and performance concerns may be there. You may not want to give away an entire framework that will build something quickly that the clients can change themselves. So, this may cause you to choose code generation.</p>
<p><em>Getting Started</em></p>
<p><a href="http://cftemplate.riaforge.org">http://cftemplate.riaforge.org</a><br />
<a href="http://cfgen.riaforge.org">http://cfgen.riaforge.org</a><br />
<a href="http://www.pbell.com">http://www.pbell.com</a></p>
<p>Also check out opensource projects ColdSpring, LightWire, IBO.</p>
<p><em>Additional Notes During Walkthroughs</em></p>
<p>If you want to automagically generate IDs, titles, etc. for all aspects of the database and CFC, decouple it from the primary code generation. This way, you can generate stuff with almost no work, but yet it is still customizable because you just tweak the generated metadata for the code generation!</p>
<p><em>Design Patterns</em></p>
<p>Model-View-Controller. Business logic in the model. The meat of your application. View is the presentation. Perhaps some HTML or AJAX or Flex that displays it. Controller glues the two together, getting something from the view to the model.</p>
<p>Be careful against putting things in the wrong area. Most notably, beware logic in the controller! If just a web app, you may not notice, but when implementing AJAX or other connectivity, this can cause a problem.</p>
<p><em>Model consists of:</em></p>
<ul>
<li>Bean. Basic business object. Gets, sets, validation.
<li>Service Class / Manager. Used to get beans, in different ways. GetByFilter(), GetByProperty(), DeleteByFilter(), DeleteByProperty(), Save(), New().
<li>Data Access Object / Gateway.
</ul>
<p>CFM page -- Service, which may gen bean -- DAO -- DB.</p>
<p>Generic getters and setters can be handy for dynamic references. Easier for code generation too. Use in conjunction with a GettablePropertyList and SettablePropertyList for controlling access. Can have custom processing too by checking for the custom getter or setter and calling that with an Evaluate().</p>
<p>Typical IBO: get(), set(), access(), mutate(), loadStruct(), loadQuery(), first(), last(), next(), reset()</p>
<p>Remember, even if you just use a code generator to generate forms, or ColdSpring config files, or various other repetitive items, do it! If there is a framework that will meet your needs well enough, just go with that, but you can still help implement it with code generation.</p>
<p>Be careful--there is so much data overlap between the database specs and the CFCs and the forms and whatnot, that before you know it, you’ll be writing code generation for the whole app. </p>
<p>When doing the code generation, you then should use inheritance for the custom code. Develop your service so that it will look to see if the custom CFC exists, and if not, it just sends back the base CFC. You could autogenerate an empty CFC, but then you have to look inside the empty file to see if you have any customization. It is more apparent if the custom CFC doesn’t even exist!</p>
<p><strong>Conclusion</strong></p>
<p>These were a couple great classes. A lot to think about.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crankybit.com/cfunited-2007-preconference-classes/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

