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
Flashvariable 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. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access