Skip to content

Commit

Permalink
Rename to Typhoon!
Browse files Browse the repository at this point in the history
  • Loading branch information
Jasper Blues authored and Jasper Blues committed Jan 20, 2013
1 parent e8174ab commit 6f9c409
Show file tree
Hide file tree
Showing 82 changed files with 1,098 additions and 919 deletions.
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ A Spring-like dependency injection container for Objective-C and Cocoa. Light-w

## Status? It's ready to use!

* <a href="https://github.com/jasperblues/spring-objective-c-example">Try the sample application</a>.
* <a href="https://github.com/jasperblues/Typhoon-example">Try the sample application</a>.

##Current Work?

* More <a href="http://www.jetbrains.com/objc/">AppCode IDE</a> integration. (Thanks to Jetbrains for the assistance).
* A very cool <a href="https://github.com/jasperblues/spring-objective-c/wiki/Assembling-Components-with-Blocks">block-based application assembly</a>, for those that prefer pure-code. (Mostly done, just need to do the docs).
* A very cool <a href="https://github.com/jasperblues/Typhoon/wiki/Assembling-Components-with-Blocks">block-based application assembly</a>, for those that prefer pure-code. (Mostly done, just need to do the docs).
* Macro-style injection
* A super-secret new name!

Expand Down Expand Up @@ -142,45 +142,45 @@ and GUI tool-support.
* If you're interested in reading an architectural discussion, especially ___why xml is a good choice___ to declare
components, their collaborating classes and their configurations, as well as what other styles of dependency injection
this container will be supporting:
<a href="https://github.com/jasperblues/spring-objective-c/wiki/Does-this-mean-XML%3F">___then please read this.___</a>
<a href="https://github.com/jasperblues/Typhoon/wiki/Does-this-mean-XML%3F">___then please read this.___</a>

otherwise . . .

# Usage

* <a href="https://github.com/jasperblues/spring-objective-c-example">Play with the sample application</a>.
* <a href="https://github.com/jasperblues/Typhoon-example">Play with the sample application</a>.

And then:

* <a href="https://github.com/jasperblues/spring-objective-c/wiki/Assembling-Components-in-XML">Assembling Components in XML</a> ___or___ <a href="https://github.com/jasperblues/spring-objective-c/wiki/Assembling-Components-with-Blocks">Assembling Components with Blocks</a>
* <a href="https://github.com/jasperblues/Typhoon/wiki/Assembling-Components-in-XML">Assembling Components in XML</a> ___or___ <a href="https://github.com/jasperblues/Typhoon/wiki/Assembling-Components-with-Blocks">Assembling Components with Blocks</a>

* <a href="https://github.com/jasperblues/spring-objective-c/wiki/Using-Assembled-Components">Using Assembled Components</a>
* <a href="https://github.com/jasperblues/Typhoon/wiki/Using-Assembled-Components">Using Assembled Components</a>

* <a href="https://github.com/jasperblues/spring-objective-c/wiki/Incorporating">Incorporating the framework into your project.</a>
* <a href="https://github.com/jasperblues/Typhoon/wiki/Incorporating">Incorporating the framework into your project.</a>

* <a href="https://github.com/jasperblues/spring-objective-c/wiki/Configuration-Management-&amp;-Testing">Configuration Management & Testing.</a>
* <a href="https://github.com/jasperblues/Typhoon/wiki/Configuration-Management-&amp;-Testing">Configuration Management & Testing.</a>

# Reports

In the spirit of lean-methodologies, the API and Test Coverage reports below are published by my build server, after
each commit. (If you'd like the script I will share it).

* <a href="http://jasperblues.github.com/spring-objective-c/api/index.html">API</a>
* <a href="http://jasperblues.github.com/spring-objective-c/coverage/index.html">Coverage Reports</a>
* <a href="http://jasperblues.github.com/Typhoon/api/index.html">API</a>
* <a href="http://jasperblues.github.com/Typhoon/coverage/index.html">Coverage Reports</a>



# Feature Requests and Contributions

. . . are very welcome.

* <a href="https://github.com/jasperblues/spring-objective-c/wiki/Contribution-Guide">Contribution Guide.</a>
* <a href="https://github.com/jasperblues/Typhoon/wiki/Contribution-Guide">Contribution Guide.</a>

* Look at, and contribute to the <a href="https://github.com/jasperblues/spring-objective-c/wiki/Roadmap">roadmap</a> here.
* Look at, and contribute to the <a href="https://github.com/jasperblues/Typhoon/wiki/Roadmap">roadmap</a> here.

# Frequently Asked Questions

. . . are <a href="https://github.com/jasperblues/spring-objective-c/wiki/FAQ">here</a>.
. . . are <a href="https://github.com/jasperblues/Typhoon/wiki/FAQ">here</a>.


# Who's using it?
Expand All @@ -192,7 +192,7 @@ each commit. (If you'd like the script I will share it).

# Authors

* <a href="http://ph.linkedin.com/pub/jasper-blues/8/163/778">Jasper Blues</a> - <a href="mailto:[email protected]?Subject=spring-objective-c">[email protected]</a>
* <a href="http://ph.linkedin.com/pub/jasper-blues/8/163/778">Jasper Blues</a> - <a href="mailto:[email protected]?Subject=Typhoon">[email protected]</a>

### With contributions from:

Expand Down
Binary file added Source/.DS_Store
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,29 @@


#import <Foundation/Foundation.h>
@class SpringComponentDefinition;
@class TyphoonComponentDefinition;

typedef enum
{
SpringComponentInitializerIsClassMethodGuess,
SpringComponentInitializerIsClassMethodYes,
SpringComponentInitializerIsClassMethodNo
} SpringComponentInitializerIsClassMethod;
TyphoonComponentInitializerIsClassMethodGuess,
TyphoonComponentInitializerIsClassMethodYes,
TyphoonComponentInitializerIsClassMethodNo
} TyphoonComponentInitializerIsClassMethod;

@interface SpringComponentInitializer : NSObject
@interface TyphoonComponentInitializer : NSObject
{
NSMutableArray* _injectedParameters;
NSArray* _parameterNames;
__unsafe_unretained SpringComponentDefinition* _definition;
SpringComponentInitializerIsClassMethod _isClassMethodStrategy;
__unsafe_unretained TyphoonComponentDefinition* _definition;
TyphoonComponentInitializerIsClassMethod _isClassMethodStrategy;
}

@property(nonatomic) SEL selector;
@property(nonatomic) BOOL isClassMethod;

- (id)initWithSelector:(SEL)initializer;

- (id)initWithSelector:(SEL)initializer isClassMethod:(SpringComponentInitializerIsClassMethod)isClassMethod;
- (id)initWithSelector:(SEL)initializer isClassMethod:(TyphoonComponentInitializerIsClassMethod)isClassMethod;

- (void)injectParameterNamed:(NSString*)name withReference:(NSString*)reference;

Expand All @@ -50,6 +50,6 @@ typedef enum

- (NSInvocation*)asInvocationFor:(id)classOrInstance;

- (void)setComponentDefinition:(SpringComponentDefinition*)definition;
- (void)setComponentDefinition:(TyphoonComponentDefinition*)definition;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@



#import "SpringComponentInitializer.h"
#import "SpringParameterInjectedByReference.h"
#import "NSObject+SpringIntrospectionUtils.h"
#import "SpringParameterInjectedByValue.h"
#import "SpringComponentDefinition.h"
#import "TyphoonComponentInitializer.h"
#import "TyphoonParameterInjectedByReference.h"
#import "NSObject+TyphoonIntrospectionUtils.h"
#import "TyphoonParameterInjectedByValue.h"
#import "TyphoonComponentDefinition.h"


@implementation SpringComponentInitializer
@implementation TyphoonComponentInitializer


/* ============================================================ Initializers ============================================================ */
- (id)initWithSelector:(SEL)initializer
{
return [self initWithSelector:initializer isClassMethod:SpringComponentInitializerIsClassMethodGuess];
return [self initWithSelector:initializer isClassMethod:TyphoonComponentInitializerIsClassMethodGuess];
}

- (id)initWithSelector:(SEL)initializer isClassMethod:(SpringComponentInitializerIsClassMethod)isClassMethod;
- (id)initWithSelector:(SEL)initializer isClassMethod:(TyphoonComponentInitializerIsClassMethod)isClassMethod;
{
self = [super init];
if (self)
Expand Down Expand Up @@ -56,7 +56,7 @@ - (void)injectParameterAtIndex:(NSUInteger)index withReference:(NSString*)refere
{
if (index != NSUIntegerMax && index < [_parameterNames count])
{
[_injectedParameters addObject:[[SpringParameterInjectedByReference alloc] initWithParameterIndex:index reference:reference]];
[_injectedParameters addObject:[[TyphoonParameterInjectedByReference alloc] initWithParameterIndex:index reference:reference]];
}
}

Expand All @@ -70,8 +70,8 @@ - (void)injectParameterAt:(NSUInteger)index withValueAsText:(NSString*)text requ
{
if (index != NSUIntegerMax && index < [_parameterNames count])
{
SpringParameterInjectedByValue* parameterInjectedByValue =
[[SpringParameterInjectedByValue alloc] initWithIndex:index value:text classOrProtocol:classOrProtocol];
TyphoonParameterInjectedByValue* parameterInjectedByValue =
[[TyphoonParameterInjectedByValue alloc] initWithIndex:index value:text classOrProtocol:classOrProtocol];
[parameterInjectedByValue setInitializer:self];
[_injectedParameters addObject:parameterInjectedByValue];
}
Expand Down Expand Up @@ -107,7 +107,7 @@ - (NSInvocation*)asInvocationFor:(id)classOrInstance
return invocation;
}

- (void)setComponentDefinition:(SpringComponentDefinition*)definition
- (void)setComponentDefinition:(TyphoonComponentDefinition*)definition
{
_definition = definition;
[self resolveIsClassMethod];
Expand All @@ -133,7 +133,7 @@ - (NSString*)description

- (void)dealloc
{
for (id <SpringInjectedParameter> parameter in _injectedParameters)
for (id <TyphoonInjectedParameter> parameter in _injectedParameters)
{
//Null out the __unsafe_unretained pointer back to self.
[parameter setInitializer:nil];
Expand Down Expand Up @@ -172,11 +172,11 @@ - (BOOL)resolveIsClassMethod

switch (_isClassMethodStrategy)
{
case SpringComponentInitializerIsClassMethodNo:
case TyphoonComponentInitializerIsClassMethodNo:
return NO;
case SpringComponentInitializerIsClassMethodYes:
case TyphoonComponentInitializerIsClassMethodYes:
return YES;
case SpringComponentInitializerIsClassMethodGuess:
case TyphoonComponentInitializerIsClassMethodGuess:
return ![NSStringFromSelector(_selector) hasPrefix:@"init"];
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@


#import <Foundation/Foundation.h>
@class SpringComponentInitializer;
@class TyphoonComponentInitializer;

typedef enum
{
SpringParameterInjectedByReferenceType,
SpringParameterInjectedByValueType
} SpringParameterInjectionType;
TyphoonParameterInjectedByReferenceType,
TyphoonParameterInjectedByValueType
} TyphoonParameterInjectionType;

@protocol SpringInjectedParameter <NSObject>
@protocol TyphoonInjectedParameter <NSObject>

- (NSUInteger)index;

- (SpringParameterInjectionType)type;
- (TyphoonParameterInjectionType)type;

- (void)setInitializer:(SpringComponentInitializer*)initializer;
- (void)setInitializer:(TyphoonComponentInitializer*)initializer;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@


#import <Foundation/Foundation.h>
#import "SpringInjectedParameter.h"
#import "TyphoonInjectedParameter.h"


@interface SpringParameterInjectedByReference : NSObject <SpringInjectedParameter>
@interface TyphoonParameterInjectedByReference : NSObject <TyphoonInjectedParameter>

@property (nonatomic, readonly) NSUInteger index;
@property (nonatomic, readonly) SpringParameterInjectionType type;
@property (nonatomic, readonly) TyphoonParameterInjectionType type;
@property (nonatomic, strong, readonly) NSString* reference;

- (id)initWithParameterIndex:(NSUInteger)parameterIndex reference:(NSString*)reference;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@



#import "SpringParameterInjectedByReference.h"
#import "SpringComponentInitializer.h"
#import "TyphoonParameterInjectedByReference.h"
#import "TyphoonComponentInitializer.h"


@implementation SpringParameterInjectedByReference
@implementation TyphoonParameterInjectedByReference

/* ============================================================ Initializers ============================================================ */
- (id)initWithParameterIndex:(NSUInteger)parameterIndex reference:(NSString*)reference
Expand All @@ -30,12 +30,12 @@ - (id)initWithParameterIndex:(NSUInteger)parameterIndex reference:(NSString*)ref
}

/* =========================================================== Protocol Methods ========================================================= */
- (SpringParameterInjectionType)type
- (TyphoonParameterInjectionType)type
{
return SpringParameterInjectedByReferenceType;
return TyphoonParameterInjectedByReferenceType;
}

- (void)setInitializer:(SpringComponentInitializer*)initializer
- (void)setInitializer:(TyphoonComponentInitializer*)initializer
{
//Do nothing.
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@


#import <Foundation/Foundation.h>
#import "SpringInjectedParameter.h"
#import "TyphoonInjectedParameter.h"

@class SpringTypeDescriptor;
@class TyphoonTypeDescriptor;


@interface SpringParameterInjectedByValue : NSObject <SpringInjectedParameter>
@interface TyphoonParameterInjectedByValue : NSObject <TyphoonInjectedParameter>
{
__unsafe_unretained SpringComponentInitializer* _initializer;
__unsafe_unretained TyphoonComponentInitializer* _initializer;
}

@property(nonatomic, readonly) NSUInteger index;
@property(nonatomic, readonly) SpringParameterInjectionType type;
@property(nonatomic, readonly) TyphoonParameterInjectionType type;
@property(nonatomic, strong, readonly) NSString* value;
@property(nonatomic, strong, readonly) id classOrProtocol;

Expand All @@ -35,6 +35,6 @@
* - classOrProtocol is set
* - The parameter is an object type. (If the parameter is an object type, classOrProtocol must be set explicitly).
*/
- (SpringTypeDescriptor*)resolveTypeWith:(id)classOrInstance;
- (TyphoonTypeDescriptor*)resolveTypeWith:(id)classOrInstance;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@


#import <objc/runtime.h>
#import "SpringParameterInjectedByValue.h"
#import "SpringComponentInitializer.h"
#import "SpringTypeDescriptor.h"
#import "SpringIntrospectionUtils.h"
#import "TyphoonParameterInjectedByValue.h"
#import "TyphoonComponentInitializer.h"
#import "TyphoonTypeDescriptor.h"
#import "TyphoonIntrospectionUtils.h"


@implementation SpringParameterInjectedByValue
@implementation TyphoonParameterInjectedByValue

/* ============================================================ Initializers ============================================================ */
- (id)initWithIndex:(NSUInteger)index value:(NSString*)value classOrProtocol:(id)classOrProtocol
Expand All @@ -33,7 +33,7 @@ - (id)initWithIndex:(NSUInteger)index value:(NSString*)value classOrProtocol:(id
}

/* ========================================================== Interface Methods ========================================================= */
- (SpringTypeDescriptor*)resolveTypeWith:(id)classOrInstance
- (TyphoonTypeDescriptor*)resolveTypeWith:(id)classOrInstance
{
if (_classOrProtocol)
{
Expand All @@ -49,25 +49,25 @@ - (SpringTypeDescriptor*)resolveTypeWith:(id)classOrInstance
{
clazz = [classOrInstance class];
}
NSArray* typeCodes = [SpringIntrospectionUtils typeCodesForSelector:_initializer.selector ofClass:clazz isClassMethod:isClass];
NSArray* typeCodes = [TyphoonIntrospectionUtils typeCodesForSelector:_initializer.selector ofClass:clazz isClassMethod:isClass];

if ([[typeCodes objectAtIndex:_index] isEqualToString:@"@"])
{
[NSException raise:NSInvalidArgumentException
format:@"Unless the type is primitive (int, BOOL, etc), initializer injection requires the required class to be specified. Eg: <argument parameterName=\"string\" value=\"http://dev.foobar.com/service/\" required-class=\"NSString\" />"];
}
return [SpringTypeDescriptor descriptorWithTypeCode:[typeCodes objectAtIndex:_index]];
return [TyphoonTypeDescriptor descriptorWithTypeCode:[typeCodes objectAtIndex:_index]];

}


/* =========================================================== Protocol Methods ========================================================= */
- (SpringParameterInjectionType)type
- (TyphoonParameterInjectionType)type
{
return SpringParameterInjectedByValueType;
return TyphoonParameterInjectedByValueType;
}

- (void)setInitializer:(SpringComponentInitializer*)initializer
- (void)setInitializer:(TyphoonComponentInitializer*)initializer
{
_initializer = initializer;
}
Expand Down
Loading

0 comments on commit 6f9c409

Please sign in to comment.