Tuesday, September 18, 2007

CakePHP: Day 2, the bad


Once you started to play with scaffolding and limited ORM, you want and need more. That's when you start to feel the limits of a framework like this or RoR or anything of that kind, it's good as long as you do what it is designed for. Among the problems i remember facing:
- For the ORM at some point you need to create weird object structures if you want to save an object and its relationships, something that is not documented by the way.
- For the view layer, it sucks really bad, unfortunately that's where PHP should be good at. You'll have a hard time passing parameters to the view, like if it shouldn't be created dynamically. It's fine as long as you have a single part of the UI which gets dynamic data at a time. My layout contains a menu where i want to specify on which page the user is, well it is not designed for, i cannot really pass information to the layout. Sure there are hacks but this is not something i want to do.
- Don't forget to use the POST method for your forms, or you end up with cryptic error message related to the session... Or how to loose several hours.
- I wish i remembered all the bumps that break the "build a website in a weekend" promise of RAD frameworks.

5 comments:

luigi said...

Don't use scaffolding but generate your code with "bake".

Scaffolding is not a bad approch but an ugly one

Thomas Heute said...

Scaffolding is a toy :) It's just fun.
bake is broken, from the latest stable release, it's not able to pick up my fields name. And i'm not the only one facing this bug.

luigi said...

try 1.2 or the nightly build from svn.

bake works fine for me ...

report a ticket.

Thomas Heute said...

It looks like it has been fixed and will be part of the next release.

antonyc said...

To my mind ROR is not really a bad one, at least it's ORM is fine, what I cant say of the one CakePHP has.. I'm depressed with those so called 'wierd objects' you mentioned.. For example in a view I cant use a member function from model class to check some dependendencies (If my Attribute has particular AttributeValue). That's the lack of poor OOP design in Cake, mb.