<?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>Brian Kotek: Inversion of Control - Development</title>
			<link>http://www.briankotek.com/blog/index.cfm</link>
			<description>Brian Kotek on ColdFusion, Flex, AIR, Java, Groovy, Design Patterns, and Object-Oriented Programming</description>
			<language>en-us</language>
			<pubDate>Tue, 07 Sep 2010 10:44:46 -0700</pubDate>
			<lastBuildDate>Wed, 04 Aug 2010 15:33:00 -0700</lastBuildDate>
			<generator>BlogCFC</generator>
			<docs>http://blogs.law.harvard.edu/tech/rss</docs>
			<managingEditor>brian428@briankotek.com</managingEditor>
			<webMaster>brian428@briankotek.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>brian428@briankotek.com</itunes:email>
				<itunes:name></itunes:name>
			</itunes:owner>
			
			<itunes:explicit>no</itunes:explicit>
			
			
			
			
			
			<item>
				<title>CFUnited Clean Code and Swiz Presentations Now Online</title>
				<link>http://www.briankotek.com/blog/index.cfm/2010/8/4/CFUnited-Clean-Code-and-Swiz-Presentations-Now-Online</link>
				<description>
				
				Just a quick note that, as promised, my presentations from CFUnited are now online!

&lt;a href=&quot;http://slidesix.com/view/Brian-Kotek--Clean-Code--CFUnited-2010&quot; target=&quot;_blank&quot;&gt;Clean Code&lt;/a&gt;

&lt;a href=&quot;http://slidesix.com/view/Brian-Kotek--Swiz--CFUnited-2010&quot; target=&quot;_blank&quot;&gt;The Swiz Framework for Flex and ActionScript&lt;/a&gt;

Thanks to all who attended!
				
				</description>
				
				
				<category>Development</category>
				
				<category>Flex</category>
				
				<category>Conferences</category>
				
				<category>Presentations</category>
				
				<category>Swiz</category>
				
				<pubDate>Wed, 04 Aug 2010 15:33:00 -0700</pubDate>
				<guid>http://www.briankotek.com/blog/index.cfm/2010/8/4/CFUnited-Clean-Code-and-Swiz-Presentations-Now-Online</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>An Awesome Alternative to a Traditional Mouse</title>
				<link>http://www.briankotek.com/blog/index.cfm/2010/2/25/An-Awesome-Alternative-to-a-Traditional-Mouse</link>
				<description>
				
				Like most of you, I sit in front of a computer for a large part of my day. Over time, sitting and working on the computer has caused me varying physical issues, like back, wrist, and elbow pain. To alleviate this, I bought a desk with an adjustable height, an ergonomic keyboard, and an Aeron chair. These have helped greatly. But the one issue that kept coming back was wrist pain. I tried several types of mice, with varying shapes, but none of them dealt completely with the issue. For me, a big part of the discomfort in my hand and elbow came from constantly reaching over for the mouse, as well as gripping it. It might sound silly to some, but when you do this thousands of times, it adds up!

Then, about six months ago, I found a blurb about the &lt;a href=&quot;http://ergo.contourdesign.com/products/product-detail.aspx?id=50&quot; target=&quot;_blank&quot;&gt;RollerMouse Free&lt;/a&gt; on some tech site. Having used it daily for a while, I can say that this mouse is an excellent option to a traditional mouse.

The RollerMouse sits directly under your keyboard, just past the space bar. To control the cursor, you roll a bar up, down, and side to side. It sounds bizarre, but it works very nicely and was easy to get used to. The bar moves very smoothly, and is very accurate. You can easily move it with your thumbs, and you barely have to move your hands off the keyboard, or you can use your fingertips. Either way, it&apos;s far better than reaching over for a normal mouse.

I still keep a regular mouse as well, but I use it pretty infrequently (except for gaming!). This odd new RollerMouse is the workhorse now. I just wanted to mention this device in case anyone else has similar problems and was frustrated trying to solve them. I was uncertain about how this thing would work out, but it really does work well. There&apos;s a video at the product web site which shows how it works in more detail, if you&apos;re interested to see it in action.
				
				</description>
				
				
				<category>Development</category>
				
				<category>Computers</category>
				
				<category>Personal</category>
				
				<pubDate>Thu, 25 Feb 2010 09:30:00 -0700</pubDate>
				<guid>http://www.briankotek.com/blog/index.cfm/2010/2/25/An-Awesome-Alternative-to-a-Traditional-Mouse</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>My CFinNC Presentations at SlideSix</title>
				<link>http://www.briankotek.com/blog/index.cfm/2009/10/22/My-CFinNC-Presentations-at-SlideSix</link>
				<description>
				
				I&apos;ve uploaded my &lt;a href=&quot;http://www.cfinnc.com&quot; target=&quot;_blank&quot;&gt;CFinNC&lt;/a&gt; presentations to SlideSix for anyone who&apos;s interested:

&lt;a href=&quot;http://slidesix.com/view/Brian-Kotek--CFinNC--OO-Design-Principles-Final&quot; target=&quot;_blank&quot;&gt;Object-Oriented Design Principles&lt;/a&gt;

&lt;a href=&quot;http://slidesix.com/view/Swiz--Brian-Kotek--CFinNC&quot; target=&quot;_blank&quot;&gt;Introduction to Swiz&lt;/a&gt;

Overall, CFinNC was great. I actually had to work for a large chunk of the weekend so aside from presenting and mingling with folks later in the evening, I didn&apos;t get to attend many other sessions. That said, everything looked top-notch while I was there. The conference unfolded very smoothly and all of the attendees seemed very engaged. Hats off to Dan Wilson and the entire volunteer team for pulling this off! This conference definitely held its own against the other CF conferences I&apos;ve attended. It was very difficult to tell that it was completely free. Hopefully we can do it again next year!
				
				</description>
				
				
				<category>Development</category>
				
				<category>ColdFusion</category>
				
				<category>OOP CF</category>
				
				<category>Flex</category>
				
				<category>Conferences</category>
				
				<category>Presentations</category>
				
				<category>Swiz</category>
				
				<pubDate>Thu, 22 Oct 2009 12:02:00 -0700</pubDate>
				<guid>http://www.briankotek.com/blog/index.cfm/2009/10/22/My-CFinNC-Presentations-at-SlideSix</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Flex DataGridColumn Complex Properties Bug and Workaround</title>
				<link>http://www.briankotek.com/blog/index.cfm/2009/10/9/Flex-DataGridColumn-Complex-Properties-Bug-and-Workaround</link>
				<description>
				
				One Flex limitation I&apos;ve had to work around for a long time is the need for having a complex property name as the dataField for a DataGridColumn, like this:

&lt;code&gt;&lt;mx:DataGridColumn headerText=&quot;Client&quot; dataField=&quot;client.name&quot; /&gt;&lt;/code&gt;

I had written a nice, generic, custom labelFunction as well as a custom NestedPropertyDataGridColumn to handle this, and it all seemed to work well.

I just discovered that the Flex team had addressed this in the Flex 3.4 SDK update, though I don&apos;t think you&apos;d ever know it since I couldn&apos;t find any actual note that this was added. The only reason I discovered this was actually looking at the source code, and then finding &lt;a href=&quot;https://bugs.adobe.com/jira/browse/SDK-9801&quot; target=&quot;_blank&quot;&gt;this ticket&lt;/a&gt; in the Flex issue tracker.

So yay, we can use complex properties in our DataGridColumns now! Except...&lt;a href=&quot;http://bugs.adobe.com/jira/browse/SDK-23643&quot; target=&quot;_blank&quot;&gt;it&apos;s broken&lt;/a&gt;.

Ugh. Really, guys on the Flex team? This was added and no one ever bothered to click on the column to sort it? Hmph.

Anyway, as one workaround, you can use a custom DataGridColumn combined with a custom Sort to get proper sorting in most cases:

&lt;code&gt;js|
package com.briankotek.util.datagrid
{

import mx.collections.ListCollectionView;
import mx.controls.DataGrid;
import mx.controls.dataGridClasses.DataGridColumn;
import mx.core.mx_internal;
use namespace mx_internal;

/**
 * A custom DataGridColumn that supports sorting a column that has a nested child property path for the dataField value.
 */
public class DataGridColumnNested extends DataGridColumn
{
	public function DataGridColumnNested( columnName : String = null )
	{
		super( columnName );
	}

	/**
	 * Override itemToLabel to force a ComparableSort custom sort class onto the parent DataGrid dataProvider.
	 * This works around a bug in sorting columns with complex property names in the dataField value.
	 * @param data
	 * @return
	 */
	override public function itemToLabel( data : Object ) : String
	{
		var parent : DataGrid;
		if( owner &amp;&amp; owner is DataGrid )
		{
			parent = owner as DataGrid;

			if( hasComplexFieldName &amp;&amp; parent &amp;&amp; parent.sortableColumns &amp;&amp; parent.dataProvider is ListCollectionView &amp;&amp;
				(
					!( ListCollectionView( parent.dataProvider ).sort ) ||
					!( ListCollectionView( parent.dataProvider ).sort is ComparableSort )
				)
			  )
			{
				ListCollectionView( parent.dataProvider ).sort = new ComparableSort();
			}
		}
		return super.itemToLabel( data );
	}

}
}
&lt;/code&gt;

&lt;code&gt;js|
package com.briankotek.util.datagrid
{
import mx.collections.Sort;
import mx.collections.SortField;

/**
 * Custom Sort class that forces the correct compareFunction for a given field to be used.
 */
public class ComparableSort extends Sort
{
	public function ComparableSort()
	{
		super();
	}

	override public function findItem( items:Array, values:Object, mode:String, returnInsertionIndex:Boolean = false, compareFunction:Function = null ):int
	{
		if( !compareFunction &amp;&amp; fields &amp;&amp; fields.length &amp;&amp; fields[0] is SortField &amp;&amp; SortField( fields[0] ).compareFunction )
		{
			compareFunction = SortField( fields[0] ).compareFunction;
		}
		return super.findItem( items, values, mode, returnInsertionIndex, compareFunction );
	}
}
}
&lt;/code&gt;

This forces the custom Sort class onto the grid&apos;s dataProvider, and then forces the correct compareFunction from the SortField to be used by the Sort&apos;s findItem() method. Hopefully we&apos;ll get a fix for this soon, but in the meantime, maybe this workaround will help out some other folks.
				
				</description>
				
				
				<category>Development</category>
				
				<category>Flex</category>
				
				<pubDate>Fri, 09 Oct 2009 12:57:00 -0700</pubDate>
				<guid>http://www.briankotek.com/blog/index.cfm/2009/10/9/Flex-DataGridColumn-Complex-Properties-Bug-and-Workaround</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>On the CFPanel Podcast with Mark Mandel and Barney Boisvert</title>
				<link>http://www.briankotek.com/blog/index.cfm/2009/9/4/On-the-CFPanel-Podcast-with-Mark-Mandel-and-Barney-Boisvert</link>
				<description>
				
				I&apos;m happy to say I&apos;ll be participating in the &lt;a href=&quot;http://cfpanel.com/index.cfm/2009/9/3/Episode-5--ColdFusion-and-Java-Integration&quot; target=&quot;_blank&quot;&gt;CFPanel Podcast&lt;/a&gt; on September 8 at 8 PM EST. We&apos;ll be discussing ColdFusion and Java integration. I hope to add some helpful substance to the conversation, but I&apos;m really looking forward to hearing what Mark (who created JavaLoader) and Barney (who created CFGroovy) have to say.

Listen in if you can, or check out the Connect recording afterwards. Thanks!
				
				</description>
				
				
				<category>Development</category>
				
				<category>ColdFusion</category>
				
				<category>Java</category>
				
				<category>Groovy</category>
				
				<category>Presentations</category>
				
				<pubDate>Fri, 04 Sep 2009 12:11:00 -0700</pubDate>
				<guid>http://www.briankotek.com/blog/index.cfm/2009/9/4/On-the-CFPanel-Podcast-with-Mark-Mandel-and-Barney-Boisvert</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>ColdFusion and OOP - Match Made in Heaven, or Long Road to Hell?</title>
				<link>http://www.briankotek.com/blog/index.cfm/2009/7/14/ColdFusion-and-OOP--Match-Made-in-Heaven-or-Long-Road-to-Hell</link>
				<description>
				
				Hal Helms, Ben Nadel and I recorded a conversation over the weekend on the subject of OO in CF. I&apos;m supporting the position that OO is still a good thing in CF, Hal disagrees, and Ben is undecided. As you might expect, Hal is left a trembling husk as the weight of my arguments unmercifully crushes him. You know those scenes in superhero movies where someone gets punched so hard they end up in a crater in the ground? It&apos;s like that. Only worse.

In all seriousness though, it was a very fun talk and I think there are some solid points made from all involved, but I&apos;ll let you, gentle reader, be the judge. &lt;a href=&quot;http://epicenter-public.s3.amazonaws.com/ColdFusion-and-OOP--Match-Made-in-Heaven-or-Long-Road-to-Hell.mp3&quot; target=&quot;_blank&quot;&gt;You can download the recording here&lt;/a&gt;.

In the interest of keeping any discussion on this topic from fragmenting, we&apos;ve decided to disable comments on our respective blog entries and instead created a &lt;a href=&quot;http://groups.google.com/group/coldfusionoo&quot; target=&quot;_blank&quot;&gt;Google Group&lt;/a&gt; to act as a central sounding board. Hopefully this isn&apos;t too inconvenient, I realize it&apos;s something of a departure from the norm, but let&apos;s see how that works.

I&apos;m not sure yet whether this will turn into any kind of regular discussion, but I suppose it could. We&apos;ll just have to see what folks think! Thanks.
				
				</description>
				
				
				<category>Development</category>
				
				<category>ColdFusion</category>
				
				<category>OOP CF</category>
				
				<pubDate>Tue, 14 Jul 2009 06:29:00 -0700</pubDate>
				<guid>http://www.briankotek.com/blog/index.cfm/2009/7/14/ColdFusion-and-OOP--Match-Made-in-Heaven-or-Long-Road-to-Hell</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>HTML 5 Isn&apos;t Going to Kill Flash</title>
				<link>http://www.briankotek.com/blog/index.cfm/2009/7/9/HTML-5-Isnt-Going-to-Kill-Flash</link>
				<description>
				
				Lately I&apos;ve seen a number of blog posts and news stories touting HTML 5 as some sort of Flash Killer in the RIA space. Am I the only one shaking my head at this?

First off, let me say I&apos;m thrilled that HTML 5 is in the works, and that the markup language is being improved. I could say it&apos;s about time, but I won&apos;t. (I guess I just did though!)

That said, the people claiming that HTML 5 is going to kill Flash seem to have a pretty poor memory. According to the editor of HTML 5, &lt;a href=&quot;http://blogs.techrepublic.com.com/programming-and-development/?p=718&quot; target=&quot;_blank&quot;&gt;it&apos;s not going to become a proposed recommendation until 2022&lt;/a&gt;. That&apos;s over a decade, folks. That&apos;s a long, looooong time.

Think back a decade. Remember 1999? Most people were using IE 4. There was no AJAX, and there were no RIAs. There were no social networks. There was no Twitter, and no iPhone. Now project that kind of change forward 10 years, only double the rate of change. So much is going to happen before HTML 5 is widely adopted that it&apos;s not even funny. Heck, something might even kill Flash. But it&apos;s not going to be HTML 5.

And even if the new spec offers some kind of parity with Flash, Flex, and Silverlight, it&apos;s not like the existing RIA platforms are going to stand still. There will be huge advances over the next decade. So being, among other things, a Flex developer, I&apos;m probably biased here. But I just don&apos;t see what all the fuss is about. An updated spec is great, and I sure it will find many uses and offer a lot of interesting features. But to trot this out as yet another Flash Killer seems unrealistic at best, and reeks of ulterior motives at worst. What do you think? Am I right? Or am I just blinded by my association with Flex?
				
				</description>
				
				
				<category>Development</category>
				
				<category>Flex</category>
				
				<pubDate>Thu, 09 Jul 2009 07:17:00 -0700</pubDate>
				<guid>http://www.briankotek.com/blog/index.cfm/2009/7/9/HTML-5-Isnt-Going-to-Kill-Flash</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>OO Can&apos;t Ruin Businesses, but People Can</title>
				<link>http://www.briankotek.com/blog/index.cfm/2009/5/26/OO-Cant-Ruin-Businesses-but-People-Can</link>
				<description>
				
				Blogging newcomer Marc Funaro made a provocative first post over the weekend with his entry &lt;a href=&quot;http://www.advantexllc.com/blog/post.cfm/how-oo-almost-destroyed-my-business&quot; target=&quot;_blank&quot;&gt;How OO Almost Destroyed My Business&lt;/a&gt;. It has gotten a lot of comments, some supporting him, and some taking issue with his conclusions. I started to comment but decided it would be better to generate a secondary discussion rather than add onto the already long thread.

Marc says he picked up ColdFusion as a non-programmer, and had good success with it until fairly recently. With the movement toward object-oriented development that is happening in the ColdFusion world, he ran into trouble. He read some books, some blogs, and took a class on Java development. And he ended up overwhelming himself with unnecessary complexity in terms of frameworks, design patterns, and OO architecture. He sums up the result of doing this pretty nicely:

&lt;blockquote&gt;&quot;The bottom line is, when you NEED to use some OO concept, YOU&apos;LL KNOW.  *That&apos;s* the time to start writing OO-style code, and only then... not everywhere else.&quot;&lt;/blockquote&gt;

Which is pretty good advice. It&apos;s something that any knowledgeable proponent of OO will tell you. I&apos;m sorry that it took him a good amount of time and frustration to reach that conclusion, but I&apos;m glad he finally did.

Where he goes wrong, though, starts right in the title of his entry. OO can&apos;t ruin anything, but people making bad decisions absolutely can. And what Marc did was make some bad decisions, because he was new to OO, confused, and, as he says, &quot;downloading one framework after another, piling them all into an application&quot;. This is like reading a book on construction, and then going out and trying to build the Taj Mahal when all that was needed was a garage.

Bad decisions don&apos;t mean a person is stupid or foolish. Smart people make bad decisions all the time (I&apos;m not conceited enough to call myself a smart person, but I definitely have made some bad decisions). Usually, it&apos;s simply a lack of knowledge or experience, or a failure to understand the implications of the choices you&apos;re making. But even that is OK, because when someone makes a bad decision, it can still have a positive outcome if it results in learning something. OO does not equate to using a framework, and it does not require the application of every design pattern under the sun. It&apos;s simply a way to organize code, manage complexity, and accommodate change. Sometimes, that is best served by using a framework like ColdSpring or Spring. Sometimes, design patterns can offer solutions to encapsulate variations in a system and cope with change. One of the key things anyone using OO must understand is that there are pros and cons to every decision, and multiple solutions to a given problem. The only way to learn how to assess these trade offs is through experience.

The reality is that a lot of ColdFusion applications don&apos;t require a massive OO system to power them. Many of the small- or medium-sized applications don&apos;t need an n-tier architecture loaded with abstractions and design patterns. But that doesn&apos;t mean that some of the good ideas of OO, like encapsulation, can&apos;t be used with big benefits. One doesn&apos;t need to turn every query into an array of objects. Just creating well-defined interfaces to expose behavior to the rest of an application will get you a long way. Once something is encapsulated, it&apos;s much easier to change it later if you need to. It might be just a few CFCs to wrap up the bulk of the logic and hide the implementation. That might be all that will ever be needed. But if (and, more likely, when) things get more complex and it comes time to start adopting a broader set of OO principles, you&apos;ll be in a much better position to do so.

However, there is another reality that can&apos;t be denied: in the debate between procedural and OO development, OO has won. It won many years ago. ColdFusion is one of the few languages left that supports procedural development to a large degree. If you want to keep being a software developer, or ever want to move to a language like ActionScript, C#, Java, Groovy, or Ruby, you&apos;re going to have to know OO. That&apos;s just how it is. And as Marc points out, even within the CF world, OO is taking over, and the number of jobs available to people without OO experience are going to keep getting smaller and smaller. Some folks may not like this and may attempt to rebel against the trend, but you can&apos;t stop the tide. OO is not going away, in fact, it&apos;s only going to get ever more ubiquitous. So it&apos;s probably in your best interest to learn about it. One doesn&apos;t have to use it on every project, nor does one have to use it to create a complex, over-engineered mess. But  experience is the best teacher, both in terms of learning OO and increasing your demand in the marketplace.

So, with respect to Marc, don&apos;t do what he did. Don&apos;t try to swallow the entire OO buffet in one bite. If you try, you&apos;ll fail. You&apos;ll get frustrated. And in that red haze, you&apos;ll probably miss the simple benefits of OO. Instead, learn what you can and take time to digest the information. Experiment with it, but don&apos;t get carried away. Apply what makes sense to you where you can, in small bits. Remember that the goal is to learn, but it is also to help you do what works for you and build applications that satisfy customers.

I suppose the bottom line is: Don&apos;t be afraid of OO. Be afraid of anyone who says that OO is the only way to build an application, and be just as afraid of anyone who blasts OO because they got carried away with it and got burned.
				
				</description>
				
				
				<category>Development</category>
				
				<category>ColdFusion</category>
				
				<category>OOP CF</category>
				
				<pubDate>Tue, 26 May 2009 10:32:00 -0700</pubDate>
				<guid>http://www.briankotek.com/blog/index.cfm/2009/5/26/OO-Cant-Ruin-Businesses-but-People-Can</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>SilverFlash Beta Released: A Joint RIA Platform from Adobe and Microsoft?!</title>
				<link>http://www.briankotek.com/blog/index.cfm/2009/4/1/SilverFlash-Beta-Released-A-Joint-RIA-Platform-from-Adobe-and-Microsoft</link>
				<description>
				
				Microsoft and Adobe just announced the public availability of a joint RIA platform called SilverFlash. While it is only in early beta, and the future plans are somewhat vague, this looks like it could be something quite interesting for Flash and Flex developers for several reasons.

First, it actually goes far beyond Microsoft&apos;s current Silverlight platform, in that it actually merges the Flash platform with the Windows Presentation Foundation (WPF). In some ways this seems similar to what Adobe AIR provides, except that the WPF extends much more deeply into the Windows operating system. That means a lot more power when doing desktop integration.

But obviously the real draw here is that we&apos;ll have a unified RIA platform that is backed by all the major players in the industry (even Sun is on board) and that runs on any operating system. Just imagine: the power and ubiquity of Flash combined with the stunning calendar widgets of Sliverlight, all wrapped in a Java applet. You can download the beta at &lt;a href=&quot;http://www.techcrunch.com/2009/04/01/april-fools-youtube-flails-amazon-cloud-computing-in-a-blimp-3d-chrome-browsing-google-master-ai/&quot; target=&quot;_blank&quot;&gt;the SilverFlash Launch website&lt;/a&gt;. This is going to do for RIAs what the Apple Newton did for handheld computing!
				
				</description>
				
				
				<category>Development</category>
				
				<category>General</category>
				
				<category>Flex</category>
				
				<pubDate>Wed, 01 Apr 2009 06:41:00 -0700</pubDate>
				<guid>http://www.briankotek.com/blog/index.cfm/2009/4/1/SilverFlash-Beta-Released-A-Joint-RIA-Platform-from-Adobe-and-Microsoft</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Is the ColdFusion Community&apos;s Generosity Encouraging Laziness?</title>
				<link>http://www.briankotek.com/blog/index.cfm/2009/3/27/Is-the-ColdFusion-Communitys-Generosity-Encouraging-Laziness</link>
				<description>
				
				I&apos;ve been using ColdFusion for a long time. When I started back in late 1997, I was a very novice programmer. There wasn&apos;t much in the way of mailing lists, online forums, or books. There was no Google, and there were no blogs. As a result, I developed what I&apos;d consider a pretty self-reliant nature on the subject of programming. I had to read the documentation, experiment, and try things out. And doing this, I was able to solve my problems.

I am a member of a number of public discussion forums and mailing lists, and have been for many years. I moderate several forums and lists. Over the years, I&apos;ve tried to help others by answering questions or pointing them in the right direction to solve their problems. I&apos;d like to hope that I&apos;ve helped save some people some of the pain and time that I had to go through when I was learning ColdFusion.

Lately I&apos;ve been seeing a disturbing trend: a rapidly increasing number of what I will call &quot;lazy questioners&quot;. Sure, some of these folks have always been around. But in the last six to twelve months it seems like the number of these people has been making a rapid upturn.

On the one hand, this might be good news: it seems to indicate that more new people are coming into the community. I think that&apos;s great. However, what I don&apos;t think is great is their approach to asking questions.

If you are also a member of one or more forums or mailing lists, have you also noticed the increasing number of questions like these?

&lt;ul&gt;&lt;li&gt;How do I invoke a trigger from ColdFusion?&lt;/li&gt;
&lt;li&gt;Why doesn&apos;t this work: &amp;lt;cfif IsDefined(&quot;#url.id#&quot;)&amp;gt;...&lt;/li&gt;
&lt;li&gt;Why does my if block always run: &amp;lt;cfparam name=&quot;url.id&quot; default=&quot;0&quot; /&amp;gt; &amp;lt;cfif IsDefined(&apos;url.id&apos;)&amp;gt;...&lt;/li&gt;
&lt;li&gt;How do I zip something in ColdFusion?&lt;/li&gt;
&lt;li&gt;What is wrong with my query? [paste SQL]&lt;/li&gt;
&lt;li&gt;This doesn&apos;t work please help me. [paste 300 lines of code]&lt;/li&gt;
&lt;li&gt;Why doesn&apos;t this work? #XMLParse( [string with invalid xml characters in it] )#&lt;/li&gt;
&lt;li&gt;Will this work? [paste code]
&lt;/li&gt;&lt;/ul&gt;

The list really goes on and on, these are just a few of the ones I recall seeing recently. If you&apos;re asking yourself &quot;what&apos;s wrong with those questions?&quot;, I&apos;ll tell you: either they&apos;re horribly presented questions or they could be solved in 30 seconds just by doing a Google search or actually looking at the documentation.

So what&apos;s the problem? The next response is probably &quot;just ignore the question if you don&apos;t have anything nice to say.&quot; That&apos;s a valid response. And it would work, provided that everyone else also followed it. But they don&apos;t. When questions like these come up (daily at this point), at least one good-natured person decides to try and help. They politely provide a useful answer. Which is admirable. I often do this myself. But after thinking about the overall situation, I&apos;ve come to the conclusion that it&apos;s actually a harmful choice. Here are some of the reasons why:

First, all this does is encourage the questioner&apos;s laziness. In fact, it encourages laziness for anyone asking a question. Why would someone bother to find an answer on their own when they see they can just ask someone else and know they&apos;ll get an answer?

It also means the person probably hasn&apos;t really learned much. They certainly haven&apos;t learned how to find the solution to a similar problem when (not if) they encounter one. The old adage &quot;Give a man a fish, feed him for a day. Teach a man to fish, feed him for a lifetime.&quot; has never been more applicable. Answering a lazy question almost guarantees more lazy questions in the future. The questioner is banking on the generosity of others, and allowing them to shift the time and effort onto a bunch of other people. And, unfortunately, it works.

Which leads directly into the next negative result, which is an overall decrease in the usefulness of the list or forum. Lazy questions decrease the signal to noise ratio of a resource. They take time and attention away from valid and well presented questions. And it&apos;s not just the initial answer. Often, when a lazy question is answered, it triggers a long exchange where the questioner says &quot;that still doesn&apos;t work&quot; or &quot;what about this variation&quot;. In response, the kind folks answering keep feeding into it, many times offering additional information that the questioner would have discovered themselves if they had put even minimal effort into solving their problem through Google or the documentation.

In essence, I think the ColdFusion community is too forgiving of lazy questions. I might get flak for saying this, but it&apos;s true: we&apos;re too nice when it comes to this issue.

Now to be clear, I&apos;m not saying we should be mean, or that we should stop answering questions. We should absolutely keep answering questions. I certainly will keep trying to help people. But anyone asking a question should understand that there is a certain minimum level of effort that should be met before you ask. To me, the minimum level of effort is:

&lt;ul&gt;&lt;li&gt;Have you actually tried to run the code? What was the result?&lt;/li&gt;
&lt;li&gt;If there is an error, be able to provide the exact error to the best of your ability&lt;/li&gt;
&lt;li&gt;Have you read the documentation?&lt;br&gt;
&lt;/li&gt;
&lt;li&gt;Have you searched Google?&lt;/li&gt;
&lt;li&gt;Have you searched the past threads/messages?&lt;/li&gt;
&lt;li&gt;If the problem is SQL-related, have you run the query directly against the database, outside of CF?&lt;/li&gt;
&lt;li&gt;If you plan to paste code, have you eliminated all extraneous code and limited the code to only what is involved in the problem?&lt;/li&gt;
&lt;li&gt;Have you attempted minimal debugging with cfdump, cfabort, or cftrace?
&lt;/li&gt;&lt;/ul&gt;

This is not a lot to ask. In fact, this should be done out of common sense and common courtesy. If someone chooses not to meet this minimum level of effort, they should be met with a terse, blunt response, and NOT the answer to their question. There is a much more general and lengthy resource on this subject at &lt;a href=&quot;http://www.catb.org/~esr/faqs/smart-questions.html&quot; target=&quot;_blank&quot;&gt;the Smart Questions FAQ&lt;/a&gt;.

Here are a few situations where I say the questioner&apos;s laziness should be called out:

&lt;ul&gt;&lt;li&gt;The answer could be found by simply reading the documentation on the tag or function, and it is obvious that they have not&lt;br&gt;
&lt;/li&gt;
&lt;li&gt;The answer could be found with a 30 second Google search&lt;/li&gt;
&lt;li&gt;The questioner is asking an advanced question on a complex subject when it is clear they have limited understanding of the subject or what they&apos;re even asking about, and they&apos;re expecting a free class on the subject (i.e. &quot;I don&apos;t know much SQL, but how do I write this complicated query&quot;)&lt;/li&gt;
&lt;li&gt;The questioner is asking if something will work when they haven&apos;t even tried to run it&lt;/li&gt;
&lt;li&gt;The questioner is asking others to write their code for them&lt;/li&gt;
&lt;li&gt;The questioner is pasting huge amounts of code and expecting others to sift through it
&lt;/li&gt;&lt;/ul&gt;

In many other communities, lazy questions are met with harsh responses that range from &quot;RTFM&quot; to &quot;JFGI&quot; to derisive abuse. I&apos;m not asking the community to go down that road. I love the fact that for the most part, the CF community is a very open and encouraging place. I just think that a small but growning number of people are taking advantage of that generous spirit. It&apos;s time to impose some minimal expectations on those who would ask for our time and assistance.

I&apos;m expecting this to trigger some interesting feedback (hopefully nothing too rough, but if you disagree and can point out some flaw with my logic here, by all means go for it). What do folks think about this issue, and what is the best way to deal with it?
				
				</description>
				
				
				<category>Development</category>
				
				<category>ColdFusion</category>
				
				<category>General</category>
				
				<category>Personal</category>
				
				<pubDate>Fri, 27 Mar 2009 15:10:00 -0700</pubDate>
				<guid>http://www.briankotek.com/blog/index.cfm/2009/3/27/Is-the-ColdFusion-Communitys-Generosity-Encouraging-Laziness</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Groovy: The Invasion Begins</title>
				<link>http://www.briankotek.com/blog/index.cfm/2009/3/25/Groovy-The-Invasion-Begins</link>
				<description>
				
				Past readers have probably seen some of my posts that include references to the Groovy programming language. At Broadchoice we chose Groovy for the entire server-side object model for our Workspace AIR application. In other words, I&apos;ve been using Groovy for a while now. And I&apos;ve been, and continue to be, extremely impressed with it.

If you&apos;re a ColdFusion developer, you may want to give Groovy a test drive. Because Groovy is a dynamic language, it plays almost perfectly with CF. You can kiss all those JavaCast() function calls goodbye when your CFML interacts with Groovy objects. Since Groovy runs in the JVM and compiles to bytecode just like CFML (and straight Java for that matter), you can reap its benefits at very little cost in terms of setup. 

Further, to those with any familiarity with Java at all, the learning curve with Groovy is really short. Another of the many really cool things about Groovy is that it gives you a very wide spectrum of coding syntax: 

On one side, almost any native Java code can be pasted into a Groovy class and it will run fine with no modifications. So any examples, libraries, or legacy code can literally be copied, pasted, and forgotten about, if you want. 

But on the other side, Groovy adds a ton of convenience features on top of the core Java language. It takes things that require long, boring, boilerplate Java and incorporates it into the language in a way that just works. And you&apos;re free to take advantage of these great time-saving capabilities anywhere you choose to. That&apos;s what&apos;s so cool: you get to choose! Want or need &quot;normal&quot; Java. Fine. Want tight, terse Groovy? Fine. Want any combination of those? Fine. That&apos;s just really damn sweet.

Yesterday, one of the resident mad geniuses of the ColdFusion community, Barney Boisvert, released &lt;a href=&quot;http://www.barneyb.com/barneyblog/2009/03/23/cfgroovy-1-0/&quot; target=&quot;_blank&quot;&gt;version 1.0 of his CFGroovy library&lt;/a&gt; that makes integrating Groovy (and Hibernate) into CF applications a snap. He also has a very nice post on &lt;a href=&quot;http://www.barneyb.com/barneyblog/2009/03/24/why-you-should-care-about-groovy/&quot; target=&quot;_blank&quot;&gt;why you should care about Groovy&lt;/a&gt;.

Because it is so seamless to use with CF, so powerful, and so easy to use, I really think we&apos;re going to start seeing a lot about Groovy. Add to that the fact that Groovy&apos;s object creation speeds, while slower than Java, are far beyond CFCs, and we have a candidate for really robust, large-scale object models while still being able to leverage CF anywhere else in the controller, model, or view that makes sense. So if you like to tinker, learn something new, or do large-scale OO, I&apos;d urge you to check out Groovy and Barney&apos;s CFGroovy library.
				
				</description>
				
				
				<category>Development</category>
				
				<category>ColdFusion</category>
				
				<category>OOP CF</category>
				
				<category>Groovy</category>
				
				<pubDate>Wed, 25 Mar 2009 09:29:00 -0700</pubDate>
				<guid>http://www.briankotek.com/blog/index.cfm/2009/3/25/Groovy-The-Invasion-Begins</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Finally Using CFFormProtect, And Getting Zero Spam</title>
				<link>http://www.briankotek.com/blog/index.cfm/2009/3/20/Finally-Using-CFFormProtect-And-Getting-Zero-Spam</link>
				<description>
				
				I&apos;m probably the last person on earth to do this, but I recently added Jake Munson&apos;s &lt;a href=&quot;http://cfformprotect.riaforge.org/&quot; target=&quot;_blank&quot;&gt;CFFormProtect&lt;/a&gt; library to my blog. Why oh why didn&apos;t I do this six months ago? Oh yeah, because I&apos;m really busy heh. But better late than never, especially when the result is ZERO blog spam!

I normally got between 5 and 10 comment spam notifications a day. Which I immediately deleted, but it forced me to enable comment moderation on the blog. Well, moderation is off now, and I&apos;m thrilled to say no spam has come in yet. I absolutely love the idea of some person wasting time trying to spam my comments and failing every time. It brings a smile to my face. An evil smile.

Anyway, in case I am NOT the last person on earth to do this, and YOU are, then update your blog to include it. As a bonus, if you&apos;re on BlogCFC, the latest version includes it for you. One of these days I need to get back to the latest build of BlogCFC (right now mine has a number of tweaks, like using the Google SyntaxHighlighter).
				
				</description>
				
				
				<category>Development</category>
				
				<category>ColdFusion</category>
				
				<category>General</category>
				
				<pubDate>Fri, 20 Mar 2009 09:49:00 -0700</pubDate>
				<guid>http://www.briankotek.com/blog/index.cfm/2009/3/20/Finally-Using-CFFormProtect-And-Getting-Zero-Spam</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Flex Tip: Why ListCollectionView Is Your Friend</title>
				<link>http://www.briankotek.com/blog/index.cfm/2009/3/18/Flex-Tip-Why-ListCollectionView-Is-Your-Friend</link>
				<description>
				
				I&apos;ve been meaning to blog quickly about this topic for a while. But a post from Mike over at &lt;a href=&quot;http://smartpitbullsoftware.blogspot.com/2009/03/cloning-data.html&quot; target=&quot;_blank&quot;&gt;Smart Pitbull&lt;/a&gt; prompted me to go ahead and do it.

Mike was having an issue with having two Flex DataGrids both bound to the same ArrayCollection. When he did something that sorted one grid, both grids would be sorted. This wasn&apos;t what he wanted, so he looked at a couple of solutions.

His first idea was to have the server convert his query into an Array, and use that to create two separate ArrayCollections based on the array. This works, but it required adding the server-side logic to do this translation.

On the advice of some readers, he dropped that solution and instead went with client-side code that loops over the result and adds each item to two separate ArrayCollections.

Actually, I think Mike&apos;s first solution was the better of the two. The second option creates two completely different ArrayCollections, which means &lt;strong&gt;no&lt;/strong&gt; changes to one will be reflected in the other. One can add, remove, and modify elements in one collection and the other will remain completely unaffected. In most cases this is going to be a bad thing. Even if there are two separate grids, you probably don&apos;t want to have to manually synchronize the underlying data. Which is exactly what would have to happen here. If someone adds a User to one of the collections, the other collection (and grid) will not change. In general, you &lt;strong&gt;want&lt;/strong&gt; to have a single data collection so that changes to it are immediately reflected in any views that are bound to it.

The solution that I would offer is to use two ListCollectionViews to act as the binding targets for the DataGrids. Among the many (MANY) benefits of working with my friend &lt;a href=&quot;http://www.firemoss.com/&quot; target=&quot;_blank&quot;&gt;Joe Rinehart&lt;/a&gt; was that he clued me into this option very early in my Flex learning curve.

So in Mike&apos;s case, the solution is to wrap the collection returned from the server in two ListCollectionViews, one of each grid, like so:

&lt;code&gt;js|
modelData = e.result as ArrayCollection
gridData = new ListCollectionView( modelData );
advancedGridData = new ListCollectionView( modelData );
&lt;/code&gt;

With this approach, you can sort the grids independently and not affect the other. This is because the the DataGrid (and indeed anything that sorts a collection) will apply a Sort or filterFunction directly on the bound collection. That is why you&apos;ll see both grids sort together if they are both bound to the same collection, and why the sorting is independent if each grid is bound to a different ListCollectionView. At the same time, since the underlying collection is shared by both of the ListCollectionViews, you don&apos;t need to worry about synchronizing the two collections when has elements added, removed, or changed.

I&apos;ve created a &lt;a href=&quot;http://briankotek.com/examples/listcollectionexample/Main.html&quot; target=&quot;_blank&quot;&gt;simple example to show this in action&lt;/a&gt;. View source is enabled if you want to see what&apos;s going on. Hopefully this makes sense, and shows why using a ListCollectionView wrapper around your underlying data is a very useful option when you need to expose that data in different views.
				
				</description>
				
				
				<category>Development</category>
				
				<category>Flex</category>
				
				<pubDate>Wed, 18 Mar 2009 10:59:00 -0700</pubDate>
				<guid>http://www.briankotek.com/blog/index.cfm/2009/3/18/Flex-Tip-Why-ListCollectionView-Is-Your-Friend</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Swiz Part 5: Simulating Server Calls with a mock AsyncToken</title>
				<link>http://www.briankotek.com/blog/index.cfm/2009/3/16/Swiz-Part-5-Simulating-Server-Calls-with-a-mock-AsyncToken</link>
				<description>
				
				In the last entry in this series on the Swiz framework, I discussed &lt;a
href=&quot;http://www.briankotek.com/blog/index.cfm/2009/2/9/Swiz-Part-4-Dynamic-Responders&quot;
target=&quot;_blank&quot;&gt;the use Dynamic Responders&lt;/a&gt; to make calls to the server as easy as possible. This entry is a short aside on how you can use some nice testing features that are built into Swiz to simulate calls to a server. As before, &lt;a
href=&quot;http://www.briankotek.com/examples/swizdemo_events/Main.html&quot;
target=&quot;_blank&quot;&gt;the current version of the application and its
source code&lt;/a&gt; is available.&lt;br&gt;
&lt;br&gt;
So far, we&apos;ve looked at how Swiz&apos;s inversion of control (IoC) features make managing dependencies in a Flex application dead simple. We&apos;ve dispatched events from the CentralDispatcher, and we&apos;ve executed service calls using our Delegate class. But what is actually happening at the Delegate level? Let&apos;s delve into this.&lt;br&gt;
&lt;br&gt;
You might have noticed that within my Controller, I&apos;m having Swiz wire in an object of type IUserDelegate:&lt;br&gt;

&lt;code&gt;js|
[Autowire]
public var delegate : IUserDelegate;
&lt;/code&gt;

Why am I specifying the type as an interface instead of an actual class name? Flexibility! One of the most basic tenants of object-oriented design is to &quot;design to interfaces&quot;. That doesn&apos;t necessarily mean you have to type everything as an interface. It just means you should keep your typing at the highest level of abstraction that you can. Ideally, that means typing things to interfaces or abstract classes.

Because I&apos;m typing the delegate to IUserDelegate, that means I can have Swiz autowire anything that implements the contract defined by the IUserDelegate interface. And that&apos;s exactly what I&apos;m doing. Here&apos;s the Beans.mxml file again:&lt;br&gt;

&lt;code&gt;xml|
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;BeanLoader 
	xmlns=&quot;org.swizframework.util.*&quot; 
	xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot;
	xmlns:controller=&quot;com.briankotek.swizdemo.controller.*&quot;
	xmlns:business=&quot;com.briankotek.swizdemo.delegate.*&quot;&gt;

	&lt;controller:UserController id=&quot;userController&quot; /&gt;
	&lt;business:MockUserDelegate id=&quot;userDelegate&quot; /&gt;

&lt;/BeanLoader&gt;
&lt;/code&gt;

You can see that the delegate is actually a MockUserDelegate. Here&apos;s the code for that class:&lt;br&gt;

&lt;code&gt;js|
package com.briankotek.swizdemo.delegate
{
	import com.briankotek.swizdemo.model.User;
	import mx.collections.ArrayCollection;
	import mx.rpc.AsyncToken;
	import org.swizframework.delegate.AbstractDelegate;
	import org.swizframework.util.TestUtil;

	public class MockUserDelegate extends AbstractDelegate implements IUserDelegate
	{
		
		// CONSTRUCTOR
		
		public function MockUserDelegate()
		{
			super();
		}
		
		// PUBLIC METHODS
		
		/**
		 * In a real application this would execute a server call to a remote object
		 */ 
		public function loadUsers() : AsyncToken
		{	
			return TestUtil.mockResult( buildMockUserCollection() );
		}
		
		/**
		 * In a real application this would execute a server call to a remote object
		 */ 
		public function saveUser( user : User ) : AsyncToken
		{
			if( !user.id )
			{
				user.id = Math.round( Math.random() * 100 );
			}
			return TestUtil.mockResult( user );
		}
		
		/**
		 * In a real application this would execute a server call to a remote object
		 */ 
		public function deleteUser( user : User ) : AsyncToken
		{
			return TestUtil.mockResult( user );
		}
		
		/**
		 * In a real application this might execute a call to a third party file server
		 */ 
		public function deleteUserProfileImage( user : User ) : AsyncToken
		{
			// Pretend that this deletes a file from a file server like Amazon S3.
			return TestUtil.mockResult( user ); 
		}

		// PRIVATE METHODS
		
		/**
		 * Build a fake collection of Users as a mock result.
		 */ 
		private function buildMockUserCollection() : ArrayCollection
		{
			var result : ArrayCollection = new ArrayCollection();
			
			var user1 : User = new User();
			user1.id = 1;
			user1.firstName = &quot;Tom&quot;;
			user1.lastName = &quot;Swift&quot;;
			result.addItem( user1 );
			
			var user2 : User = new User();
			user2.id = 2;
			user2.firstName = &quot;Bob&quot;;
			user2.lastName = &quot;Hope&quot;;
			result.addItem( user2 );
			
			var user3 : User = new User();
			user3.id = 3;
			user3.firstName = &quot;Alan&quot;;
			user3.lastName = &quot;Alda&quot;;
			result.addItem( user3 );
			
			var user4 : User = new User();
			user4.id = 4;
			user4.firstName = &quot;Roger&quot;;
			user4.lastName = &quot;York&quot;;
			result.addItem( user4 );
			
			return result;	
		}
	}
}
&lt;/code&gt;

As you can see, I&apos;m not actually making a call to a server. I&apos;m generating an ArrayCollection of &quot;fake&quot; User objects, and then using a handy method called mockResult() in the Swiz TestUtils class. This method generates an AsyncToken for you and adds your result to it. It will even let you simulate a delay, like a real server call would have.

In this way, you can easily test your Swiz application without needing the server side working. This not only makes examples like mine much easier to release, but it lets you unit test your applications, as well as do work on parts of the UI before the server-side code has been implemented yet.

I hope you can see the usefulness of this approach, the handy nature of Swiz&apos;s mockResult() method, and the ease with which Swiz lets you swap out implementations like this. I&apos;ll sign off for now, but in the next entry (which will come more quickly than this one did, I promise) we&apos;ll look at another great Swiz feature: Dynamic Event Mediators.
				
				</description>
				
				
				<category>Development</category>
				
				<category>Flex</category>
				
				<category>Swiz</category>
				
				<pubDate>Mon, 16 Mar 2009 13:16:00 -0700</pubDate>
				<guid>http://www.briankotek.com/blog/index.cfm/2009/3/16/Swiz-Part-5-Simulating-Server-Calls-with-a-mock-AsyncToken</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Results of the ColdFusion OOP Survey</title>
				<link>http://www.briankotek.com/blog/index.cfm/2009/2/26/Results-of-the-ColdFusion-OOP-Survey</link>
				<description>
				
				A couple of weeks ago I put up a survey to get some data on how current ColdFusion developers are (or aren&apos;t) using object-oriented programming (OOP) techniques. In all, 176 people took the survey, so thanks to everyone who took the time to go through it! As promised, I&apos;ve done some number crunching on the results and am posting them for folks to see and comment on.
				 [More]
				</description>
				
				
				<category>Development</category>
				
				<category>ColdFusion</category>
				
				<category>OOP CF</category>
				
				<pubDate>Thu, 26 Feb 2009 11:39:00 -0700</pubDate>
				<guid>http://www.briankotek.com/blog/index.cfm/2009/2/26/Results-of-the-ColdFusion-OOP-Survey</guid>
				
				
			</item>
			
		 	
			</channel></rss>