SwinjectSimpleExample - A simple example to use Swinject with unit tests

  •        24

This is an example project to demonstrate dependency injection and Swinject in a simple weather app that lists current weather information at some locations. The following blog posts demonstrate step-by-step development of the project introducing dependency injection and Swinject.

https://github.com/Swinject/SwinjectSimpleExample

Tags
Implementation
License
Platform

   




Related Projects

Swinject - Dependency injection framework for Swift with iOS/macOS/Linux

  •    Swift

Swinject is a lightweight dependency injection framework for Swift. Dependency injection (DI) is a software design pattern that implements Inversion of Control (IoC) for resolving dependencies. In the pattern, Swinject helps your app split into loosely-coupled components, which can be developed, tested and maintained more easily. Swinject is powered by the Swift generic type system and first class functions to define dependencies of your app simply and fluently.

SwinjectMVVMExample - An example to use Swinject in MVVM architecture with ReactiveCococa

  •    Swift

This is an example project to demonstrate dependency injection and Swinject in MVVM (Model-View-ViewModel) architecture with ReactiveCocoa. The app asynchronously searches, downloads and displays images obtained from Pixabay via its API. The following blog posts demonstrate step-by-step development of the project.

InjectionIII - Re-write of Injection for Xcode in (mostly) Swift4

  •    Objective-C

This start-over implementation on Injection for Xcode has been built into an app: InjectionIII.app included in the repo which runs in the status bar. Code injection allows you to update the implementation of methods of a class incrementally in the iOS simulator without having to rebuild or restart your application saving developer time. You can avoid the complications of code signing by using the pre-built binary which is available to download here. For some reason you may need to take the app out of qurantine manually or it will report it as damaged when you run it: xattr -d com.apple.quarantine ~/Downloads/InjectionIII.app. To use, copy/link it to /Applications and run the app. Injection also expects to find your current Xcode at path /Appplications/Xcode.app. Injection no longer requires you to change your project as for iOS is always available if you use the "Start Injection" menu (or type control-=) each time you start your app. Once injection is connected, a file watcher is started in the InjectionIII app and whenever you save a Swift or Objective-C source the target app is messaged to update the implementation. The file watcher can be disabled & enabled while the app is running using the status bar menu. If you inject a subclass of XCTest it will try running that individual test inside your application. When you run your application without rebuilding (^⌘R), recent injections will be re-applied.

Typhoon - Powerful dependency injection for iOS & OSX (Objective-C & Swift)

  •    Objective-C

Powerful dependency injection for Cocoa and CocoaTouch. Lightweight, yet full-featured and super-easy to use. Visit the Typhoon website for an introduction. There's also a nice intro over at Big Nerd Ranch, or here's an article, by John Reid. Quite a few books have been written on the topic, though we're not familiar with one that focuses specifically on Objective-C, Swift or Cocoa yet.


injection-js - Dependency injection library for JavaScript and TypeScript in 5

  •    TypeScript

Dependency injection library for JavaScript and TypeScript in 5.2K. It is an extraction of the Angular's dependency injection which means that it's feature complete, fast, reliable and well tested.Up-to-date with Angular 4.1.

HK2 - A light-weight and dynamic dependency injection framework

  •    Java

HK2 is a light-weight and dynamic dependency injection framework. HK2 is an implementation of JSR-330 in a JavaSE environment. JSR-330 defines services and injection points that can be dynamically discovered at runtime and which allow for Inversion of Control (IoC) and dependency injection (DI).

Aura.Di - Dependency Injection System

  •    PHP

A serializable dependency injection container with constructor and setter injection, interface and trait awareness, configuration inheritance, and much more. This package is installable and PSR-4 autoloadable via Composer as aura/di.

typedi - Simple yet powerful dependency injection tool for JavaScript and TypeScript.

  •    TypeScript

TypeDI is a dependency injection tool for JavaScript and TypeScript. Using TypeDI you can build well-structured and easily tested applications. Then you can call Container.get(SomeClass) from anywhere in your application and you'll always have the same instance of SomeClass.

objection - A lightweight dependency injection framework for Objective-C

  •    Objective-C

Objection is a lightweight dependency injection framework for Objective-C for MacOS X and iOS. For those of you that have used Guice, Objection will feel familiar. Objection was built to stay out of your way and alleviate the need to maintain a large XML container or manually construct objects. A class can be registered with objection using the macros objection_register (optional) or objection_register_singleton. The objection_requires macro can be used to declare what dependencies objection should provide to all instances it creates of that class. objection_requires can be used safely with inheritance.

countries - An example Android app using Retrofit, Realm, Parceler, Dagger and the MVVM pattern with the data binding lib

  •    Kotlin

A sample Android app written in Kotlin, which lists all countries with some additional information (currencies, languages, …). The app uses the MVVM pattern with the Android data binding lib. Countries can be bookmarked and are then stored locally with Realm. Retrofit is used to fetch the country information from the free REST Countries service. For JSON parsing, custom Gson TypeAdapters are used. PaperParcel is used to make the Country objects Parcelable. Also, Dagger 2 is used for dependency injection. This project can also be used as a template for new apps. Check out the template branch for a cleaned up version of this project.

XNA and Dependency Injection

  •    

This project includes complete code sample for XNA and Dependency Injection post

KandaAlpha DDD Architecture - MVC, Dependency Injection, Repository and db4o

  •    

A vs.net 2010 beta 1 solution which provides a sample domain drive design architecture separated into Presentation, Application, Domain and Infrastructure layers. Technologies in use are visual studio 2010 beta ASP.Net MVC 1.0, Entity Framework 4.0 and db4o.

node-di - Dependency Injection framework for Node.js

  •    CoffeeScript

I don't actively maintain this project, in favor of angular/di, which is heavily influenced by node-di and thus the migration should be easy. Eventually angular/di will be published to NPM as di@2.0. There are two things - Dependency Injection pattern (aka Inversion of Control) and Dependency Injection framework.

Pimple - A small PHP 5.3 dependency injection container

  •    PHP

This is the documentation for Pimple 3.x. If you are using Pimple 1.x, read the Pimple 1.x documentation. Reading the Pimple 1.x code is also a good way to learn more about how to create a simple Dependency Injection Container (recent versions of Pimple are more focused on performance). Pimple is a small Dependency Injection Container for PHP.

koin - KOIN - a pragmatic lightweight dependency injection framework for Kotlin

  •    Kotlin

A pragmatic lightweight dependency injection framework for Kotlin developers. Written in pure Kotlin, using functional resolution only: no proxy, no code generation, no reflection.

koin - KOIN - a pragmatic lightweight dependency injection framework for Kotlin

  •    Kotlin

A pragmatic lightweight dependency injection framework for Kotlin developers. Written in pure Kotlin, using functional resolution only: no proxy, no code generation, no reflection.

ios-project-env-setup - Setup your iOS project environment with a Shellscript, Makefile or Rakefile

  •    Swift

Nowadays an iOS project is more than only a *.xcodeproj file with some self-written Objective-C or Swift files. We have a lot of direct and indirect external dependencies in our projects and each new developer on the project or the build server have to get these. Developers need these before working on the app and the build server to build and deploy the app. Code: Because we don’t want reinvent the wheel for parts of our apps again and again, we use third-party libraries for common use cases. E.g. we use Alamofire for our network stack. Also, we want use the latest and hopefully greatest version of each dependency, to get the newest features and especially critical bug fixes almost automatically. To reach this goal you should use a dependency manager, which cares about these problems. The principle „never change a running“ system should not apply to third-party dependencies. Especially if these are responsible for critical parts of the app, like encryption.

Mugen Injection

  •    CSharp

A lightweight and fast managed IoC (Inversion of Control) and DI (Dependency Injection) with support for constructor, property, field, and method call injection

Dependency Injection Service Provider (DISP)

  •    

Dependency Injection Service Provider (DISP) is a wrapper or an interface that aim to allow .NET developers use one of the inversion of control (IoC) containers out there such as StructureMap or Ninject from a high level of abstraction, using the same interface and classes wi...