Why use CFCs in ColdFusion

Submitted by Falken on
From my point of view, we're now an order of magnitude or more above simply asking the user a few questions on a form and feeding those into a query and printing out the query in a table.

We want to break the request/response cycle, we want to make out code testable so we can fix things with out worrying about what we broke, we want to be able to reuse code and we want to be able to use the same code from an AJAX app, a CFML page, and a Flex application. That's just of the top of my head.

Doing all that (and more !) without objects doesn't bear thinking about. So, now we have a lot of objects - there is now a management problem. Over in Java-land they've solved some of these with ORMs and DI systems like Spring and Hibernate - why not take those ideas and reuse them ? Sure beats reinventing the wheel.

This way we get the speed and grace of CFML with the power of Java-like frameworks and methods of working.

Sections