Viewing by month: August 2007

Aug 21 2007

ActiveRecord has (bad!) consequences.

This started out as a long comment on Brian Kotek's recent post about the ActiveRecord pattern. I figure that while I've still got some Rails-ish types irked at me, I may as well go ahead and blog a bit more about why I don't like the datacentricness of the ActiveRecord approach.

Before you fire up your flame generation script, let me say this: ActiveRecord is super-productive when you need to allow someone to edit a relational model. It doesn't, however, suit the kind of OOD-backed development I do. This post is about why.

Read more...

10 comments - Posted by Joe Rinehart at 3:01 PM - Categories: OOP | Causing Trouble

Aug 17 2007

Rails' ActiveRecord, Reactor, Illudium: All backwords for OO.

So, what's with the guy who put together the MG:U stack calling this stuff backwords for something he pushes (OO)? I'm not writing this to start a flame war: I'm writing this because I'd like people to think about the tools they're using and the appropriate contexts for their use, and I chose a bit of an inflammatory title to get you to click. :)

Read more...

8 comments - Posted by Joe Rinehart at 10:14 AM - Categories: OOP | Causing Trouble

Aug 14 2007

CFCUnit + FlexUnit How-To: No excuses now!

This is a rather long post that walks through creating a ColdFusion service CFC and a Flex class to communicate with it using test-driven development tools.

Test-driven development: at first, it seemed like a lot of overhead. However, now that I've been doing it for a year and on multiple projects, I can't get enough. Believe it or not, you will get things done faster. Even better, I'm now more confident in my code, and I think it's made me an overall better developer.

Read more...

3 comments - Posted by Joe Rinehart at 2:05 PM - Categories: Flex | ColdFusion MX | Flex and ColdFusion | Best Practices

Aug 13 2007

Correctly Sorting/Filtering Collections in Flex: ListCollectionView

When you're writing a small app, you're likely to have an ArrayCollection of Contacts or the like floating around in your components.

As that app grows, you're likely to move to MVC or ModelLocator, where your DataGrids and whatnot bind to a collection that's not necessary stored "inside" the component itself.

On one of these views, you'll have a ComboBox showing Contacts in the list.

On another view, you'll have a DataGrid showing the list of Contacts.

One day, someone will click one of the headers on the DataGrid to sort by something like Contact.dateOfBirth, and they'll ask why the Contacts in the ComboBox just resorted themselves: it's because both are bound to the same collection sharing the same sort and filter behaviors. Whoops!

Wouldn't it be great if Flex provided a class that was just a "wrapper" around another collection that applied its own sorts and filters?

Yep, it would, and even better, Flex does! The ListCollectionView is exactly what we need: it takes any implementation of ICollectionView as its "list" property, and implements the filterFunction and sort properties of ICollectionView, making it a wrapper on a collection that won't change the underlying collection's sort or filter!

Want an example? I've created a quick demo at http://firemoss.com/blogsamples/sortinglists/ that shows the bad behavior (the middle grid binds to the same ArrayCollection as the first) and the best practice implementation (the rightmost grid binds to a ListCollectionView wrapping the "true" data).

The sample data is the list of bikes currently in my garage.

2 comments - Posted by Joe Rinehart at 2:18 PM - Categories: Flex

Aug 9 2007

Rinehart, Corfield, Design Patterns, and Adobe MAX

Today, Sean Corfield announced he'll be talking about Design Patterns in ColdFusion at MAX, a topic I'd recommend any attendee check out - whether or not you're a ColdFusion developer. In my talks with Sean about patterns, he's one of the people I see most eye-to-eye with, and I wish his thoughts on patterns were more widespread. I'm pretty certain his talk will not be thirty slides listing thirty patterns at a mind-numbing pace.

If you're looking for a more in depth session dealing with ColdFusion and Design Patterns, I'll be doing a full-day class called "Building ColdFusion Applications around Design Patterns" where we'll do the following (still in draft, may change!):

  1. Talk about what design patterns aren't
  2. Learn what design patterns really are by following a few weeks in the life of Bob the developer
  3. Iteratively revise "Stuff," a procedural, spaghetti-coded document management application into a lean, pattern-based application ready to re-use with Model-Glue, Flex, or AIR.
  4. Free-form explore your own OOP, OOD, and pattern situations.

3 comments - Posted by Joe Rinehart at 4:31 PM - Categories: Conferences and Speaking Engagements

Aug 7 2007

Apple's "Numbers" - Office should watch out.

Here's a confession: I can design software, I can code, I can even animate, but if you ask me to use a corporate office phone to do a conference call, run a fax machine, or use something like Excel or Word or Powerpoint, you're going to be entertained, because it's like watching a caveman use an iPhone (sorry, GEICO cavemen).

When I first had a Mac (a 1.0 Ghz Powerbook G4), there wasn't much in the way of mature office software other than, well, Microsoft Office.

When I bought my current MacBook Pro and came back to the light side (after a 2-year sentence to an IBM Thinkpad and a Dell Insprion), I forked over the $79 for a copy of iWork.

Holy cow, it had a word processor I could use. Not only could I use it, I made documents that looked _professional_. Like they were designed, not just typed. It's not often a freelancer gets feedback like "Your contract just *looked* good." All I did was put the Firemoss logo in the template...

I've spent the past week using Powerpoint (due to requirements). I've spent the past year doing Keynote presentations. The difference is shameful: what the heck has Redmond been doing all these years?

And now we've got Numbers. Spreadsheets are the cornerstone of business software - releasing a spreadsheet package is putting your chips on the high-stakes table of office software. After using their software, I don't think Apple's bluffing.

2 comments - Posted by Joe Rinehart at 9:11 PM - Categories: Off Topic

Aug 1 2007

Dateline uses ColdFusion to track stolen iPod's!

I'm in a corporate apartment working on-site with a client, and I'm watching Dateline NBC. They're doing a special on stolen iPods (isn't it crazy that it's that much of an icon?). They hired a private firm ("Blackfin") to write a special installation CD, repacked a bunch of brand new iPods with the special CD, and left them around for people to take.

Long story short, they just showed a clip of the URLs their special iPod installation CD hit to phish registration information of the thieves, and what did the URL say?

Something like this:

index.cfm?fuseaction=registerIpod

First moral of the story?

Don't steal.

Second moral of the story?

When you need to quickly write an app that's going both go live and work on national TV, use ColdFusion.

4 comments - Posted by Joe Rinehart at 10:41 PM - Categories: ColdFusion MX