objection is a lightweight dependency injection framework Guice Inspired by the project is the use of Google Wallet. 'Dependency injection' is an object-oriented programming design patterns to reduce the degree New Basketball Shoes of coupling between codes. Usually based interface to achieve, that is to say do not need a new object, but to obtain objects associated controller. 2013 hottest laravel PHP framework is one of Black / Red / Yellow ??Red?? Nike Air Foamposite One Sale Online the typical. Suppose you Black Grey Pink Nike Hyperdunk 2013 Outlet have the following scenario: ViewControllerA.view there is Air Max 2012 Yellow Black Grey a button, then click push a ViewControllerB, simple wording like this: - (void) viewDidLoad {[super viewDidLoad]; UIButton * button = [UIButton buttonWithType: UIButtonTypeSystem]; button. frame = CGRectMake (100, 100, 100, 30);;; [self.view addSubview: button];} - (void) buttonTapped {ViewControllerB * vc = [[ViewControllerB alloc] init]; [self.navigationController pushViewController: vc animated: YES];} This question is written, ViewControllerA need import ViewControllerB, which is dependent on ViewControllerB produce. Dependent things, the more trouble to maintain them, circular dependency problems are likely to arise, and objection can just deal with these problems. Implementation is: to define a protocol (protocol), and then register the corresponding class of this agreement by objection, when needed, you can obtain the agreement Black Red Women Air Jordan 6 VI High Heels Sale corresponding object. For consumers do not care about in the end use of which Class, anyway that some methods, properties have a (specified in the agreement). In addition to this dependence on a particular went to the Class. Also known as the 'interface-oriented programming.' JSObjectionInjector * injector = [JSObjection defaultInjector]; // [1] Nike Air Max UIViewController \u0026 lt; ViewControllerAProtocol \u0026 gt; * vc = [injector getObject:protocol (ViewControllerAProtocol)]; // Jordan CP3 VI [2] vc.backgroundColor = [UIColor lightGrayColor]; // [ 3] UINavigationController * nc = [[UINavigationController alloc] initWithRootViewController: vc]; self.window.rootViewController = nc; [1] to get the default injector, the injector already registered ViewControllerAProtocol up. [2] Get ViewControllerAProtocol Black Grey Pink Nike Hyperdunk 2013 Outlet corresponding Object. [3] get the VC, set some of its attributes, such as where the backgroundColor, because in ViewControllerAProtocol has defined this property, so there is no warning. You can see that there is no Air Jordan Outlet reference ViewControllerA. Let's look at how this ViewControllerAProtocol is registered to the injector, here related to Nike 6.0 Mavrk Mid 2 Skate Shoes Red Black the Module, complete the registration of the Protocol are in the Module. Module can be as long as inheritance JSObjectionModule this Class. interface ViewControllerAModule: JSObjectionModule @ end @ implementation ViewControllerAModule- (void) configure {[self bindClass: [ViewControllerA class] toProtocol:protocol (ViewControllerAProtocol)];} Air Max 2012 Womens Navy Blue White @ end binding operation is carried out in the configure method, this method It will be automatically triggered when it is added to the injector in. JSObjectionInjector * injector = [JSObjection defaultInjector]; // [1] Nike Heels Boots Black Grey Blue Nike Air LeBron E.E. 2013 Online injector = injector:? [JSObjection createInjector]; // [2] injector = [injector withModule: [[ViewControllerAModule alloc] init]]; // [3] [ JSObjection setDefaultInjector: injector]; // [4] [1] to get the default injector [2] If the default injector does not exist, create a [3] to the injector registered in our Module 2015 Nike Free 5.0 [4] The injector is set as the default The injector code directly into the + (void) load in execution, this can be avoided in AppDelegate in import all kinds Air Max 2012 Womens Navy Blue White Module. Because we can not get a direct counterpart Class, it is necessary to define the methods and properties of foreign exposure in good agreement, and then the Class must implement the agreement. protocol ViewControllerAProtocol \u0026 lt; NSObject \u0026 gt;property (nonatomic) NSUInteger currentIndex;property (nonatomic) UIColor * backgroundColor; @ end @ interface ViewControllerA: UIViewController \u0026 lt; ViewControllerAProtocol \u0026 gt;end by objection after dependency injection, we can better achieve SRP (Single Responsibility Principle), the code is more concise, and I feel more comfortable, better life. Take Pinterest, the following pages can be divided into three Section. Each Section may be responsible for different people, then string together on the line, but also to a certain extent to avoid MVC (Mess View Controller) appear. Overall, this was quite tricky lib, it has been maintained for over two years, there are some items in use, to improve the efficiency of the development of the members will have a lot of help, you can consider the next attempt. Wallpaper demo, https: //github.com/lzyy/bizhiobjection to the use of modular development iOS project