Skip navigation.
Home
That which cannot be rendered in binary is by definition a delusion
 

Let them eat Cake

Although I have become something of a "Company man", preferring the Zend Framework, before I started with ZF I used Cake, and I think for many smaller scale projects, Cake is much better. I would feel much better about leaving a Cake project in the hands of a smaller house, simply because there is far less code to understand and maintain.

Cake is essentially a Ruby clone for LAMP. It has the classic MVC pattern, ActiveRecord ORM, view helpers etc. It also has only about a dozen core pages for documentation, but thats because it only needs about a dozen pages to document its libraries.

While it doesn't have a comprehensive AJAX solution, it does play well with Prototype, which is coincidentally enough the AJAX library of choice in Ruby. Prototype is a fairly "Structural" library focusing on homogenizing Javascript across browsers, enabling modern iterator behavior in arrays, and pulling blocks from the server into the page -- the fundamental building blocks. It does not feature the elements you might come to expect from Yahoo's UI library or Dojo (Tabs, calendars, etc.) but it does give you solid tools for building these types of components.

The manin plus for Cake is that it took me a week to learn; it took me over a month to really "Get" Zend Frameworks, but that was because there is much more "There" there -- a more sophisticated ORM, a plugin layer for rerouting calls, and lets face it, Verizon-like army of objects and libraries. I sincerely believe that for a modern application, these kind of resources are a plus (Its no coincidence that I got exposed to it in Live Nation), but if you are doing a relatively small scale application of the sort that Ruby is traditionally used in, but don't feel like there's enough reason to pick up a new language, Cake is definately worth looking at. Especially if you can't decode MVC, this is a great entrypoint into modern application design. I left an instance of it for Changemakers Radio; it took almost no time to construct and I'm sure no matter who ends up maintaining it, they will find the code extremely flexible and easy to work with.

The only thing I can't speak to is scalability. I have heard people say, "We started out with Cake but ran into problems when we tried to ramp it up," which I've also heard from those that dabbled in Ruby (again, LiveNation). This might have something to do with the fact that the ORM is not designed to handle multi-table optimized queries (or at least its not part of the core docs -- "You can do anything with anything" but you might not always enjoy the process). And for some people Frameworks themselves are problematic.* From a pure horsepower point of view, it compares with Symfony (according to the cake people anyway). I've only skimmed Symfony but it is a pretty good contender in the "Framework wars".

One thing I should say regarding Symfony -- unlike Cake and Zend, they do give you the basic underpinnings of an app from the get-go. They have scripts to set up your admin layer, a basic template, user management etc. While much of this will get paved under as you go, it is really nice when you are learning an environment to get something substantial up front.

So give Cake a shot if you are looking for a simple way to write a clean, maintainable project that is unlikely to explode into an elephant. Or, if you are thinking of jumping ship to Ruby. Even if you do, ultimately, it is a useful transitional springboard for modern application design.


* (The short story for those who don't like hopping out on links: The "Real code" of an application is the code you write yourself, and if at some point you want to optimize the framework code to the benefit of your own code, you find yourself dealing with a codebase that is impossible to manage because changing it to make it serve one context better can destroy its utility for others. There's much more there -- Terry is "Scary brilliant")

Post new comment

  • Allowed HTML tags: <a> <p> <span><small> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <embed> <object> <param> <strike> <caption>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options