This is the base class for all component factories. More...
Properties | |
NSArray * | definitionPostProcessors |
The attached factory post processors. More... | |
NSArray * | instancePostProcessors |
The attached component post processors. More... | |
BOOL | loaded |
Say if the factory has been loaded. More... | |
NSArray * | singletons |
The instantiated singletons. More... | |
Class Methods | |
(id) | + defaultFactory |
Returns the default component factory, if one has been set. More... | |
(TyphoonComponentFactory *) | + factoryForResolvingFromXibs |
Factory used to resolve definition from TyphoonLoadedView. More... | |
(void) | + setFactoryForResolvingFromXibs: |
Instance Methods | |
(void) | - enumerateDefinitions: |
(void) | - load |
Mutate the component definitions and build the not-lazy singletons. More... | |
(void) | - registerDefinition: |
Registers a component into the factory. More... | |
(NSArray *) | - registry |
(void) | - unload |
Dump all the singletons. More... | |
Instance Methods inherited from <TyphoonComponentFactory> | |
(NSArray *) | - allComponentsForType: |
Returns an array objects matching the given type. More... | |
(void) | - attachPostProcessor: |
Attach a TyphoonComponentFactoryPostProcessor to this component factory. More... | |
(id) | - componentForKey: |
Returns the component matching the given key. More... | |
(id) | - componentForKey:args: |
(id) | - componentForType: |
Returns an an instance of the component matching the supplied class or protocol. More... | |
(void) | - inject: |
Injects the properties and methods of an object. More... | |
(void) | - inject:withSelector: |
Injects the properties and methods of an object, described in definition. More... | |
(void) | - makeDefault |
This is the base class for all component factories.
It defines methods for retrieving components from the factory, as well as a low-level API for assembling components from their constituent parts. This low-level API could be used as-is, however its intended to use a higher level abstraction such as TyphoonBlockComponentFactory.
|
readnonatomicstrong |
The attached factory post processors.
|
readnonatomicstrong |
The attached component post processors.
|
readwritenonatomicassign |
Say if the factory has been loaded.
|
readnonatomicstrong |
The instantiated singletons.
+ (id) defaultFactory |
Returns the default component factory, if one has been set.
A more desirable approach, if possible - especially for a component that is also registered with the container is to use TyphoonComponentFactoryAware, which injects the component factory as a dependency on the class that needs it. This latter approach simplifies unit testing, in that no special approach to patching out the classes collaborators is required.
- (void) enumerateDefinitions: | (void(^)(TyphoonDefinition *definition, NSUInteger index, TyphoonDefinition **definitionToReplace, BOOL *stop)) | block |
+ (TyphoonComponentFactory *) factoryForResolvingFromXibs |
Factory used to resolve definition from TyphoonLoadedView.
- (void) load |
Mutate the component definitions and build the not-lazy singletons.
- (void) registerDefinition: | (TyphoonDefinition *) | definition |
Registers a component into the factory.
Components can be declared in any order, the container will work out how to resolve them.
- (NSArray *) registry |
+ (void) setFactoryForResolvingFromXibs: | (TyphoonComponentFactory *) | factory |
- (void) unload |
Dump all the singletons.