The CakePHP core team announced today the immediate availability of CakePHP 3.0 with lots of new features and improvements. Almost one year after announcing the first 3.0 preview release, followed by eight other releases (preview, dev, and RC) ! Lots of work have been done on this release and today you can download and upgrade your CakePHP environment.
Some of the CakePHP 3.0 new features include :
– New ORM
– Faster and more flexible routing
– improved migration
– Better Internationalization
– Improved debugger toolbar
– The usage of composer
– Standalone libraries
– View Cells
– In addition to the new minimum requirement : PHP 5.4.16 or greater, mbstring and intl.
We took this opportunity to ask James Watts, Core member of the CakePHP project and Enterprise PHP developer with more than 10 years experience, few questions about this release. James is also Director of the Cake Development Corporation, organizer of the annual CakePHP conference, and representative of the Cake Software Foundation – a non-profit corporation to help promote the development of the CakePHP framework, as well as support the project. He’s also co-author of the CakePHP 2 Cookbook, which include lots of useful recipes for rapid application development with the CakePHP framework.
1: An exciting new release and more than one year of work, can you tell us first about this experience?
Well, just by looking at the commit timeline for CakePHP you can appreciate the enormous increase in effort and involvement from the community. This is by far the most compelling evidence of how much the project has grown over the past 10 years. Seeing how people have joined the mission to bring CakePHP forward to current developer standards and expectations has been overwhelming.
With this latest release we’re bringing a huge update, with plenty of goodies. We’ve moved to PHP 5.4 as the required version, which has allowed us to build upon native language improvements, such as namespaces, traits, anonymous functions, closures, and short array syntax.
The framework core is now available as individual stand-alone components, and the app has also been separated, which now installs via Composer, pulling in all the necessary dependencies.
Many of the core APIs have also been overhauled, such as the HTTP library, the router, validation or i18n. There are plenty of new additions too, such as view cells, form widgets, and a dedicated plugin for database migrations.
2: The focus for this release has been the ORM, are you satisfied with the new implementation and can you tell us more about the major changes in the model layer?
The ORM is without a doubt the most notable update to the framework for 3.0, which completely replaces the old Model layer in favor of a more robust data access layer and model implementation. Many of the underlying issues developers have had over the years have been resolved, so typical pain points are gone, and replaced by significantly improved alternatives.
[pull_quote_right]The ORM is without a doubt the most notable update to the framework for 3.0[/pull_quote_right]To single out one major change, it would probably be the new separation of table and entity, which in previous versions of the framework were represented as a single Model object. This separation allows developers to have a clearer orientation as to the model and domain layer, and the handling of their business logic. However, the new interface to the ORM is also a highlight of the update, with the framework now sporting a fluent interface via a configurable Query object, and returning entities as objects, instead of an associative array as in previous versions. This gives developers an incredible amout of creative flexibility, to build on a more robust and object-oriented design.
These aren’t the only improvements. Many more, such as lazy database connections and query execution, query composition, use of queries in queries, association strategies and chainable finders, just to name a few make this the most important update to the model layer in the history of CakePHP.
3: CakePHP 3.0 represents a significant break in backwards compatibility, should CakePHP developers be worried about upgrading their applications? Will the “upgrade tool” be available with the 3.0 release?
As far as migration is concerned, there’s been a trade off as to how much we can advance the framework without incurring a huge burden on developers. We take the decision process around those concerns very seriously, and meassure the cost every step of the way. Having said that, it’s difficult to evolve and roll with the times without changing something, and major versions are there for just that.
As you mentioned, there is already an Upgrade tool, which takes care of a lot of the tasks required to get existing applications ready for 3.0. There are some modifications during migration which will require the developer’s input on how to go about it, most notably around the new ORM. However, given the new design, more than just translating code, you may find that you’re throwing a lot of your old code away where the new design is more efficient and tailored towards the task.
Said this, it’s important to note that CakePHP hasn’t changed it’s approach towards development, and still maintains the RAD philosophy through-out. The architecture will feel very familiar, and many of the design patterns developers are used to still exist or have been fundamentally improved. 3.0 isn’t a change from what CakePHP is at it’s core, but more dealing with the legacy that’s built up over the past 10 years.
4: How is CakePHP 3.0 performance compared to previous editions?
[pull_quote_right]16x speed boost in the CakePHP router for large scale applications[/pull_quote_right]As far as the framework’s internal dispatch process, it’s as fast as it can be given the features and flexibility it provides. However, performance goes beyond just the framework itself. Sure, CakePHP provides a rich and flexible caching layer, which supports Memcache and Redis out of the box, but it’s down to the developer and how they take full advantage of that. And then there’s obviously the level of optimization and caching you apply at the Web server level. For example, just placing something like Varnish in front of your stack can have an incredible effect on the response of your application, and that’s without going into the upcoming performance improvements included in HTTP 2.0.
To shed light on a specific improvement rearding performance, we’ve seen up to a 16x speed boost in the CakePHP router for large scale applications, which had an important revision for 3.0. This alone is a strong indication of how we’ve invested time in attacking the issues which are really important to developers using the framework.
5: What about security of applications created with CakePHP 3.0?
Well, the security of an application from the framework’s perspective has always been strong, and carries that on into 3.0. However, security is a sensitive topic, as it goes far beyond the application stack. As we’ve already seen over the past year or two, some significant exploits have been detected at the operating system layer, as well as in TLS, which is used with HTTP for secure communication, so a really secure system goes further than just CakePHP, and not making the mistake that the development tool you use magically provides the full security you need. Having said that, the framework doesn’t stop short in the security features it offers as part of the core package, meaning you’re protected from the start. In summary, you’re safe with CakePHP, but take security seriously at every level of your infrastructure.
6: CakePHP 3.0 fully adopts PSR-2, what do you think about the PHP-FIG and could such an intiative really help PHP frameworks?
[pull_quote_left]…stop wasting time swimming against the tide[/pull_quote_left]Well, as many know, CakePHP has used it’s own coding standard for most of the project, and I’m proud to say that expectations as far as quality and consistency of the internal code base has always been high. As far as PSR-2, my perspective is that it provides very little value as far as interoperability is concerned, which is the objective of the FIG. For us the decision was based strongly on the PHP community’s choice, and us aligning with that to stop wasting time swimming against the tide. We see this as the bigger picture, and take seriously the fact that CakePHP is one of the most popular PHP frameworks in use today, so there’s a certain level of responsibility to being in that position. The decision regarding PSR-2 is us saying to the Open Source community that we’re interested in the greater good, that benefits us all.
7: CakeFest 2015 is coming soon, what have you prepared for this year?
This year we’re at Pace University in New York, from the 28th until the 31st of May. This is a very important year for CakePHP, as we officially turn 10 years old. That’s a very long and respectable time for an Open Source project to survive, while also maintaining it’s position as one of the major PHP frameworks. The date for the event is usually around the end of August, but we brought it forward this year, to have a birthday bash. The format will be the same as always, with 2 days of workshops presented by core developers, followed by 2 days of conference, with big names in the industry giving talks on CakePHP and related topics. We also have our standard activities, such as lightning talks, the core team Q&A, and our now trademark “Hour of Contribution”, where we introduce new comers to the Open Source process, along side core developers and community veterans. There will also be some cake – real cake that is!
8: How do you see the future of CakePHP?
If you’d asked me that a year or two ago I would have described something along the lines of what 3.0 represents now. This has been a huge leap forward for the framework, as well as the community. However, now that we’ve reached this milestone I’d say that the future of CakePHP rests in the hands of developers, and what they can do with the framework. Given the recent trend to using components and building a custom stack I would also hope to see a lot of people using components from CakePHP, like the ORM, in their own custom applications. These are amazing times ahead for the project, so it’s going to be awesome seeing where we go from here.