Tuesday, September 11, 2007

CakePHP: Day 1, the good



CakePHP separates the concerns following the well know MVC pattern. The Model can define validation constraints on the fields to make form validation easier. It's also mapped to a database (a cheap ORM mechanism) that can keep you away from writing SQL queries for simple things. It handles one-to-one, one-to-many and many-to-many (in a weird way) relationships, that's convenient.
The Controllers can interact each other by some kind of injection, that's convenient to separate the concerns between several controllers, the View gets data from the controller through a single array called 'data'. The view can be separated into elements, but i didn't find managing those components really simple (unless they are static of course) other parts of the view must be aware of those elements to pass them the correct data.

CakePHP also integrates some security framework that seems good enough for simple but common needs, that i could use for my pet project.

The scaffolding let you Create Read Update Delete "objects" very easily by creating the corresponding HTML forms, unfortunately i don't think it handles the relationships between tables (at least i didn't see that). Internationalization will be handled in the next release, i only tried the current stable release.

So with the scaffolding, the (simple) layout mechanism, basic ORM and security framework you can start coding really fast.

2 comments:

Anonymous said...

Takk for en interessant blogg

Anonymous said...

Takk fyrir ahugaverd blog