The Simple Service Locator is an easy-to-use Inversion of Control library that is a complete implementation of the Common Service Locator interface. It solely supports code-based configuration and is an ideal starting point for developers unfamiliar with larger IoC / DI librariesNew features in this release
- New Register<TService, TImplementation>() and RegisterSingle<TService, TImplementation>() methods added to allow simplified registration for very common scenario's (work item 15224).
- The Simple Service Locator is now able to detect cyclic dependency graphs and throws a useful error message when one found (work item 15371).
- Significant performance improvements by many performance tweaks and a total internal redesign. The performance cost is now almost reduced to a no-op. (work item 15223).
- Automatic constructor injection failed on types that had an IEnumerable<T> argument that was not registered.
- Resolving of unregistered types did not work correctly when used through automatic constructor injection, which is expected to be the default scenario (work item 15163).
- GetAllInstances<T> directly returned the collection that was registered using one of the RegisterAll<T> overloads. This allowed users to change the values after casting back to the original collection, which is definitely a bad thing, because this would allow users to change global application state. Mutable collection types are now wrapped in an enumerator to make them immutable.
- Removed the inheritance relationship between the SimpleServiceLocator class and the ServiceLocatorImplBase class that was supplied by the Common Service Locator (CSL) library. The use of the base class complicated the code, impacted performance negatively, and forced the container to break the contract of the System.IServiceProvider interface. The SimpleServiceLocator class now simply implements CSL's IServiceLocator interface. This change is a breaking change, but only users that inherit from the SimpleServiceLocator class will be affected, which would be an uncommon scenario.
- The Validate method replaced with new method called Verify and Validate was made obsolete. Validate will be removed in a later release. Verify better describes the intent of the method. The behavior stays the same.
This is will be the last beta release. Beta means that we think you can use the library in your production environment, but future versions may have breaking changes. The Simple Service Locator project is still in development and we like your feedback.