All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Groups Pages
TyphoonMethod Class Reference

Represents an method to inject for a component. More...

Inheritance diagram for TyphoonMethod:

Properties

SEL selector
 The selector used to initialize the component. More...
 

Instance Methods

(id) - initWithSelector:
 
(void) - injectParameterWith:
 

Detailed Description

Represents an method to inject for a component.

Used in initializer and method injections

Initializer style injection has the following advantages:

  • Presents a clear contract to put the instance in the required state before use.
  • No custom lifecycle methods (before/after property injection) are required.

Initializer injection has the following drawbacks:

  • Not suitable for classes with a very large number of dependencies - a very large initializer method will create poor readability.
  • Auto-injection by type is not supported.
  • No type introspection for objects injected with a text representation.

Its generally recommended to use initializer-style injection, unless the above drawbacks will manifest.

Property Documentation

- (SEL) selector
readnonatomicassign

The selector used to initialize the component.

Method Documentation

- (id) initWithSelector: (SEL)  selector
- (void) injectParameterWith: (id)  injection