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?

 

What is the rationale for this project Project Rationale
Show me some sample code: Documentation
What does the API look like? API Reference
How do I implement the API? Consuming the interfaces
Questions & Answers regarding location and configuration options for services. Q & A

 

Service manager adapter implementations

Implementation By
Unity Adapter Magnus Mårtensson
Your adapter goes here... se also Contributing

Collaborators in alphabetical order

Right now this is a project created by Magnus Mårtensson (noopman/@noopman)  
Your name goes here Your flare goes here

Last edited Apr 8, 2011 at 7:32 PM by NoopMan, version 20