Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6574093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:13:00+00:00 2026-05-25T15:13:00+00:00

Service Locator seems like a pretty useful concept and I’d like to implement it

  • 0

Service Locator seems like a pretty useful concept and I’d like to implement it in my app. However, I have a few questions about how it should be implemented and how it should be used in conjunction with other programming paradigms.

  1. Should the SL manage the service it is storing? That is, when the SL gets destroyed, should it also destroy the service itself, or should it leave that to whoever registered the service?

  2. What about Dependency Injection? Now that I have an SL is there any point in passing the SL around as a parameter or should I access it globally? After all, much of the whole purpose of DI is covered by SL as well, and I wouldn’t like to clutter a lot of my functions with one more parameter.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T15:13:01+00:00Added an answer on May 25, 2026 at 3:13 pm

    You would think I wrote this article (I didn’t), considering how often I refer to it:

    Service Locator is an Anti-Pattern

    Dependency Injection makes your dependencies explicit. Service Location buries them in the implementation, and creates a hard dependency on your locator.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

DISCLAIMER: I know there is debate between DI and service locator patterns. I have
I have a framework with a DDD data layer which uses the service locator
Hey there. After reading here about the Service Locator pattern, it got me thinking
I have a small toolkit which uses Unity DI plus EntLib Service Locator. The
Here is an example email body: Name: Jah Selassie Store Locator: Finland Service Number:
It's just a service locater type of pattern I am trying to implement, where
Service Oriented Architecture seems to be more and more of a hot quote these
Sql Service Broker uses the following heuristic to determine when you have messages in
This seems like basic problem, but I'm struggling with it (maybe because of tiredness).
At first glance, the Service Locator pattern looks the same as the Abstract Factory

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.