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

  • SEARCH
  • Home
  • 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 8156881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:05:33+00:00 2026-06-06T17:05:33+00:00

We have a large solution (> 100 projects) and almost every type uses either

  • 0

We have a large solution (> 100 projects) and almost every type uses either a service locator (example 1) or our own dictionary of types (example 2) for instantiation.

For example we have:

IQuote quote = Registry.Resolve<IQuote>(); 

or

IQuote quote = Registry.Find<IQuote>(args);

The 2nd example goes off to the config file to find what concrete object to instantiate using reflection.

It makes life more difficult when following through code – because it’s not clear what concrete type is being used – so we have to check the mappings many times as we’re trying to learn a part of the code. Using the above as an example pressing F12 on: quote.DoSomething() would take you to the interface definition.

It’s also a bit more difficult to implement – we need an interface + concrete class + config mappings, when the alternative is just 1 class.

Come to think of it – I’m not aware that anything has ever been “swapped out” for another type – so although we’ve implemented IoC we haven’t used it, or at least – very little.

So – is it actually worth it? Have we implemented it incorrectly / too much? Am I misunderstanding something?

  • 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-06-06T17:05:34+00:00Added an answer on June 6, 2026 at 5:05 pm

    In my opinion, you don’t need to work with each and every class with DI in mind. I would use the following strategy:

    1. Determine the module bounds.
    2. Within the same module, use concrete classes where possible.
    3. For the intermodule communication, use DI where possible.

    The modules should be relatively fine-grained.

    There are some common places where you need to use DI, often it’s replaceable data sources and (not so often) algorithms. Use the common sense to check whether something needs to be replaceable or not. Don’t hesitate to throw in an early refactoring if you see something needs DI or suffers from it.

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

Sidebar

Related Questions

We have a large Visual Studio 2005 C++/Mfc solution, 1 project with around 1300
We have built a large database model (SQL Server) for our client and an
My DB is SQL SERVER 2008 I have a large table with 100 million
We have large (100,000+ elements) ordered vectors of structs (operator < overloaded to provide
I have a large set (around 100) of page elements that I would like
I have a large table with 27 columns and between 5 to 100 rows.
I'm struggling to find a suitable solution to this. I have a fairly large
I have large images displayed in a grouped tableview. I would like the images
I have large database table, approximately 5GB, now I wan to getCurrentSnapshot of Database
I have large video files (~100GB) that are local on my machine. I have

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.