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 954341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T00:12:04+00:00 2026-05-16T00:12:04+00:00

Though DI in interface driven…I am still not clear as to what exactly differentiates

  • 0

Though DI in interface driven…I am still not clear as to what exactly differentiates this from basic overloading concept. Any C# examples would be helpful.

EDIT : I read here the reason for my question
that StreamReader can be seen as example of IoC/DI…how is this different totally from overloading? Or is it just semblance to DI and not entirely DI?

  • 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-16T00:12:05+00:00Added an answer on May 16, 2026 at 12:12 am

    They’re completely different concepts.

    Overloading: providing multiples methods with the same name (or constructors) that differ by the number and/or type of parameters.

    Dependency Injection: giving components all the services they need to work with (e.g. authenticators, database connections etc) rather than letting them construct these dependencies themselves. DI encourages a clean separation between interfaces and implementation, and makes unit testing much easier (as you can mock/fake dependencies).

    EDIT: I don’t think I’d usually use StreamReader as a good example of dependency injection – in particular, it can create its own streams for you if you only specify a filename. Arguably the overloads with a Stream parameter are effectively allowing the stream dependency to be injected, but it’s not what I’d normally consider as DI. The constructor is certainly an example of overloading – but the two are really unrelated.

    Normally I’d think of DI in terms of services – things like authenticators, or potentially the next service in a chain (where a request goes through multiple stages, for example).

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

Sidebar

Related Questions

all the D3D interfaces are derived from COM's IUnknown interface, so I though I'd
I was going through the AR query interface guide and from it I got
I have a Python-driven web interface powered by Apache 2.2 with mod_python and Python
I am developing an interface-driven serialization framework for use with interfaces for data XML
Through Interface Builder I have the ability to change the Identifier of a UIBarButtonItem
I ran an update statement on a large PostgreSQL table through the phpPgAdmin interface.
Through the github web interface I created a new repository. I forgot to chose
We typically interface with a RDBMS through SQL. I.e. we create a sql string
I'm learning about interface properties and ran into something that I thought should work
I have some problems sending mails through SMTP using Spring's MailSender interface and the

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.