ColdFusion Pages Versus ColdFusion Components

Typically, my preference for a particular type of technology or architecture is driven by the nature of the task I need to accomplish. I favor that which gets the job done most efficiently and allows the project to be maintained most easily. I can’t think of any situation in which I would recommend using ColdFusion pages rather than ColdFusion Components to provide Flash Remoting services. Using ColdFusion pages and the Flash variable scope might be faster initially for developers not familiar with CFCs. However, I strongly recommend learning to write CFCs and appreciate the theory behind them.

There are three things CFCs offer that ColdFusion pages do not:

Documentation

CFCs provide an excellent and completely automatic form of documentation, and you can browse them from the Flash and Dreamweaver authoring environments.

Automatic validation

Since CFCs allow you to define the arguments that a function accepts, the ColdFusion Server can automatically validate the parameters passed to a function. You must hand-code such validation for ColdFusion pages.

Re-use

Writing Flash Remoting services as ColdFusion pages requires the Flash variable scope for retrieving arguments and returning data, making the pages incompatible with clients other than Flash. ColdFusion Component code can and should be kept generic enough that you can invoke the same functions from various clients, such as Flash Remoting, ColdFusion pages, other CFCs, and through URLs. ...

Get Flash Remoting: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.