Is the Common Service Locator widely used?
Asked Answered
C

1

9

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.

Cristicristian answered 7/2, 2010 at 19:42 Comment(0)
G
7

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.

Granophyre answered 8/2, 2010 at 10:19 Comment(1)
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.Cristicristian

© 2022 - 2024 — McMap. All rights reserved.