<?xml version="1.0" encoding="utf-8"?>
			
			<rss version="2.0" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cc="http://web.resource.org/cc/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">

			<channel>
			<title>ArgumentCollection - Broadchoice Engineering</title>
			<link>http://blog.broadchoice.com/index.cfm</link>
			<description>The Broadchoice engineering team blog.</description>
			<language>en-us</language>
			<pubDate>Fri, 03 Sep 2010 11:36:26 -0400</pubDate>
			<lastBuildDate>Sat, 14 Mar 2009 19:05:00 -0400</lastBuildDate>
			<generator>BlogCFC</generator>
			<docs>http://blogs.law.harvard.edu/tech/rss</docs>
			<managingEditor>ac@broadchoice.com</managingEditor>
			<webMaster>ac@broadchoice.com</webMaster>
			<itunes:subtitle></itunes:subtitle>
			<itunes:summary></itunes:summary>
			<itunes:category text="Technology" />
			<itunes:category text="Technology">
				<itunes:category text="Podcasting" />
			</itunes:category>
			<itunes:category text="Technology">
				<itunes:category text="Tech News" />
			</itunes:category>
			<itunes:keywords></itunes:keywords>
			<itunes:author></itunes:author>
			<itunes:owner>
				<itunes:email>ac@broadchoice.com</itunes:email>
				<itunes:name></itunes:name>
			</itunes:owner>
			<itunes:image href="" />
			<image>
				<url></url>
				<title>ArgumentCollection - Broadchoice Engineering</title>
				<link>http://blog.broadchoice.com/index.cfm</link>
			</image>
			<itunes:explicit>no</itunes:explicit>
			
			
			
			
			
			<item>
				<title>Transfer ORM and memory usage</title>
				<link>http://blog.broadchoice.com/index.cfm/2009/3/14/Transfer-ORM-and-memory-usage</link>
				<description>
				
				Some people - myself included - have observed runaway memory usage and apparent memory leaks with applications built with certain combinations of CFML frameworks that include Transfer ORM. We spent a lot of time tuning the JVM and looking at code and database usage in our Broadchoice Community Platform (CMS), we worked with Mike Brunt on load testing and tuning (highly recommended - if you have any performance problems, get Mike on your case!) as well as working with Mark Mandel directly on Transfer itself. All that work led to a much more stable system and we decided to just continue investigating as a background task.
				 [More]
				</description>
						
				
				<category>Transfer</category>				
				
				<category>ColdFusion</category>				
				
				<category>Broadchoice Shares Knowledge</category>				
				
				<pubDate>Sat, 14 Mar 2009 19:05:00 -0400</pubDate>
				<guid>http://blog.broadchoice.com/index.cfm/2009/3/14/Transfer-ORM-and-memory-usage</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Broadchoice Community Platform 2.0.11 Released</title>
				<link>http://blog.broadchoice.com/index.cfm/2009/3/11/Broadchoice-Community-Platform-2011-Released</link>
				<description>
				
				As I Twittered on Monday, the new release of the &lt;a
href=&quot;http://www.broadchoice.com/products/community_platform/&quot;&gt;Broadchoice Community Platform&lt;/a&gt; (our hosted content management system) was in QA and had hit zero bugs. QA completed successfully so today we pushed the new release to production. It&apos;s mostly a bug fix and minor enhancements release but it contains one new feature I wanted to talk about from a technical point of view.

The Community Platform has a number of &quot;modules&quot; (applications) that you can add to a page and one of those is a list of documents for download (or external links). You add the module to the page and then select documents (from your document library) to add to that module. In previous releases, authors had to add documents in the order that they wanted them to appear on the (generated) web page. We looked at a number of UI options for allowing authors to &quot;rank&quot; the documents within the module but felt most of them were fairly clunky, involving entering ranking numbers to reorder things or up/down arrows requiring authors to move documents one position at a time. Ugh!

Ray pointed me at one of the cool &lt;a href=&quot;http://jqueryui.com/&quot;&gt;jQuery UI&lt;/a&gt; interactions: sortable. It allows you to mark a &quot;container&quot; tag (e.g., a div) as sortable and then users can drag&apos;n&apos;drop the &quot;child&quot; elements into the order they want. You can attach event handlers that fire at various points in the drag&apos;n&apos;drop operation.

Here&apos;s how we do it:
&lt;code&gt;
&lt;div id=&quot;sortable&quot;&gt;
  &lt;cfloop query=&quot;documents&quot;&gt;
    &lt;div id=&quot;doctag_#documents.id#&quot; onMouseOver=&quot;setCursor(this,&apos;move&apos;)&quot; onMouseOut=&quot;setCursor(this,&apos;auto&apos;)&quot;&gt;
      #documents.name# ... etc ...
    &lt;/div&gt;
  &lt;/cfloop&gt;
&lt;/div&gt;
&lt;/code&gt;
That&apos;s all you need in the HTML. Then you add the following JavaScript:
&lt;code&gt;
$(&apos;#sortable&apos;).sortable({
  update: function(event,ui) {
    jQuery.get(&apos;/updateRank.cfm?&apos; + $(&apos;#sortable&apos;).sortable(&apos;serialize&apos;));
}
&lt;/code&gt;
This causes two things to happen:
&lt;ol&gt;
&lt;li&gt;jQuery marks the sortable div contents as being, well, sortable!&lt;/li&gt;
&lt;li&gt;jQuery adds an event handler for update - when the drag&apos;n&apos;drop operation completes - that invokes a URL on the server, passing in the serialized data from the children of the sortable div, i.e., the id values as a list in the new order: doctag[]=1,3,4,2. It assumes an underscore as a separator.&lt;/li&gt;
&lt;/ol&gt;
The server side code simply updates the module data to put the documents in the specified order.
				
				</description>
						
				
				<category>Tools and Technology</category>				
				
				<category>Broadchoice Shares Knowledge</category>				
				
				<pubDate>Wed, 11 Mar 2009 19:04:00 -0400</pubDate>
				<guid>http://blog.broadchoice.com/index.cfm/2009/3/11/Broadchoice-Community-Platform-2011-Released</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>How many pieces are there in the UTF-8 puzzle?</title>
				<link>http://blog.broadchoice.com/index.cfm/2009/3/9/How-many-pieces-are-there-in-the-UTF8-puzzle</link>
				<description>
				
				I&apos;m blogging this partly as a reminder to myself since I always forget one piece.
&lt;ul&gt;
&lt;li&gt;You need to specify database tables use UTF-8.&lt;/li&gt;
&lt;li&gt;You need to use &lt;tt&gt;setEncoding()&lt;/tt&gt; on &lt;tt&gt;form&lt;/tt&gt; and &lt;tt&gt;URL&lt;/tt&gt; scope to set them to UTF-8 (in &lt;tt&gt;Application.cfc&lt;/tt&gt;).&lt;/li&gt;
&lt;li&gt;You need to set the output content type to UTF-8.&lt;/li&gt;
&lt;li&gt;You need to set the &lt;tt&gt;pageEncoding&lt;/tt&gt; to UTF-8 (on any CFML page which needs it - so you might as well set it on all of them).&lt;/li&gt;
&lt;li&gt;Your datasource setup, at least for MySQL, must have &lt;tt&gt;useUnicode=true&amp;characterEncoding=utf-8&lt;/tt&gt; in the &lt;tt&gt;Connection String&lt;/tt&gt; textarea under &lt;tt&gt;Advanced Settings&lt;/tt&gt;.&lt;/li&gt;
&lt;/ul&gt;
That last piece is the one I tend to forget when I set up a new server. The rest is in code and once you have it in place, it&apos;ll work on any server but that connection string gets me (almost) every time!
				
				</description>
						
				
				<category>ColdFusion</category>				
				
				<pubDate>Mon, 09 Mar 2009 14:54:00 -0400</pubDate>
				<guid>http://blog.broadchoice.com/index.cfm/2009/3/9/How-many-pieces-are-there-in-the-UTF8-puzzle</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Custom Getters and Flex Remoting &quot;gotcha&quot;</title>
				<link>http://blog.broadchoice.com/index.cfm/2009/2/27/Custom-Getters-and-Flex-Remoting-gotcha</link>
				<description>
				
				I ran into an interesting bug in the final stages of preparing the latest release of the &lt;a href=&quot;http://www.broadchoice.com/&quot;&gt;Broadchoice Workspace&lt;/a&gt; application. I had added a custom getter to an ActionScript object to calculate a complex property, along these lines:
&lt;code&gt;
public function get complexProperty() : SomeType
{
	performSomeCalculation()
	return someComplicatedExpression
}
&lt;/code&gt;
This allows you to say &lt;tt&gt;myObj.complexProperty&lt;/tt&gt; without needing parentheses for a function call (and with a matching custom setter, you can assign to the pseudo-property as well). It&apos;s a nice feature of ActionScript that can really make your code much more readable.

The particular getter I added was only valid when certain data in the object was non-null. In all of the mainline use cases inside the application, this was fine. The &lt;tt&gt;complexProperty&lt;/tt&gt; was only ever accessed after testing the condition on the object:
&lt;code&gt;
if ( myObject.someCondition )
{
	doStuffWith( myObject.complexProperty )
}
&lt;/code&gt;
Yes, &lt;tt&gt;someCondition&lt;/tt&gt; was a custom getter as well.

The bug I ran into was that sometimes remote calls involving this object silently failed. I didn&apos;t get a fault back. It was almost like the call just didn&apos;t happen. Puzzled, I fired up the Flex Debugger (which is absolutely awesome!) and traced through the code. No visible exceptions, no strange paths being executed in the code. More puzzled, I fired up JBoss in the Java Debugger under Eclipse and put a breakpoint inside the server method that was called. Strangely, the code ran without hitting the breakpoint! That showed that the call really was not happening for some reason.

Back in the Flex Debugger, I set a breakpoint just before the remote call and took a very close look at the object in the Variables panel when I hit the breakpoint. It showed the custom getter as a property on the object (as expected) but the value in the debugger showed an exception was thrown retrieving the property. Then it hit me: Flex Remoting tries to serialize the object by calling the getters and it was failing due to the exception - and silently swallowing the exception without telling me, and without executing the remote call!

I updated the getter to return a default value if the condition (&lt;tt&gt;myObject.someCondition&lt;/tt&gt;) was false and, sure enough, the object serialized just fine and the remote call was successfully executed!

Moral of the story: if you add custom getters to ActionScript objects, make sure they cannot throw an exception when the object is in a state where you need to send it to the server using Flex Remoting!
				
				</description>
						
				
				<category>Flex</category>				
				
				<category>Broadchoice Shares Knowledge</category>				
				
				<category>BlazeDS</category>				
				
				<pubDate>Fri, 27 Feb 2009 20:15:00 -0400</pubDate>
				<guid>http://blog.broadchoice.com/index.cfm/2009/2/27/Custom-Getters-and-Flex-Remoting-gotcha</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Announcing Broadchoice Workspace Free Edition!</title>
				<link>http://blog.broadchoice.com/index.cfm/2009/2/27/Announcing-Broadchoice-Workspace-Free-Edition</link>
				<description>
				
				Back when we ran the beta program for &lt;a href=&quot;http://www.broadchoice.com/&quot;&gt;Broadchoice Workspace&lt;/a&gt; we talked about the possibility of offering a completely free version alongside our subscription-based version. By the time we officially launched the product, just before MAX 2008, we settled on a 30-day trial period and a subscription-only model.

Since launch, we&apos;ve been evolving the product, streamlining the user experience, simplifying the navigation, providing real-time activity notifications (&quot;toasts&quot;) and native application menu support. We&apos;ve also continued to extend the integration with Salesforce, reducing the data entry burden on sales people.

With our latest release today, we are now offering a free edition of Workspace instead of the previous 30-day trial. You can now &lt;a href=&quot;http://www.broadchoice.com/pricing/&quot;&gt;download Workspace&lt;/a&gt; and use it - for free - for as long as you want. Naturally, the free edition has a few restrictions (shown on the pricing page) but for smaller teams or individuals this provides a great collaboration experience without costing you a penny (or a cent).

We originally provided all of our beta testers with a free one-year subscription to thank them for their help in shaping the initial version of the product. We&apos;ve converted all the beta accounts over to the free edition so that they can continue to use Workspace indefinitely at no cost.

If you&apos;ve wanted to check out the AIR application but were put off by the 30-day trial, now is your chance to try it out for free and see how it can help you and your colleagues (and friends!) collaborate on projects!
				
				</description>
						
				
				<category>Beta</category>				
				
				<category>AIR</category>				
				
				<category>Workspace</category>				
				
				<pubDate>Fri, 27 Feb 2009 19:57:00 -0400</pubDate>
				<guid>http://blog.broadchoice.com/index.cfm/2009/2/27/Announcing-Broadchoice-Workspace-Free-Edition</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Groovy JavaScript</title>
				<link>http://blog.broadchoice.com/index.cfm/2009/2/12/Groovy-JavaScript</link>
				<description>
				
				Many moons ago I &lt;a href=&quot;http://blog.broadchoice.com/index.cfm/2008/9/9/Groovy-HTML&quot;&gt;blogged&lt;/a&gt; on how you can use Groovy to generate HTML files. I&apos;m not doing this a lot at Broadchoice, only for a few administration type pages, but I had to work within this framework again this morning and ran into a little issue with JavaScript. I wanted to add a bit of jQuery to my page. Should be simple enough, right? My HTML document had an existing head that looked like this:

&lt;code&gt;
head {
	title &apos;TPS Reports&apos;
}
&lt;/code&gt;

This generates:

&lt;code&gt;
&lt;head&gt;
&lt;title&gt;TPS Reports&lt;/title&gt;
&lt;/head&gt;
&lt;/code&gt;

So adding jQuery in should be as simple as this:

&lt;code&gt;
head {
	title &apos;TSP Reports&apos;
	script(type:&apos;text/javascript&apos;,src:&apos;js/jquery.js&apos;)
}
&lt;/code&gt;

Right? Unfortunately, it isn&apos;t quite that easy. Sure, this &lt;i&gt;works&lt;/i&gt; and generates out what you expect:

&lt;code&gt;
&lt;script type=&apos;text/javascript&apos; src=&apos;js/jquery.js&apos; /&gt;
&lt;/code&gt;

But notice the self-closing script tag? This doesn&apos;t work in some browsers. I thought perhaps it was just IE, but it didn&apos;t work in Firefox. Safari had no problem with it. (And I&apos;d love to hear a good reason on why a self-closing script tag doesn&apos;t work. Seems like a bug to me!)

Unfortunately, I couldn&apos;t figure a way to tell Groovy&apos;s HTML Builder to include a &apos;real&apos; closing tag as opposed to a self-closing tag. I then figured out this simple hack:

&lt;code&gt;
script(type:&quot;text/javascript&quot;,src:&apos;js/jquery.js&apos;,&apos; &apos;)
&lt;/code&gt;

Notice the last unnamed argument? This will be used as the content for the script tag. You end up with:

&lt;code&gt;
&lt;script type=&apos;text/javascript&apos; src=&apos;js/jquery.js&apos;&gt; &lt;/script&gt;
&lt;/code&gt;

Which works just fine in Firefox and Safari. Silly, but effective. One more quick tip, although it&apos;s kind of obvious. I wasn&apos;t quite sure how I was going to write my JavaScript code since everything has to be formatted just right inside the builder. Then I remembered that I could simply provide the code as an argument:

&lt;code&gt;
def code = &quot;&quot;&quot;
console.log(&apos;yep, Im running&apos;);
&quot;&quot;&quot;

html.html{
	head {
		title &apos;Space/Feed Actity Report&apos;
		script(type:&quot;text/javascript&quot;,src:&apos;js/jquery.js&apos;,&apos; &apos;)
		script(type:&quot;text/javascript&quot;,code)
&lt;/code&gt;
				
				</description>
						
				
				<category>Groovy</category>				
				
				<pubDate>Thu, 12 Feb 2009 16:12:00 -0400</pubDate>
				<guid>http://blog.broadchoice.com/index.cfm/2009/2/12/Groovy-JavaScript</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>ColdFusion in the Cloud Revisited</title>
				<link>http://blog.broadchoice.com/index.cfm/2009/1/9/ColdFusion-in-the-Cloud-Revisited</link>
				<description>
				
				About a month ago, I talked about &lt;a href=&quot;http://blog.broadchoice.com/index.cfm/2008/12/13/ColdFusion-in-the-Cloud-and-clustering&quot;&gt;my experience of setting up clustered ColdFusion instances on EC2&lt;/a&gt;. Since then we have migrated the Broadchoice Web Platform completely from a regular data center, where it had lived since launch, to the Amazon cloud and now all of the *.broadchoice.com sites and all of our client sites based on the Web Platform are happily running in the cloud.

We&apos;ve been very pleased with the performance and stability of EC2 so far and we&apos;re comfortable about scaling out as demand increases. We took advantage of Amazon&apos;s EBS (Elastic Block Storage) that allows you to mount S3 storage directly as part of the file system on EC2. This essentially replaces the NAS we were using in the data center where all uploaded files were placed. We run two ColdFusion instances on a medium EC2 instance and run MySQL on a separate EC2 instance (actually on the instance that is currently running our AIR application, the &lt;a href=&quot;http://www.broadchoice.com/&quot;&gt;Broadchoice Workspace for Salesforce&lt;/a&gt;, along with its MySQL database). We replicate the MySQL databases to another server (in a data center) so that we can restore / recover in the event of a problem with EC2. We also run scheduled backups of the EC2 instances to S3.

As I noted in my earlier entry, we&apos;re using Apache and the JRun Connector to manage the two instance cluster and failover. I&apos;m still suspicious of the connector due to past experience but so far it has been behaving well and when we restart instances for maintenance, we&apos;re generally seeing uninterrupted service, from a user&apos;s point of view, as requests silently failover to the other instance.

If you&apos;re interested in running ColdFusion in the cloud, you&apos;ll need to talk to Adobe about licensing (either Adam Lehman or Kristen Schofield) but they are being very encouraging because they want this to happen. The more of us who do this, the better the argument they can present internally to get the EULA changed to support ColdFusion running in the cloud!

If you want to learn more about how we handled the migration and/or what to watch out for when designing applications that run well on the cloud, feel free to &lt;a href=&quot;http://blog.broadchoice.com/contact.cfm&quot;&gt;contact me&lt;/a&gt; via this blog or directly (c&apos;mon, you know my email address!).
				
				</description>
						
				
				<category>ColdFusion</category>				
				
				<category>Broadchoice Shares Knowledge</category>				
				
				<pubDate>Fri, 09 Jan 2009 16:23:00 -0400</pubDate>
				<guid>http://blog.broadchoice.com/index.cfm/2009/1/9/ColdFusion-in-the-Cloud-Revisited</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Recentering Flex Alerts on Application Resize</title>
				<link>http://blog.broadchoice.com/index.cfm/2009/1/5/Recentering-Flex-Alerts-on-Application-Resize</link>
				<description>
				
				I recently had a bit of a challenge to tackle with our &lt;a href=&quot;http://www.broadchoice.com/what_is_workspace/&quot; target=&quot;_blank&quot;&gt;Workspace&lt;/a&gt; application and thought I would share some details. As many of you probably know from trying out the application, Workspace is meant to be kept open to fully capitalize on it&apos;s collaborative features. The application provides a lot of behavior that is based on real-time communication, such as content being updated or users being added to Spaces. All of this works quite well right now, and we are already working on more features as well as some simplification of the interface to allow new users to get up and running more quickly.

We have, however, noticed a small but annoying glitch that happens as a result of certain real-time notifications that trigger Flex Alerts. Namely, if the application is minimized and an Alert is triggered, when the application is maximized, the Alert does not appear in the proper place. Normally, an Alert will automatically center itself in the window where it appears. But if the application is minimized, this centering does not happen. So when the app is maximized again, the modal Alert is located far in the upper left corner of the screen, with most of it&apos;s content off the screen completely. Users had a hard time figuring out what was happening, and since the Alert is modal, the app can&apos;t be used until the Alert is closed. This resulted in a lot of confused users!

I set out to solve this issue by triggering a re-centering of any open Alerts when the application is resized, but this turned out to be more difficult than it first appears. At first, this seemed like it should be fairly simple: the Flex SystemManager object contains a property called popUpChildren, which references any PopUp objects that are open. So no problem, right? Just loop over this list and recenter them.

In a frustrating turn of events, Flex Alert objects are not stored in this list. I&apos;m not sure why, but they aren&apos;t. This seems like an oversight or bug, but the fact remains that looking at the popUpChildren wouldn&apos;t work. This list appears to only contain any PopUp instances created using the PopUpManager, but not any Alert instances. Nor is there a similar list such as alertChildren. It turns out that Alerts are added to the SystemManager&apos;s display list but are not actually kept track of anywhere.

The first part of the solution was to add an application resize event handler that loops through all children of the SystemManager&apos;s display list and locates any that are instances of the Alert class:

&lt;code&gt;
var systemManager : SystemManager = Application.application.systemManager;

// Look for children of SystemManager that are Alerts, and recenter them.
for ( var i:int = 0; i &amp;lt; systemManager.numChildren; i++ )
{
	var thisChild : Object = systemManager.getChildAt( i );
	if( thisChild is Alert )
	{
		PopUpManager.centerPopUp( thisChild as IFlexDisplayObject );
	}
}
&lt;/code&gt;

This code actually does work and will recenter the Alert. But in another frustrating turn (and what certainly appears to be another bug), the re-centered Alerts did not display correctly. Any text within the Alert box that was &quot;off the screen&quot; prior to re-centering would not display. I tried triggering an invalidateDisplayList() and invalidateProperties(), but nothing would get the Alert to re-draw the text correctly. I was banging my head against the monitor when my astute colleague Joe Rinehart made a suggestion that turned out to give the desired result:

&lt;code&gt;
var systemManager : SystemManager = Application.application.systemManager;

// Look for children of SystemManager that are Alerts, and recenter them.
for ( var i:int = 0; i &amp;lt; systemManager.numChildren; i++ )
{
	var thisChild : Object = systemManager.getChildAt( i );
	if( thisChild is Alert )
	{
		PopUpManager.removePopUp( thisChild as IFlexDisplayObject );
		PopUpManager.addPopUp( thisChild as IFlexDisplayObject, this );
		PopUpManager.centerPopUp( thisChild as IFlexDisplayObject );
	}
}
&lt;/code&gt;

Essentially, you have to kick Flex in the head by removing the Alert, re-adding it, and then re-centering it for good measure. All of this seems like a lot of hoops to jump through to accomplish something that seems like it should be rather easy to do, but there you have it. Going forward, we&apos;ll probably set up some sort of centralized manager class that can be used to create and keep track of both Alerts, PopUps, and any other components that need to display at the very top display list of the application (such as Callouts and Tooltips), and we&apos;re also looking at some Growl-like notifications to minimize the use of Alerts. But that&apos;s a topic for another day (probably in the very near future though). In any event, hopefully this post will help anyone who ends up in a similar situation!
				
				</description>
						
				
				<category>Flex</category>				
				
				<category>Workspace</category>				
				
				<category>AIR</category>				
				
				<category>Broadchoice Shares Knowledge</category>				
				
				<pubDate>Mon, 05 Jan 2009 11:51:00 -0400</pubDate>
				<guid>http://blog.broadchoice.com/index.cfm/2009/1/5/Recentering-Flex-Alerts-on-Application-Resize</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>ColdFusion to Groovy - List issue</title>
				<link>http://blog.broadchoice.com/index.cfm/2008/12/17/ColdFusion-to-Groovy--List-issue</link>
				<description>
				
				I recently ran into an interesting issue involving ColdFusion, Groovy, and Lists. I thought I&apos;d share, but before I go any further, please remember that I am still very new to Groovy. There is a good chance that I may mis-label something. So with that said, what was the problem?

The mobile version of our application is a ColdFusion web site that speaks to Groovy via ColdSpring configured beans provided to our Model-Glue application. This makes it incredibly easy for me to reuse all the Groovy services we built for the AIR application. When I need to get some content, for example, I can do:

&lt;code&gt;
&lt;cfset arguments.event.setValue(&quot;task&quot;, beans.contentService.getCurrentUserContentItem(javaCast(&quot;long&quot;,id)))&gt;
&lt;/code&gt;

The only clue that something non-CFML is going on here is with the javaCast. Outside of that I may as well be using a 100% pure CFML application. 

In general, this just plain works. Period. However, last week I ran into an odd issue with one method that took a list as an argument. I knew that a list in Groovy was an ArrayList, and that should correspond to an array in ColdFusion. I created my object, let&apos;s call it ob, and then ran code similar to this:

&lt;code&gt;
&lt;cfset beans.contentService.savePublications([ob])&gt;
&lt;/code&gt;

Note the use of [] to shortcut the need for me actually creating an array. If that is confusing, think of it as:

&lt;code&gt;
&lt;cfset var arr = arrayNew(1)&gt;
&lt;cfset arr[1] = ob&gt;
&lt;cfset beans.contentService.savePublications(arr)&gt;
&lt;/code&gt;

That should work, right? Unfortunately it didn&apos;t. I kept getting errors saying that my data was some odd, generic Java object as opposed to the casted object it should have been within Groovy. I tried a few things - like for example, changing my closure from:

&lt;code&gt;
contentItems.each { contentToSave -&gt;
more logic here....
}
&lt;/code&gt;

To

&lt;code&gt;
contentItems.each { Content contentToSave -&gt;
more logic here...
}
&lt;/code&gt;

I thought maybe the extra hinting there would help. All that did was move the error up to the beginning of the closure. Eventually I gave up. I wrote a new method in Groovy that took a singular object and simply called the list version. While this worked, I wasn&apos;t terribly happy with it, and shared the problem with my coworker. Sean suggested that the problem may lie in the array ColdFusion was creating. He suggested using an ArrayList in CF and then passing that to Groovy. I modified my CFML like so:

&lt;code&gt;
&lt;cfset var al = createObject(&quot;java&quot;, &quot;java.util.ArrayList&quot;)&gt;
&lt;cfset pub = createObject(&quot;java&quot;, &quot;com.broadchoice.bcp.model.beans.Publication&quot;)&gt;
&lt;cfset pub.content = bookmark&gt;
&lt;cfset pub.space = space&gt;
&lt;cfset al.add(pub)&gt;
&lt;cfset beans.contentService.savePublications(al)&gt;
&lt;/code&gt;

This worked like a charm. It was a bit more code to work with, but at least I could use the same service methods AIR was using for the same business logic.
				
				</description>
						
				
				<category>Groovy</category>				
				
				<category>ColdFusion</category>				
				
				<pubDate>Wed, 17 Dec 2008 13:04:00 -0400</pubDate>
				<guid>http://blog.broadchoice.com/index.cfm/2008/12/17/ColdFusion-to-Groovy--List-issue</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>ColdFusion in the Cloud (and clustering)</title>
				<link>http://blog.broadchoice.com/index.cfm/2008/12/13/ColdFusion-in-the-Cloud-and-clustering</link>
				<description>
				
				This week has seen my focus shift back from ActionScript / Groovy to ColdFusion, although not specifically programming in CFML. A couple of blogs have been buzzing about the pros and cons (and plain ol&apos; whys) of running ColdFusion in the cloud, such as on Amazon&apos;s EC2 service. Obviously you can run &lt;a href=&quot;http://www.openbluedragon.org/&quot;&gt;Open BlueDragon&lt;/a&gt; or &lt;a href=&quot;http://railo.ch/&quot;&gt;Railo&lt;/a&gt; without worrying about cost but for many people, only Adobe ColdFusion will really do what they need and the current EULA does not really accommodate that (partly because the &quot;per 2 CPU&quot; aspect doesn&apos;t cover the Amazon situation where you simply don&apos;t know how many &lt;strong&gt;physical&lt;/strong&gt; CPUs you actually have!).
				 [More]
				</description>
						
				
				<category>ColdFusion</category>				
				
				<pubDate>Sat, 13 Dec 2008 21:47:00 -0400</pubDate>
				<guid>http://blog.broadchoice.com/index.cfm/2008/12/13/ColdFusion-in-the-Cloud-and-clustering</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>One Month On...</title>
				<link>http://blog.broadchoice.com/index.cfm/2008/12/13/One-Month-On</link>
				<description>
				
				It&apos;s been almost exactly one month since we launched the &lt;a href=&quot;http://www.broadchoice.com/&quot;&gt;Broadchoice Workspace&lt;/a&gt; application, just before Adobe MAX 2008, and during that time hundreds of new users have been downloading the application and starting their 30-day free trials - in addition to our many beta testers who are continuing to use the application on a daily basis. The ArgumentCollection team has been hard at work on a new build of Workspace which went into production this week. We&apos;ve now surfaced all the trial subscription machinery and added licensing, in time for those 30-day trials to turn into paid subscriptions, and added a file storage usage indicator (a Workspace account gives you 5GB of storage, which may not have been obvious before).

We&apos;ve also added automatic synchronization of activity in the Workspace back to Salesforce for collaborative spaces that have been created from opportunities. If you create a Note in Workspace, it is automatically added to Salesforce, along with any messaging in the space so that the opportunity history in Salesforce shows all of the collaboration you did to help close a sale. Given how salespeople often feel about the Salesforce.com web interface, this has proved to be very popular in sneak peeks since it provides them with a much simpler way to keep their opportunities up to date in addition to the ability to easily get help from their colleagues in closing sales.

We&apos;ve also made a number of changes to the user interface in response to feedback from customers. Some are simple tweaks to visual aspects of the UI, some are simplifications to make workflows more intuitive. There&apos;s always more polishing to do!

Over the next couple of builds we&apos;ll be focusing on streamlining common workflows and making it even easier for new users to start using the application to collaborate with colleagues, as well as giving the iPhone web version lots of love and adding full support for the Blackberry.
				
				</description>
						
				
				<category>Workspace</category>				
				
				<pubDate>Sat, 13 Dec 2008 20:59:00 -0400</pubDate>
				<guid>http://blog.broadchoice.com/index.cfm/2008/12/13/One-Month-On</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Broadchoice Workspace - 2-for-1 license offer ends Sunday</title>
				<link>http://blog.broadchoice.com/index.cfm/2008/11/26/Broadchoice-Workspace--2for1-license-offer-ends-Sunday</link>
				<description>
				
				Broadchoice is offering &lt;a href=&quot;http://www.broadchoice.com/downloads/&quot;&gt;two licenses for the price of one&lt;/a&gt; through the end of November. You can download the Workspace application and start your free 30-day trial any time but if you actually place your order before Monday, December 1st, you can benefit from the 2-for-1 pricing and get two user licenses for every $99/year you spend! Happy Thanksgiving!
				
				</description>
						
				
				<category>Workspace</category>				
				
				<pubDate>Wed, 26 Nov 2008 19:36:00 -0400</pubDate>
				<guid>http://blog.broadchoice.com/index.cfm/2008/11/26/Broadchoice-Workspace--2for1-license-offer-ends-Sunday</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Unit Testing Improves Your Love Life</title>
				<link>http://blog.broadchoice.com/index.cfm/2008/11/26/Unit-Testing-Improves-Your-Love-Life</link>
				<description>
				
				Oh, sorry, that was the title of the BACFUG presentation by Bill Shelton and Marc Esher (of MXUnit fame)!

Unit testing has defined my working day. I&apos;ve been working on the licensing subsystem of the next build of the &lt;a href=&quot;http://www.broadchoice.com/what_is_workspace/&quot;&gt;Broadchoice Workspace&lt;/a&gt; today and because we practice Test-Driven Development (thanx Brian!), that means writing unit tests &quot;first&quot; or at least alongside the production code.

I started by writing the License bean and an accompanying LicenseTest. The bean has a handful of properties and two methods. The unit test has nine test methods.

Fairly confident that the bean was correct, I moved on to the data layer. Apart from encryption, this mostly follows our well-tested generic Hibernate DAO. That meant only a couple of unit tests.

Once those tests passed, I moved on to the service layer. Six unit tests for four service methods.

At this point I&apos;m ready to write the remote service facade (which implements user-level security) but I&apos;m fairly confident our licensing subsystem will work as expected. 623 lines of code, just over half of which is unit tests (327 lines to 296 production code). I&apos;ll probably add some more data layer unit tests since I have a couple of &quot;untested&quot; methods (they&apos;re used in the service layer tests).

Unit tests may seem dull and tedious but they really can make your life easier.
				
				</description>
						
				
				<category>Tools and Technology</category>				
				
				<category>Broadchoice Shares Knowledge</category>				
				
				<pubDate>Wed, 26 Nov 2008 04:06:00 -0400</pubDate>
				<guid>http://blog.broadchoice.com/index.cfm/2008/11/26/Unit-Testing-Improves-Your-Love-Life</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Cocomo Post-MAX</title>
				<link>http://blog.broadchoice.com/index.cfm/2008/11/24/Cocomo-PostMAX</link>
				<description>
				
				Adobe&apos;s Cocomo technology entered public beta at MAX and the day one keynote featured an extremely brief demo of a little of what Cocomo can do. Nigel Pegg (of the Cocomo team) did a couple of sessions during the conference which I had planned to attend but, as is usual with MAX, my schedule got derailed early and often so I didn&apos;t make either of them. I&apos;ll be writing up my MAX experience on my own blog shortly (and may contribute an extended version as an article for &lt;a href=&quot;http://fusionauthority.com/&quot;&gt;Fusion Authority&lt;/a&gt; as I have done with conferences in the past).

Now MAX is over, Nigel has &lt;a href=&quot;http://blogs.adobe.com/collabmethods/2008/11/cocomo_public_beta_max_and_exh.html&quot;&gt;blogged more about Cocomo&lt;/a&gt; and talks about what beta testers get access to in terms of source code, documentation and features. Nigel includes a nod to me for contributing the Groovy version of the provisioning script and and a mention of the Broadchoice Workspace which uses Cocomo behind the scenes - and which we demo&apos;d at both the Adobe Partner booth (Wednesday lunchtime) and on the &lt;a href=&quot;http://ribbit.com/&quot;&gt;Ribbit&lt;/a&gt; booth.

If you didn&apos;t get a chance to look at Ribbit, check out this &lt;a href=&quot;http://video.ribbit.com/developer_site/chuck/video1.html&quot;&gt;video of Joe and Rick (our CTO) talking about Ribbit integration&lt;/a&gt; into Broadchoice Workspace (as a proof of concept for now - would the ability to make phone calls from within the Workspace be valuable to you?).
				
				</description>
						
				
				<category>Tools and Technology</category>				
				
				<category>Workspace</category>				
				
				<pubDate>Mon, 24 Nov 2008 15:42:00 -0400</pubDate>
				<guid>http://blog.broadchoice.com/index.cfm/2008/11/24/Cocomo-PostMAX</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Some Code Statistics for Broadchoice Workspace</title>
				<link>http://blog.broadchoice.com/index.cfm/2008/11/14/Some-Code-Statistics-for-Broadchoice-Workspace</link>
				<description>
				
				Now that the &lt;a href=&quot;http://www.broadchoice.com/what_is_workspace/&quot; target=&quot;_blank&quot;&gt;Broadchoice Workspace&lt;/a&gt; has been officially released, I thought I&apos;d post a quick entry with some code statistics. I ran the codebase through a line counting tool that gives a breakdown by file, folder, language, etc. We all know that lines of code is not a very good way to judge quality or effort, but it is still interesting in a general way. This is only lines of code, all blank lines and comments were excluded:

&lt;ul&gt;
&lt;li&gt;Total Lines of Code: 50,125&lt;/li&gt;
&lt;li&gt;Total Files: 633&lt;/li&gt;
&lt;li&gt;Lines of MXML: 10,784&lt;/li&gt;
&lt;li&gt;Lines of ActionScript: 12,675&lt;/li&gt;
&lt;li&gt;Lines of CFML: 7,730&lt;/li&gt;
&lt;li&gt;Lines of Groovy: 8,878&lt;/li&gt;
&lt;li&gt;Lines of XML: 1,757&lt;/li&gt;
&lt;li&gt;Lines of CSS, HTML, JavaScript, etc.: 7,612&lt;/li&gt; 
&lt;li&gt;Lines of SQL: 1,089&lt;/li&gt;
&lt;li&gt;Lines excluded as comments or blank: 15,778&lt;/li&gt;
&lt;/ul&gt;
				
				</description>
						
				
				<category>Workspace</category>				
				
				<category>General</category>				
				
				<category>Tools and Technology</category>				
				
				<category>AIR</category>				
				
				<category>Broadchoice Shares Knowledge</category>				
				
				<pubDate>Fri, 14 Nov 2008 20:10:00 -0400</pubDate>
				<guid>http://blog.broadchoice.com/index.cfm/2008/11/14/Some-Code-Statistics-for-Broadchoice-Workspace</guid>
				
			</item>
			
		 	
			</channel></rss>