This is a mirror of official site: http://jasper-net.blogspot.com/

Common Service Host

| Sunday, June 6, 2010
Quick fact

Common Service Host is a generic Windows Communication Foundation Service Host and factory that uses the Common Service Locator to enable service object creation with any Dependency Inversion framework, like Unity, Spring.Net or StructureMap. This enables WCF services to utilize the strength of Inversion of Control and Life Time Management by a centralized factory.

Why use a Common Service Host for WCF?

There are several advantages in allowing a DI-Framework hook into the creation of service objects. The common denominator being that it will be easier to follow sound Software Craftmanship principles when setting up and maintaining your services. Advantages include:
Coordination of shared dependencies and their life time with a well thought through dependency framework. E.g, built in session / connection-management for PerCall / PerSession WCF instance modes in StructureMap / Unity
Simplify unit-testing of the Service class with the ability to Mock all dependencies.
Easily change or extend dependencies without having to touch the services that rely on them. E.g change a dependency on a repository to use the cached version instead of the DB-Only one, in one single place without the need to touch every service.

Since the Common Service Host (CSH) only have a dependency on the Common Service Locator it allows you as a developer to choose the DI-Framework you like to handle the service resolution. CSH comes with providers for the most popular frameworks but is extreamly easy to extend with others.

Read more: Codeplex

Posted via email from jasper22's posterous

0 comments: