A extremely fast ioc container for high performance applications
Branch: develop
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Duality
Scripts
Singularity.Benchmark
Singularity
Tests
.gitattributes
.gitignore
CI_script.ps1
GitVersion.yml
Icon.png
LICENSE
README.md
ReleaseNotes.md
Singularity.Test.coverage.xml
Singularity.sln
Singularity.sln.DotSettings
appveyor.yml
codecov.yml

README.md

Singularity

Singularity is a ioc container that focuses on the following things

  • Very high performance. The first time you use a dependency it will be compiled to a delegate and cached in a dictionary. When that dependency is requested again all it then retrieves the delegate from the dictionary and invokes it. This means that performance in Singularity is measured in nanoseconds as opposed to microseconds like in other containers. This makes it feasible to use singularity in applications where performance matters such as games.
  • No magic. Singularity has been designed in such a way that it won't hide too much from you. For instance Dispose wont be automagically called but instead you can configure Singularity to do so through the OnDeath method. This way you can always find out who is calling your methods.
  • Clear error messages and fail fast to point you in the right direction as fast as possible.

Getting started

Installation

Singularity can be installed through nuget. The packages that are available can be found in the nuget section

A simple example

Its easy to setup a container and request a instance:

var config = new BindingConfig();
config.For<ITestService10>().Inject<TestService10>();

var container = new Container(config);

var value = container.GetInstance<ITestService10>();

However Singularity can do much more than this simple example

Documentation

More info about Singularity can be found on the wiki. I suggest you to start here.

For duality users there is also a guide on how to use Singularity.Duality in duality here.

Other

Build status

Branch Status Coverage
master Build status codecov
develop Build status codecov

Nuget

Library Version
Singularity NuGet Badge
Singularity.Duality.core NuGet Badge