Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

343 Commits

Repository files navigation

Overview

The Unity Container (Unity) is a full featured, extensible dependency injection container. It facilitates building loosely coupled applications and provides developers with the following advantages:

  • Simplified object creation, especially for hierarchical object structures and dependencies
  • Abstraction of requirements; this allows developers to specify dependencies at run time or in configuration and simplify management of crosscutting concerns
  • Increased flexibility by deferring component configuration to the container
  • Service location capability; this allows clients to store or cache the container
  • Instance and type interception
  • Registration by convention

Installation

Install Unity with the following command:

Install-Package Unity

Unity 5.x loosely follows Semantic Versioning — minor releases may introduce breaking changes. Floating version references should lock in the minor version in addition to the major version:

<PackageReference Include="Unity.Container" Version="5.9.*" />

The documentation is a work in progress. Some info is available here but more is coming... Feel free to open issues in Documentation project with all the questions you would like to be covered or questions you might have.

Performance Stats for v5.9.0

This release is all about optimizing performance. These are the latest benchmarks:

BenchmarkDotNet=v0.11.3, OS=Windows 10.0.17134.523 (1803/April2018Update/Redstone4)
Intel Core i7-6700K CPU 4.00GHz (Skylake), 1 CPU, 8 logical and 4 physical cores
Frequency=3914058 Hz, Resolution=255.4893 ns, Timer=TSC
[Host] : .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0
Job-NIEANE : .NET Framework 4.7.2 (CLR 4.0.30319.42000), 64bit RyuJIT-v4.7.3260.0
InvocationCount=100000 LaunchCount=1 RunStrategy=Throughput 
MethodVersionMeanErrorStdDev
Singleton4.0.1455.53 ns4.3610 ns4.0793 ns
Singleton5.8.13127.87 ns0.9838 ns0.9203 ns
Singleton5.9.076.19 ns0.8752 ns0.8187 ns
Unregistered4.0.1893.14 ns3.9070 ns3.6546 ns
Unregistered5.8.13128.18 ns1.2329 ns1.1532 ns
Unregistered5.9.088.37 ns0.8162 ns0.7635 ns
Transient4.0.1906.03 ns4.0031 ns3.5487 ns
Transient5.8.13143.36 ns1.7001 ns1.5071 ns
Transient5.9.096.90 ns1.3002 ns1.1526 ns
Mapping4.0.1776.70 ns2.3000 ns2.1514 ns
Mapping5.8.13141.33 ns1.4194 ns1.3278 ns
Mapping5.9.0122.58 ns2.4451 ns2.4014 ns
Array4.0.18,725.32 ns36.1246 ns33.7909 ns
Array5.8.13642.21 ns4.4079 ns3.9075 ns
Array5.9.0605.97 ns5.6593 ns5.2937 ns
Enumerable4.0.1NANANA
Enumerable5.8.13739.89 ns3.5254 ns3.2977 ns
Enumerable5.9.0669.90 ns5.6207 ns4.6935 ns

New Features

Suggest new features or vote for the proposals you like, ADD your comments:

Feature Requests

Packages & Status

Unity library consists of multiple packages. For information about each package please follow the links


PackageBuild statusNuGet
Unity (Composite)Build statusNuGet
Unity.AbstractionsBuild statusNuGet
Unity.ContainerBuild statusNuGet
Unity.ConfigurationBuild statusNuGet
Unity.InterceptionBuild statusNuGet
Unity.Interception.ConfigurationBuild statusNuGet
Unity.RegistrationByConventionBuild statusNuGet
Unity.log4netBuild statusNuGet
Unity.NLogBuild statusNuGet
Unity.Microsoft.LoggingBuild statusNuGet
Unity.Microsoft.DependencyInjectionBuild statusNuGet
Unity.AspNet.WebApiBuild statusNuGet
Unity.MvcBuild statusNuGet
Unity.ServiceLocationBuild statusNuGet
CommonServiceLocatorBuild statusNuGet

Roadmap

Version 4.x is dead. Loss of original signing certificate made it impossible to release anything compatible with v4.0.1 release. To give original developers a credit only about 60 issues were found during two years in production. To move on and enable further development version v5 has been created.

Version 5.x is created as replacement for v4.0.1. Assemblies and namespaces are renamed and refactored but otherwise it is compatible with the original. v5.0.0 release fixes most of the issues found in v4.0.1 and implements several optimizations but the emphasis is on compatibility. Once stabilized, this version will enter LTS status and will be patched and fixed for the next few years. v5 minor releases may contain breaking changes, in preparation for v6. There will be no significant development in this line.

To build v5.x locally please follow these steps:

  • git clone https://github.com/unitycontainer/unity.git
  • cd unity && git checkout v5.x && git submodule update --init --recursive
  • open package.sln in Visual Studio and build.

This is where all new development will be done. The compatibility would not be a driving factor so better performance and functionality could be achieved.

To build v6.x locally please follow these steps:

  • git clone https://github.com/unitycontainer/unity.git
  • cd unity && git checkout v6.x && git submodule update --init --recursive
  • open package.sln in Visual Studio and build.

Release schedule and Long Time Support (LTS) 1

ReleaseLTS StatusActive LTS StartMaintenance StartMaintenance End
v3.xNo LTS--2012
v4.xEnd-of-Life--2015
v5.xActive2018-10-18March 2018December 2019
[6.x]Pending2019-01-01January 2019
  • 1: All scheduled dates are subject to change.

Issues and Contributions

  • If something is broken and you know how to fix it, send a pull request.
  • If you have no idea what is wrong, create an issue

Any feedback and contributions are welcome

If you have something you'd like to improve do not hesitate to send a Pull Request

About

This repository contains development environment for the entire package. We welcome contributions!

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors