Over the last few weeks I have been tinkering around with the popular web development framework, CakePHP. I’m a rookie at the moment (hopefully not for long) but I definitely recognize the benefits of using it.
Other popular web application frameworks include Ruby on Rails, Django, and the Zend Framework.
Model View Controller
Cake uses the Model View Controller (MVC) development pattern. When I first heard about MVC and looking into it a little further I found it very daunting and slightly confusing, but I’m not sure why because I now feel very confident working in this way! It’s a simple concept: the model represents the data of the application, the view handles the visual layout of the data, and the controller performs all the logic for the application.
It’s fast!
The most obvious advantage to me at this stage is speed. I know that with both Ruby on Rails and CakePHP you can ’scaffold’ your applications first. Basically, scaffolding (much like a construction site) is a rough structure for your application. You put the scaffolding up first, then start bulking the application out and replacing the scaffolding with your own code. It’s really great for getting something up and running quickly.
The scaffolding will automatically detect the fieldsets and datatypes in your database and generate all the boring CRUD (Create, Read, Update, Delete) code for you at run time, so you don’t have to sit around creating forms and can get a basic application up and running within minutes!
Another really nice tool is bake. This is a PHP command-line script (you run it from the shell), which will create all the CRUD code in files. So once you have scaffolded your application and are happy with all the forms/validation/relationships you can create an editable file using bake and start to customize the code.