tags:

views:

33

answers:

2

Hi, I am working on this application for which we have to write framework services like reporting, logging, exception handling, security. Since these services are are to be used through the project, i am thinking of exposing the instances of these services through a service container which has reference to the objects of these individual services. Although i can somehow write it but i want to do it in a good design-pattern oriented way.

How to go about solving this problem? Any reference to where this problem has already been tackled with.

Thanks

Edit: I was reading some thing about service layers. Doesn't it have to do something with facade pattern??I dont know....

+1  A: 

Check MEF (.NET 4.0) to construct an application from different assemblies. What you look for is an IOC system that does dependency injection. I build a larger application from a "Server core" and "Services" that get loaded in.

TomTom
Hey TomTome, I was wondering if we could write services using a facade pattern..
wanderer
A: 

I use Unity (IOC container) for Inversion of Control (aka Dependency Injection, DI). Another popular one is Structure Map.

This allows you to build services using Interfaces and letting the IOC Container handle concrete implementations.

If you are talking physical seperation of services you might want to look into WCF

Bryce Fischer
well.i dont want to use another framework. I have write my own implementation (due to some reasons). Do we have a working sample somewhere showing the architecture/pattern?
wanderer
Basic IOC is easy to implement. Here's an article I used in the past to implement it http://ayende.com/Blog/archive/2007/10/20/Building-an-IoC-container-in-15-lines-of-code.aspx .
Bryce Fischer