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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:34:12+00:00 2026-05-30T22:34:12+00:00

(Related to this question, EF4: Why does proxy creation have to be enabled when

  • 0

(Related to this question, EF4: Why does proxy creation have to be enabled when lazy loading is enabled?).

I’m new to DI, so bear with me. I understand that the container is in charge of instantiating all of my registered types but in order to do so it requires a reference to all of the DLLs in my solution and their references.

If I weren’t using a DI container, I wouldn’t have to reference the EntityFramework library in my MVC3 app, only my business layer, which would reference my DAL/Repo layer.

I know that at the end of the day all DLLs are included in the bin folder but my problem is having to reference it explicitly via “add reference” in VS in order to be able to publish a WAP with all necessary files.

  • 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-30T22:34:13+00:00Added an answer on May 30, 2026 at 10:34 pm

    If I wasn’t using a DI container, I wouldn’t have to reference EntityFramework library in my MVC3 app, only my business layer which would reference my DAL/Repo layer.

    Yes, that’s exactly the situation DI works so hard to avoid 🙂

    With tightly coupled code, each library may only have a few references, but these again have other references, creating a deep graph of dependencies, like this:

    Deep Graph

    Because the dependency graph is deep, it means that most libraries drag along a lot of other dependencies – e.g. in the diagram, Library C drags along Library H, Library E, Library J, Library M, Library K and Library N. This makes it harder to reuse each library independently from the rest – for example in unit testing.

    However, in a loosely coupled application, by moving all the references to the Composition Root, the dependency graph is severely flattened:

    Shallow Graph

    As illustrated by the green color, it’s now possible to reuse Library C without dragging along any unwanted dependencies.

    However, all that said, with many DI Containers, you don’t have to add hard references to all required libraries. Instead, you can use late binding either in the form of convention-based assembly-scanning (preferred) or XML configuration.

    When you do that, however, you must remember to copy the assemblies to the application’s bin folder, because that no longer happens automatically. Personally, I rarely find it worth that extra effort.

    A more elaborate version of this answer can be found in this excerpt from my book Dependency Injection, Principles, Practices, Patterns.

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

Sidebar

Related Questions

This is related to this question I have a vector of points that will,
my question is related to this question We have different aspect class that do
Related to this question , is the idea of a default servlet that serves
This question is related to this one . I have a page table with
Much related to this question , we have a scenario on my team where
[related to this question ] I wrote this piece of code to understand how
Related to this question (I too have had this error in an application). Error
This question is related to this question I have a field which is a
Related to this question , how do I detect that a form user is
This question is related to this one . I have two constructors: - (id)initWithBanner:(NSMutableArray

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.