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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:45:21+00:00 2026-05-13T10:45:21+00:00

I have a medium sized asp.net MVC app. It consumes a service layer that

  • 0

I have a medium sized asp.net MVC app. It consumes a service layer that handles all the repository use, calling domain services, etc. My controller actions are very slim — they basically call a service class, get a response and show that respose. Most components are interface based with some poor man’s DI. The app is growing, needs better testing support, and starting to call out for an IoC container.

Everything I read (such as this SO question) states that I should configure the IoC at the application root. This makes sense to me if I were using repositories right from my controller actions and needed DI at the controller level, but I’m not. It seems like I’d want my composition root in my service layer. I keep thinking that I don’t want my web.config (or another config) at the UI layer even mentioning/seeing/hearing about a repository, credit card processor, etc.

Am I thinking about this the right way or do I just need to get over it?

  • 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-13T10:45:21+00:00Added an answer on May 13, 2026 at 10:45 am

    You just need to get over it 🙂

    Having your Composition Root in the application root doesn’t require you to have a lot of DI Container stuff in web.config. You can if you will, but it’s optional. What is not optional when putting the Composition Root in the application root is that you need to have some DI code in Global.asax.

    You may find it irrelevant because your Controllers are so thin, but that’s not the real point. The actual point is that you (the abstract ‘you’) want to postpone coupling classes until the last responsible moment. The earlier you couple types, the less flexibility you have.

    If you couple classes in the service layer, you make an irreversible decision at that point. If it later turns out that you need to compose those services differently, you can’t – not without recompiling, that is.

    If there was a major benefit of doing it, I can understand why you would want to, but there isn’t. You may as well wait composing all components untill you absolutely must do so – and that’s in the application’s entry point.

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

Sidebar

Related Questions

I have a medium sized application that runs as a .net web-service which I
I am developing a medium sized ASP.NET project using ASP.NET MVC and Entity Framework.
I have inherited a medium sized database that we are trying to use with
We have a medium sized .js file that we include in our web framework
I have two medium-sized web applications that I'm merging into one. They are both
I am working on familiarizing myself with the MVC on ASP.NET. I have on
I have an asp.net site that displays the way I want it to on
In our project (which is fully developed using .NET), we use a medium sized
I have a medium sized application written in c++ using Qt. I wanted to
I have a medium sized Django project, (running on AppEngine if it makes any

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.