[TYPO3-mvc] Inject blogFactory instead of objectManager->get in blog_example
Bastian Waidelich
bastian at typo3.org
Wed Apr 20 16:32:51 CEST 2011
Steffen Müller wrote:
Hi Steffen,
> Is there any reason against injecting the blogFactory?
> Performance?
injecting objects is as fast as creating a new instance "manually".
I chose to use the objectManager in this case [1], because the
blogFactory is only needed in one special case. So we don't need to
instantiate it in every single action.
Best
Bastian
[1]
<http://git.typo3.org/TYPO3v4/CoreProjects/MVC/blog_example.git?a=blob;f=Classes/Controller/BlogController.php>
More information about the TYPO3-project-typo3v4mvc
mailing list