We’ve been baking!
Hello again everybody!
Appologies for not posting in the last two weeks, but I have been busy baking and James has been busy, well I don’t know as his internet connection at uni is still playing up.
Anyway, I was looking for ways to improve my MVC system so that it could handle complex SQL queries and I came across another MVC system called Cake PHP.
I thought I would give it a go quickly, and wow, I was impressed. It is near enough the same as Ruby on Rails, and in some ways better (althought I am sure the diehard RoR fans would disagree). Deployment is easy, and unlike RoR doesn’t need you to fiddle with anything complicated on your server. Plus it is PHP based which almost all webhosts support, so should run near enough anywhere. The main advantages over my MVC system are that it includes a proper Active Record, caching, probably better security, and tonnes of other things. I decided rather than trying to reinvent the wheel, I would ditch my system for one which lets me get on with programming Juvely, which is now a piece of Cake.
Other things that have been useful are the great documentation. It doesn’t go too indepth in topics (which is good for the begginner) but explains more than enough to get on with your first app. There is also the so called Bakery, a wiki that contains “everything CakePHP”.
The engine itself in my opinion is much more user-friendly that Ruby On Rails, the error messages are beautiful. They don’t contain anything unneeded and clearly explain what the problem is, and even suggest a solution. For example, say you go to an URL for a controller that doesn’t exist.

Ruby just spits out an error message saying the route was not recognised.

Cake on the other hand spits out the error message, details of how to customise the error message, and what you need to put in what file to fix the problem.
As with everything it also has its disadvantages. I spent ages trying to figure out why my HABTM relationship wasn’t working, eventually to find out I had my array in the wrong order. Also the main site for pluggins and addons is by default in French. In order to view the English version you need to register (in French) and then change your language preferences, it would have been much nicer just to have some language buttons somewhere, but heh.
Anyway, CakePHP looks very promissing, and I expect to see a lot more of it in the future! After being public for under two years it looks like a lot will come out of it!
Hi,
How’s the framework research is going on? I’ve been checking various php frameworks that are similar to Ruby on Rails (since I don’t want to spend my time configuring mongrel & apache clusters) and then I kinda accidentally wrote my own simple MVC framework. It’s nothing fancy, but it has ActiveRecord implementation and some other useful stuff.
You might want to try to write your own framework first, it might be fun and when you run into problems & bugs, you know all the inner-workings of your application’s framework and you know how to deal with them. But the downside is, more you spend time on framework, the less you spend time with your application…
Here is another MVC framework, Akelos (http://www.akelos.org) “Akelos Framework, PHP on Rails”. I haven’t tried it, since it lacks documentation. I hope they fix it soon, I think it has potential.
Comment by Tuomas — 21st of February, 2007 @ 7:24 am
Thanks for your comment Tuomas!
I started writing my own framework to begin with based upon a tutorial I found (I am afraid I don’t have the URL, but I am sure a Google search will bring up plenty). It was actually quite a lot easier than I thought it would be - to start with - but things gradually got more and more complicated. I found Cake while looking for ideas of how I could do things in my own framework, but when I found Cake I thought I would give it a try.
Another thing that made me go with another framework rather than my own was that we don’t have to really worry about bugs that could appear in the code, as Cake is being developed by and used by (hence tested by) many people bugs will quickly appear and hopefully quickly dissapear. If we used a system we built ourself it would be up to us to find bugs and eradicate them, which would lead to less time working with Juvely.
There are definately plus sides to writing your own MVC framework (and a lot of fun to be had along the way), but if you are developing an application I would say give it a miss as there are plenty of other frameworks out there that can be used - if you really can’t find one that suits your needs or have an idea of how to do it better then go for it!
Luca
Comment by Luca — 21st of February, 2007 @ 4:01 pm