views:

269

answers:

1

I'm working on a new project now, and have given some thought to the IoC setup. I'm aware that you shouldn't be depending on the service location pattern (much, anyway), but that there are just a few places in a well-structured application where it may be necessary. In that case, do you use the CommonServiceLocator project, or not bother with it?

I'm essentially looking for feedback on whether the CSL is used at all, or how widely it is used.

+2  A: 

Going purely on the number of recorded downloads here: Common Service Locator Downloads it looks like it has a very small number of users for a general purpose library.

It provides a level of indirection between client code and its service locator. The deal is that you sacrifice access to the APIs of your chosen IoC framework in return for portability across IoC frameworks. Unless your code needs to support multiple service locators, then it doesn't really help you. See: When would you use the Common Service Locator.

Version 1.0 looks like a very basic factory pattern implementation, so it's probably not worth worrying about too much either way.

richj
I wondered about the low download count, and thought to see if there was any direct usage among this programming group. The sole response - yours - confirms my suspicion.The provision that the CSL is best used in distributable libraries makes sense, but not so much in a full application. So I'll just settle on a library and get on with the project.
Grant Palin