-
Notifications
You must be signed in to change notification settings - Fork 268
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #444 from appsquickly/preattaching-infrastructure
Preattaching infrastructure components
- Loading branch information
Showing
15 changed files
with
209 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
//////////////////////////////////////////////////////////////////////////////// | ||
// | ||
// TYPHOON FRAMEWORK | ||
// Copyright 2015, Typhoon Framework Contributors | ||
// All Rights Reserved. | ||
// | ||
// NOTICE: The authors permit you to use, modify, and distribute this file | ||
// in accordance with the terms of the license agreement accompanying it. | ||
// | ||
//////////////////////////////////////////////////////////////////////////////// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@class TyphoonComponentFactory; | ||
@class TyphoonAssembly; | ||
|
||
@interface TyphoonPreattachedComponentsRegisterer : NSObject | ||
|
||
- (instancetype)initWithComponentFactory:(TyphoonComponentFactory *)componentFactory; | ||
|
||
- (void)doRegistrationForAssembly:(TyphoonAssembly *)assembly; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
//////////////////////////////////////////////////////////////////////////////// | ||
// | ||
// TYPHOON FRAMEWORK | ||
// Copyright 2015, Typhoon Framework Contributors | ||
// All Rights Reserved. | ||
// | ||
// NOTICE: The authors permit you to use, modify, and distribute this file | ||
// in accordance with the terms of the license agreement accompanying it. | ||
// | ||
//////////////////////////////////////////////////////////////////////////////// | ||
|
||
#import "TyphoonPreattachedComponentsRegisterer.h" | ||
#import "TyphoonComponentFactory.h" | ||
#import "TyphoonAssembly+TyphoonAssemblyFriend.h" | ||
|
||
@interface TyphoonPreattachedComponentsRegisterer () | ||
|
||
@property (strong, nonatomic) TyphoonComponentFactory *factory; | ||
|
||
@end | ||
|
||
@implementation TyphoonPreattachedComponentsRegisterer | ||
|
||
- (instancetype)initWithComponentFactory:(TyphoonComponentFactory *)componentFactory { | ||
self = [super init]; | ||
if (self) { | ||
_factory = componentFactory; | ||
} | ||
return self; | ||
} | ||
|
||
- (void)doRegistrationForAssembly:(TyphoonAssembly *)assembly { | ||
NSArray *infrastructureComponents = [assembly preattachedInfrastructureComponents]; | ||
|
||
for (id component in infrastructureComponents) { | ||
if ([component conformsToProtocol:@protocol(TyphoonDefinitionPostProcessor)]) { | ||
[self.factory attachDefinitionPostProcessor:component]; | ||
} | ||
else if ([component conformsToProtocol:@protocol(TyphoonInstancePostProcessor)]) { | ||
[self.factory attachInstancePostProcessor:component]; | ||
} | ||
else if ([component conformsToProtocol:@protocol(TyphoonTypeConverter)]) { | ||
[self.factory attachTypeConverter:component]; | ||
} | ||
} | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.