Project Description
The My.Ioc is an easy-to-use, fast, extensible and capable IoC/DI container written in .NET. It distinguish itself by providing features that are not supported by other containers, such as unregistration, observers, etc. Its hope is to help programmers writing
loosely-coupled, highly-cohesive applications in a flexible manner. Using My.Ioc, your code will become easier to write, reuse, test, and modify.
Features
- Fluent API
- Constructor, property and method injection
- Multiple registrations for single contract
- Lazy registration
- Extensible
- Metadata support
- Conditional/contextual binding
- Unregistration support
- Auto registration with policy
- Observer mechanism to listen for object registration/unregistration
- Open-generics resolution
- Custom lifetime control
- .Net 2.0 support
Sample Projects
- SimpleSample: A simple example to demonstrate how to use the My.Ioc.
- TreeBuilder: Use conditional binding and metadata support to build an addin tree.
- ServiceUnregisterAndUpdate: To show how to unregister and update services.
- ObserverUsage: Use observers to make your application more responsive.
- LazyRegistration: How to implement lazy registration.
- UnregisteredConcreteTypeResolution: Resolve unregistered concrete type.
- ConstructorSelectAndParameterOverride: Use default parameters and overridden parameters.
- PropertyAndMethodInjection: Implement method injection and property injection.
- OpenGenericResolution: Resolve open generics.
- LifetimeAndLifetimeScope: Basic usage of Lifetime and ILifetimeScope.
- ImplementDecorator: How to extend My.Ioc to support decorator.
- HowToAvoidCyclicDependency: Avoid cases that cause the cyclic dependency.
- GetNotificationOfRegistrationAndUnregistration: Know about the registration changes.
Performance
A performance test project is included in the package, run the project to get the performance profile yourself.