Wednesday, May 9, 2007

cfajaxproxy: No More Validation Duplication

ColdFusion 8 is going to include a huge new set of tools and features. How huge? Let's just say ColdFusion bloggers do not lack for material these days. And every few days another feature is revealed as Adobe folks tour the country with their preview demo.

It was recently revealed that ColdFusion 8 would contain a new tag called <cfajaxproxy> as part of a number of tags in support of AJAX functionality. Details are vague, but apparently the idea is that this tag lets you call the functions in a ColdFusion CFC file from JavaScript via an AJAX call and return the results of the functions back to the JS function.

That's a tremendously powerful tool. Most modern CF applications perform all of their business logic and database transactions through CFC functions, and now all of those algorithms can be made available via AJAX.

The area where this will really help is input validation. A good web developer knows that data input by a user should be validated before submission to the server by JavaScript, but that the server should also validate the data upon submission in case JavaScript is unavailable/turned off.

That used to mean maintaining two sets of validation functions: one in JS and one in ColdFusion.

Not anymore. Now you can write one set of validation routines in your CFC methods and use it for both client-side and server-side validation. A single set of routines, easy-to-maintain and, because they are written in ColdFusion and not JavaScript, browser-independent.

I can't wait!

No comments:

Post a Comment