The code side of applications
A popular question for programmers is to ask the benefit of separating the code into different units. By separating the view code into a separate file, the designer finds it easier to concentrate on his work tasks. We do the same thing with the developer by separating code into the controller and models.
The model
To get a really clear picture of what a controller is and what it does, we need to understand what a model is. A simple and accurate definition of a model is a unit of program code that emulates a real world item. This could be anything from a shopping cart to something less tangible such as a mail-handling model. Just as we interact with a mailbox, the mail model would have both attributes and methods that perform actions. This should be sufficient to guide us on what type of logic is best moved outside of the controller.
The controller
On our ColdFusion websites, each time a page or Ajax service is requested, application frameworks pass the control of...