With CakePHP 3.0 out the door, I thought it would be good to reflect on the project. CakePHP 3.0 is the longest and largest open source project milestone I’ve ever participated in. At FreshBooks we do retrospectives on large projects as a way to see what went well, and what could have gone better. The goal is to discover things we should keep doing, and what to improve the next time around.
Things that could have gone better
- Project duration. 3.0 took a massive amount of time – almost 2.5 years. I don’t think any of us anticipated this kind of time commitment originally. Furthermore, 2.5 years is a long time to not have a new release for a community. I feel that CakePHP probably lost a sizable chunk of our users to other frameworks because people’s perception was that the project was not advancing.
- The number of breaking changes. 3.0 is the single largest API break CakePHP has ever undergone. This will likely inhibit upgrading and possibly fragment the community. It might have made more sense for us to create a new standalone ORM, and release plugins for all the new features in 3.0.0. If I ever have to do something like this again, I’ll probably explore that approach instead.
- Incomplete examples of alternative datasources. Previous versions of CakePHP had a accepted way to add support for non-relational stores to the model system. Because we wanted to deliver a fantastic ORM, we had to sacrifice the previous abstractions. What we failed to do was show how one could build a datastore integration for non-relational databases. Jose Lorenzo and I have started to work on an elastic search plugin with the goal of giving a powerful ORM on top of a non-relational store that can be an example for others.
- Building standalone console apps still not great. While 3.0 improves many parts of the framework, the console libraries are not significantly better. I hope that in a future version we can deliver console tools that are as great as our web tools.
Things that went well
- Plugins for bake, migrations, and separate repository for app skeleton. These were somewhat controversial changes when proposed, however they have already started to yield benefits. Not only can bake no longer be installed in production environments, but we can release bake, and migrations more frequently than the core libraries.
- Component Libraries We spent a good chunk of time detangling CakePHP for 3.0. The result is that we now offer several slices of cake as standalone libraries. The collections, database, and ORM packages are particularily nice.
- Leveraging existing libraries. CakePHP previously had a long history of re-inventing all the things. To be fair, CakePHP started well before sharing code between libraries was easy or manageable for normal people. Composer changed how PHP libraries are consumed, and I’m really happy that we decided to use external libraries for features like datetime handling, the interactive console, migrations and shim libraries.
- New ORM. I’m really happy with how the new ORM has turned out. Jose Lorenzo really outdid himself with it. I think it is one of the most flexible, powerful and feature rich ORMs for PHP.
- New website done for release day. I had my doubts that this was going to happen, but the folks at CakeDC did a great job in getting the site ready.
- Docs completed at the same time as code. For 3.0, all the documentation was written with or shortly after the code was completed. This let us have current and correct documentation at each alpha, beta and RC release. While we started this practive during the 2.x releases, it really proved itself during 3.0. I’m also a firm believer in writing documentation before you write code as a cheap way to ensure the resulting API is solid.
- Lots of early great feedback from the community. Even though we were iterating quickly and releasing lots of breaking changes we still had good involvement from the community. I’m very thankful that we had great feedback throughout the development of 3.0.
While this list is mostly a brain dump of things I’ve thought about 3.0, I’d love to hear your thoughts as well.