The blog has been quiet lately, but that should be changing now that I'm finally doing some real work with ColdFusion 9! In the meantime, I've committed a few minor updates to some RIAForge projects, and added a new one.
The new project is Collection Iterator. This is simply a CFC that allows you to iterate the same way over queries, lists, structures, or arrays. The syntax is simple:
var array = ['foo', 'boo', 'zoo'];
var iterator = new Iterator( array );
var counter = 0;
while( iterator.hasNext() )
{
counter++;
var thisRow = iterator.next();
assertTrue( array[counter] == thisRow, "Array element not found." );
}
assertTrue( counter == 3, "Iterator did not loop the correct number of times." );
The obvious benefit is that it lets you handle all four collection types in a standard way. This is a CF9-only component, as it is written using the new script-only CFC syntax (which I LOVE, but will be talking about further in future entries).
As for updates, I fixed a bug in the DynamicXMLBeanFactory, which is part of the ColdSpring Bean Utilities library. There was an issue when using ColdSpring configuration files that imported multiple other config files. The CFC was also modified to only attempt to do an ExpandPath() on the configuration file location if a file doesn't exist using the value supplied by the developer. I also updated the FormUtils CFC to make the constructor arguments optional, to make it easier to configure and use.
So, that's all for now, but look for some entries on CF9 ORM tips and techniques, as well as a full reboot of my earlier series on the Swiz framework for Flex. Swiz 1.0 alpha was just released, and as the finishing touches are added I plan to be blogging about all the excellent new capabilities that have been added by the Swiz team!
Comments (5) |
del.icio.us
|
Digg It!
|
Linking Blogs
| 773 Views



# Posted By James Allen | 12/16/09 11:05 AM
Great to have you back blogging Brian, especially covering Coldfusion.
I was getting a little worried that you were moving away from CF due to the other work you've been doing.
Always enjoy your posts and learn a great deal from them.
# Posted By Brian | 12/16/09 11:21 AM
Thanks, James. No, still loving CF, I've actually just been INSANELY busy for the last several months.
# Posted By Henry Ho | 1/4/10 9:06 PM
wish For..in loop works on all data type like in Java.
Meanwhile, thx for this. :)
# Posted By Robert Rawlins | 2/23/10 5:18 AM
Hey Brian,
Love that iterator function, that's a great help.
Regarding the bean Utils package, I've been using the TDOBeanInjectorObeserver for a long while to put dependencies into beans which are managed by Transfer.
I'm now working with CF9 and using the native ORM rather than Transfer and looking for a similar principle which would allow me to auto-wire dependencies into beans which are managed by the ORM.
I'm sure that something can be done to modify the BeanInjectorObserver to work with the event handlers on the native ORM, is this something you've done before?
Cheers,
Robert
# Posted By Brian Kotek | 2/23/10 10:43 AM
Thanks, Robert. I haven't tried updating the injector to work with the CF9 ORM events, but I believe it should be possible. I'll give it a try when I can, but if anyone else wants to take a stab at it, be my guest! :-)