[TYPO3-mvc] Benefit of DI when referencing to a class (and not to an interface)?

Roland most.wanted at gmx.at
Tue Jun 26 11:52:00 CEST 2012


hi bastian,

> Yes, it's easier to create unit tests for classes that have less
> dependencies.

ok. thanks. i don't know that much about unit tests for now - but i 
trust you! ;-)

do you really reduce dependency with this?

--- quote ---

/**
  * @var Tx_Foo_Domain_Repository_BarRepository
  * @inject
  */
protected $barRepository;

--- /quote ---

aren't you still dependent on a class named 
Tx_Foo_Domain_Repository_BarRepository?

do i misunderstand the term "dependency"? does "dependency" mean the 
opposite of "decoupling" here?

maybe is should not worry that much about terms and definitions?

kind regards

roland


More information about the TYPO3-project-typo3v4mvc mailing list