I learned coldfusion from a "need to know" "get it done now" perspective. Only recently have I truly explored different ways of doing things in CF.
There seems to be 3 distinct methods used by CF developers and I would like to hear thoughts about which are best practices vs expedient vs overkill, and what you prefer. For discussions sake imagine you are building a simple contact book/db (names, address, email, phones).
Set up 1) Sloppy but it works.
Create database table with all fields necessary.
Create a couple of CFMs with Forms that read, insert, update, delete records to the table. Some javascript and CSS. May have redundent code within cfms. Lots of code per CFM page. Data requests may loop back over page or goto next page instead of using AJAX or data binding methods. Minimal number of pages within application.
Set up 2) reusable and semi-modular.
Create database table with all fields necessary.
Create modular CFMs which reflect the Form, cfc's to do the server side work, some javascript to output records and to do input validation. Use of cfincludes to reduce redundent code. CSS and Javascript are imported/linked pages. Reduces page code volume but increases number of files in the application. Some use of Ajax and Data binding for real time updates.
Set up 3) MVC + JQuery
Strong client side programing with minimal calls to the server for data.
Heavy use of JQUERY, AJAX, DataBinding, Structures, ResponseObjects, etc.... Use MVC architecture to truly modularize code. Code volume is minimal per module. May use XML or flat text file in place of database.





Bookmarks