Welcome to the Common Service Manager library
The Common Service Manager library contains shared interfaces for service management which application and framework developers can reference. The library provides an abstraction over IoC containers for the purpose of configuring and
locating services.
How does this compare to the Common Service Locator?
This project derives from the great work that is the
Common Service Locator created by several truly gifted masters of our domain. This Common Service Manager adds the second half - configuration - to the story of IoC abstraction to bring the great initiative of the SCL full circle. This library provides
abstractions for the API for
configuring a service container as well as for
locating services. This project contains the code of the CSL and extends it. For more information please see the
Project Rationale.
First page view of what this is:
Locating an instance of a service through an IoC container is the easy part. Configuring that same container to know where your service is implemented is the tricky part. This is what your configuration code will look like using this library. Service Location
will look like the CSL and your code will have no knowledge of any specific underlying IoC container (see further
Project Rationale and
Q & A). Oh and don’t be daunted by the lambda expressions below; they are there to ensure
type safety in your configuration code which is an incredibly powerful concept.
ServiceConfigurator.RegisterType<IFoo, Foo>()
.InjectionConstructor(() => new Foo())
.InjectionProperties(f => f.Bar, f => f.Baz)
.AsSingleton();
Using this fluent interface line of code you will tell your IoC container that when ever IFoo is requested through the Service Locator the type Foo is instantiated and returned. Foo is a class which uses the default constructor, has properties Bar and Baz
which are supposed to be Dependency Injected and it is to be treated as a Singleton once it’s been created.
Where to go next?
Service manager adapter implementations
Collaborators in alphabetical order