Dan and I went to Symfony Live London last Friday to find out what was happening in the world of Symfony.
Here's a summary of the six talks we attended:
1. The Dependency Trap
Jakub Zalas gave an interesting talk about the difficulties of relying too heavily on third-party services and classes.
He went through the process of thinking about writing code while avoiding being overly reliant on a third-party. The main benefit is when you need to change your code or third-party service at a later date, it should be easy enough to do without having to re-write half of your application.
2. How Kris Builds Symfony Apps
Although I haven't been working with Symfony that long, the name 'Kris Wallsmith' keeps coming up when looking around at various bundles. He talked about his approach to building apps.
He went through the different layers involved in building an app, such as controller, models, services, event handlers, etc. He dismissed the myth of 'thin controllers, fat models', by looking at what the controllers, models and services actually do at each level.
In his view they are all just 'mapping layers' between the different data abstraction layers apps have. When you look at it like this, you end up with 'thin controllers, thin models' and 'thin services with thin events'.
3. The Naked Bundle
Matthias Noback introduced the self-titled, 'Noback's Principle: Code shouldn't rely on something that it doesn't truly need'.
He suggested we should limit our dependency on the framework as much as possible.
We should try to limit to the point where pretty much everything that you would normally put inside a Symfony Bundle (which is a concept very much tied to the framework) can be moved in some way into framework agnostic, re-usable components.
The talk was enlightening, but it made me wonder whether I am ready to break away from Symfony so soon!
4. One Commit, One Release. Continuously Delivering a Symfony Project
Javier Lopez went through the continuous integration process they used on a project. The talk explained that a release to production doesn't have to be a such a daunting task.
Interestingly, they had managed to reduce the time it took to deploy a release from 30 minutes to 30 seconds. They released most days, rather than once a week or each fortnight. Also the product owner could trigger a release rather than relying on a developer to do it.
At Deeson we are using continuous integration for our web build projects more and more.
5. Converting a Website to a New Religion: Symfony
Michael Cullum has been involved in the rebuild of phpBB using Symfony and went through their approach to rebuilding such a large scale app.
When looking at rebuilding a site, you can be tempted to copy and paste a lot of code.
Michael highlighted the problems with repasting code. In fact when we have the opportunity to rewrite code, we should be tackling it head on.
We all write code which we look at six months or a year later and think, "what was I thinking when I wrote that?" He told us to understand what we are trying to achieve and write efficient code now.
What was interesting is that they had looked at a section of phpBB at a time. They started with the home page and got that working, then moved onto the next page.
This is different from the norm of building the functionality and then getting theming working across the entire site as a second step.
6. Decorating Applications with Stack
Beau Simensen was introducing 'Stack' - a convention for composing HttpKernelInterface middlewares into your application.
He went through its history, which applications can currently use it (Symfony, Silex, Laravel 4, and Drupal 8) and a brief overview of how it can be used.
Although an interesting concept, it didn't seem immediately relevant to our experience.
A worthwhile event
As we're using Symfony more and more, it was interesting to be part of the event and to attend such a range of interesting talks.