TAG | Symfony2
Fat controllers, you know them: Those bloated controllers which grew up in size drastically during a project lifetime. It is so easy to create them but difficult to get rid of them after a project went live once. Controllers should be kept to a minimum as they should be exchangeable and without any business logic.
In this article I provide 4 simple tips to avoid fat controllers and which are easy to follow.
by Frank Stelzer*
At the Symfony Live Berlin 2012 last week I joined a discussion about handling dependencies in services. One person mentioned that he used to inject the whole dependecy injection container (DIC) to a service in some cases. The service itself requests one or more services from the injected container and use it then for internal stuff.
The service pulls his dependencies here. However dependencies should always be pushed and injected directly in the constructor or with a setter if possible.
by Frank Stelzer*
Now why is this important?
Only recently there seems to be a lot of talk about the components concept behind Symfony. Some people might ask what is Symfony? a library? a collection? a framework?
The answer of course is: yes.
You’ve probably been there as well. You said: Lets build a software that we use for all our clients. A big do-it-all CMS or similar. With every client project your software grows and gains cool features. New features that are attractive also to old clients.
They both use the same software but how can you get from one point in time to the other?
Ever since I write sfImageTransformExtraPlugin I have this plan of porting it to Symfony 2 and/or Silex. So far I just didn’t have the requirement thus no time for it. But I know roughly what ingredients would be needed.
One of them would be a static cache.
Todays post I was actually meant to give on this years FrOSCon which sadly I had to cancel as I have been engaged business-wise at that time.. Anyway the idea remained and it might inspire some of you to get a new access to refactoring legacy systems.
With Symfony of course.
The framework obviously. Or the components? And Silex obviously. And Twig and SwiftMailer are part of it. Doctrine, isn’t it? It used to be Propel, right? And what about the community? Or is it Fabien?
There have been some redefinitions floating around lately and I get the impression the term is not yet fully defined. So here’s my attempt.
Apart from many other things I am currently developing a command line tool to access Google Analytics data. The tool is build using the awesome and easy to use Symfony2 Console component, GAPI for Google Analytics access and PHPExcel for saving the reports.
Lately I have been using Silex a lot for developing Facebook applications. Currently I’m working on one that could become a little bigger though and I am seriously uncertain whether to stay with the micro-framework Silex or moving to a full blown Framework like Symfony2.
I just don’t know when Silex will become too limited or if at all.