Events are a great way to separate the business logic of your application and make things simpler and, often, faster. CakePHP framework introduced an events system in version 2.1, and since then it got much better. The official documentation covers current implementation pretty well. But in this post I wanted to link to a few articles that provide more of a historical perspective.
First, goes this blog post by Martin Bean from back in 2013. It shows how things were initially. Even with all the improvements in version 3, the first implementation was still pretty useful.
Second, comes this review of the CakePHP events system (still in version 2), and some profiling of this new functionality. These guys looked at all the details and eventually suggested some improvements.
Their effort didn’t go unnoticed. Mark Story, one of the lead developers of CakePHP framework, wrote this blog post, explaining the upcoming (at the time) changes to the events system in CakePHP version 3.
As a result CakePHP 3 event system is a much simpler and cleaner implementation. Have a look at this guide for a quick introduction.
I’m sure this is not the end of the road, as no software is ever perfect. But it’s a good place to be.