Visit the ColdFusionProNews Directory
Beginners
Installation, Coding Techniques, Data Structures...
CF Powered Sites
Stores, Directories, Universities...
Developers
Developers, Designers, Experts...
E-commerce
Shoes, Food, Music...
Education
Books, Online Resource, Languages...
Expert
LiveChat , CFX XMLParser , User Defined Function Library...
Hosting
Dedicated Servers, Virtual Server, Multi-user...
Intermediate
AutoResize , DataSource Encryption, Guestbook...

Submit your site for FREE

Archive for the ‘News’ Category

CFEasyMock on RIAForge

Wednesday, April 2nd, 2008

As a fan of unit testing, I was interested to hear about a new mock object generator project appearing in the CF world.

I’ve been using Brian Kotek’s ColdMock for a while and I really like how easy it makes it to test CFCs that depend on several other CFCs - because you can create “mock” versions of those CFCs on the fly that return specific values. Mock objects are a good way to provide a consistent environment for your CFCs under test, as well as a way to let your CFCs be tested without them affected the “real” environment (because you can create a “mock” environment which can even include things such as data access objects to fake the whole database layer).

As I blogged recently, I’ve switched from cfcUnit to MXUnit and the mailing list is pretty active. Mike Steele posted that he had ported EasyMock to CFML. My first reaction was “Have you looked at Brian Kotek’s ColdMock project?” and Mike explained that EasyMock isn’t just about creating simple mock objects but about verifying behavior in those mock objects.

Intrigued, I read about EasyMock, a Java project that targets JUnit, and realized the power of being able to create mock objects that expect to be called in certain ways and can, as part of your unit test, actually verify the calls made on them!

I asked Mike to send me a build and I played with it and liked it a lot, pretty much instantly. I sent him some feedback and very soon I got an updated build that incorporated much of my feedback - and a note saying he was already going in that direction. Nice to find a project where I’m on the same page as the author!

You can download the latest build from the CFEasyMock project page on RIAForge. It’s a very simple but very powerful concept that should really help you with your unit testing!

(more…)

What You Shouldn’t Be Doing In ColdFusion

Tuesday, September 25th, 2007

A few weeks ago I saw an interesting post on Dzone about what you shouldn’t do in Python. (See the article here.)

This got me thinking about what features/types of code/practices should be avoided in ColdFusion.

Some are obvious - for example, not using deprecated code. Did you know that CFML Reference guide contains a list of deprecated code for both tags and functions? Also listed are obsolete tags and functions. These functions/tags won’t work at all in ColdFusion 8.

But what else would you add to this list? I do not want to turn this entry into a “bash CF” entry (obviously, I love ColdFusion!). If you don’t like a feature, I don’t want to hear about it as we all have features we don’t like. But what things would you caution developers against? Or at least warn them? What tags/functions throw a red flag in your mind when you see the code.
(more…)

Updating ColdFusionBloggers.org - Using CFDIV For Paging

Wednesday, July 25th, 2007

So once again I’m messing with ColdFusionBloggers to show off some ColdFusion 8 AJAX goodness.

This time the idea came from Todd Sharp. He suggested making the paging AJAX based. That way when you move from page to page, only the content is loaded. Turns out the change was rather simple.

My original code simply got the data and displayed it inside a layout custom tag. I began by changing my index.cfm page to this:

<cfajaximport tags="cftooltip">

<cf_layout title=”coldfusionBloggers”>

<cfdiv bind=”url:content.cfm” id=”content” />

</cf_layout>

I’ll explain the import in a sec. But basically I moved all of the content into a new file. I then used cfidv and bound it to my new file, content.cfm.
(more…)

Quick Example Of CFTHREAD & A Warning

Wednesday, June 27th, 2007

Other people have talked about CFTHREAD (see Ben Nadel’s excellent post on the topic) so I’m not going to bother with a full description of the tag.

Instead I wanted to show a quick example of where I’ve already put it to use in production, and I wanted to share a warning about how you have to be careful when using the tag.

BlogCFC makes use of a ping feature when posting entries. This lets you inform blog aggregators that you’ve written a new blog post. This way your latest devotional on Paris Hilton won’t be missed by the masses.

Most aggregators simply take a simple HTTP hit, while others take a bit more work. BlogCFC supports simple HTTP pings, as well as Technorati, Weblogs, and Icerocket. The code is rather simple. You pass in the URLs you want to ping and this code block loops over them:
(more…)