Feature #319

Support setter injection without configuration through "inject" methods

Added by Robert Lemke over 11 years ago. Updated almost 9 years ago.

Status:
Resolved
Priority:
Should have
Assignee:
Category:
Object
Target version:
-
Start date:
2008-02-18
Due date:
% Done:

100%

PHP Version:
Has patch:
Complexity:

Description

Currently setter injection is only possible via setter methods whose name follows the scheme "setPropertyName". These dependencies need to be configured explicitly in the Components.ini file because autowiring is not possible in this case.

It would be nice if there was (additionally) support for "inject" methods (setter methods with names like "injectPropertyName"). By convention these methods would be recognized as setters for dependencies and could be autowired.

inject* methods should be preferred over set* methods.

Associated revisions

Revision b12c43ac (diff)
Added by Robert Lemke over 11 years ago

  • FLOW3: (Component) Removed support for setter injection via generic "setProperty()" method.
  • FLOW3: (Component) Setter injection is now also possible via a "inject" method, e.g. injectSomeDependency() (instead of setSomeDependency). All methods whose name starts with "inject" will be included into the autowiring procedure. Therefore dependencies don't need to be configured explicitly in the Components.ini when "inject" methods are used. Resolves #319.
  • FLOW3: (Component) Added autowiring support for "inject" setter methods. Addresses #319.
  • Smarty: Added check against multiple definition of "SMARTY_DIR"
  • Testing, TYPO3, PhoneBookTutorial: Refactored to the new "inject*" methods in the action controllers.

History

#1 Updated by Robert Lemke about 11 years ago

  • Target version deleted (18)

Also available in: Atom PDF