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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:16:36+00:00 2026-05-22T21:16:36+00:00

I have not done much IOC but from what I read and the examples

  • 0

I have not done much IOC but from what I read and the examples I see on the internet it has confused me.

My understanding is that you should use IOC to promote loosely coupled system.

Now building the container in code (Unity) the one my company uses how can this be decoupled if I have to have a hard reference to my service EG

   IUnityContainer container=new UnityContainer()
    .RegisterType<IMyService,MyService>();

As you can see MyService is a concrete class which will require me to have a reference to my service layer.

Am I not defeating the point now?

Any examples or suggestions or views very welcome

  • 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-22T21:16:37+00:00Added an answer on May 22, 2026 at 9:16 pm

    Container is helping you build loosely coupled applications, but loosely coupled doesn’t mean “no hard references on other assemblies” as you seem to be suggesting.

    Interface and class that implements it may live in the same assembly, in the same namespace, event in the same .cs file, and that has nothing to do with loose or tight coupling.

    It’s about the classes that use other types depending on abstractions, not on concrete implementations. The fact that your registration code has knowledge of both, abstraction and concrete implementation is ok. After all you need to have some coupling.

    In terms of mechanics, you can simplify the registration and not mention both types each time, and even not have reference to other assemblies by using conventions in some other containers like Windsor (Unity doesn’t support convention-based registration to the best of my knowledge).

    Again – this is mechanics and has nothing to do with loose vs tight coupling or reasons for using containers. It just makes using the container simpler.

    HTH

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

Sidebar

Related Questions

I have not done much database programming at all. I am working from some
I've not done much with linq to xml, but all the examples I've seen
I have done much research into the issue, I'm not blindly asking but I
I have done some work with Ruby on Rails but am still not comfortable
I have done jQuery and Ajax, but I am not able to get the
have not tested on windows. but in ubuntu when u disconnect from the network,
I have not done much on Ajax before and was wondering if I could
I have not really done much programming with Core Graphics. And I tend to
I have NOT done much of web-developing and I would like to learn about
Am working with dependency objects here, not done much with them before but they

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.