[TYPO3-mvc] questions: @lazy, @inject, @api, constructors

Martin Kutschker masi-no at spam-typo3.org
Tue Jan 19 11:48:26 CET 2010


Sebastian Kurfürst schrieb:
> Hey,
> 
>>> The Factory pattern is another solution to ensure invariants.
>> Defaults are not invariants. I like factories, but I thought they are bad when it comes to unit testing?
> ... But defaults should conform to invariants as well ;-)
> 
> Hmm, why should factories be bad when it comes to unit testing?

I recall something that the argument goes along the lines that it is a problem that you have to have
to deal with the factory inside the test and cannot simply create the object which methods you want
to test.

For t3lib_div::makeInstance() I wanted to add support for a generic factory interface, but Robert of
v5 fame spoke against factories.

Masi


More information about the TYPO3-project-typo3v4mvc mailing list