Releases: unitycontainer/abstractions
3.1.2.174
3.1.1.172
3.1.0.168
This release
This release adds new features and interfaces.
New features
- IContainerContext - new official UnityContainer face for internal operations
- IRegisterTypeStrategy - new interface allowing strategies to be part of registration and add policies as required.
- SingletonLifetimeManager - new globally unique lifetime manager.
3.0.0.160
This Release
This release has a lot of modifications and breaking changes. The changes are required to enable new features and optimizations.
Breaking changes
-
#6 Finally added built-in, 'fast' mechanism to check if type is registered
bool IsRegistered(...);
(High impact) -
#22 Replaced all references to
NamedTypeBuildKey
withINamedType
. (Low impact) -
#23 Renamed IDependencyResolverPolicy into IResolverPolicy (Affects resolution of overridden dependencies)
-
#27 Merged FactoryDelegateBuildPlanPolicy with InjectionConstructor (Low impact)
-
#30 Added Parent reference to IBuilderContext (New feature)
-
#31 Added return type and extra argument to PreBuildUp and PostBuildUp (High impact for strategy implementations)
2.4.0.150
This Release
This release is primarily addresses extending of strategy chains to support multiple types of strategies. These changes are required to implement custom Property, Method, and Constructor selectors.
Breaking changes
-
#20 A non generic interface
IStagedStrategyChain
has been retired. Generic interfaceIStagedStrategyChain<TStageEnum>
has been modified to accept strategy type argument.StagedStrategyChain
has been modified to allow different strategy types.
In order to iterate through strategies just use IEnumerable<...>. -
#21 IPolicyList no longer accepts
object
as a Build Key. Legacy API was moved to Extension Methods implementation.
Semantic Versioning
This release breaks several interfaces and should have been released as v3.0.0. It has been long weekend of coding... Apologies for the inconvenience.
2.3.0.122
Due to this bug fix sequence of steps during building of objects has changed. Previously strategies were called in this order:
...
TypeMapping,
Lifetime,
PreCreation,
...
Now Lifetime and TypeMapping where reversed and Lifetime is called first. Here is the modified UnityBuildStage
public enum UnityBuildStage
{
/// <summary>
/// First stage. By default, nothing happens here.
/// </summary>
Setup,
/// <summary>
/// Third stage. lifetime managers are checked here,
/// and if they're available the rest of the pipeline is skipped.
/// </summary>
Lifetime,
/// <summary>
/// Second stage. Type mapping occurs here.
/// </summary>
TypeMapping,
/// <summary>
/// Fourth stage. Reflection over constructors, properties, etc. is
/// performed here.
/// </summary>
PreCreation,
/// <summary>
/// Fifth stage. Instance creation happens here.
/// </summary>
Creation,
/// <summary>
/// Sixth stage. Property sets and method injection happens here.
/// </summary>
Initialization,
/// <summary>
/// Seventh and final stage. By default, nothing happens here.
/// </summary>
PostInitialization
}
This change should not affect casual users of the container. Developers of Extensions that rely on this sequence of stages should verify if the change might have broken the extension.
2.2.1.118
Bug fix
Work related to fixing issue described here
Cleanup
Removed
- IDependencyResolverTrackerPolicy
- IBuilderAware
These interfaces alone with its policies were invoked during registration and contributed to slowing down performance. Since it is not being used internally within Unity it was removed to speed up performance.
2.2.0.102
New Features:
New InjectionConstructor(params Type[] types)
Injection constructor could be specified by providing either arguments or types of arguments of the constructor:
Select default constructor:
container.RegisterType<SomeType>(new InjectionConstructor());
Select constructor with SomeType(int, string, float) signature and provide values:
container.RegisterType<SomeType>(new InjectionConstructor(0, string.Empty, 0.0f));
Select constructor with SomeType(string, string, string) signature and provide values for last two:
container.RegisterType<SomeType>(
new InjectionConstructor(
new ResolvedParameter(typeof(string)), string.Empty, string.Empty)));
Select constructor with SomeType(string, string, IUnityContainer) signature and provide values for last two:
container.RegisterType<SomeType>(
new InjectionConstructor(new Type[] { typeof(string), typeof(string), typeof(IUnityContainer) })));
Note: This change could be breaking and affect selection of a constructor with all parameters of type Type: Constructor(Type type1, Type type2)
Changes to HierarchicalLifetimeManager
Class HierarchicalLifetimeManager
now implements IHierarchicalLifetimePolicy
interface.
This interface adds method CrateScope()
and allows registration of hierarchical lifetime managers with child containers.
RegisterSingleton<>()
Added lineup of extension methods for registering Singletons
2.1.0.82
Due to changes in IPolicyList interface and possible breaking changes for extensions, minor version has been increased.
This and other changes are required to support new development. One of the main goals to enable support for Microsoft.Extensions.DependencyInjection.