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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T22:47:32+00:00 2026-05-11T22:47:32+00:00

I’m introducing an IoC Container in an architecture for the first time. I’m looking

  • 0

I’m introducing an IoC Container in an architecture for the first time. I’m looking for things that one should not do with an IoC Container. I want to avoid the pitfalls of using an IoC container. I don’t want to misuse or overuse it.

Can you help me put up a list of things to avoid when using a IoC container?

I have on item on my list so far:

  • Don’t let every class access the container (don’t make it a public Singleton). Only a few top level classes should access the container.
  • 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-11T22:47:32+00:00Added an answer on May 11, 2026 at 10:47 pm

    If you are putting an IoC in place, I suggest you to have a look at http://docs.codehaus.org/display/YAN/IoC+Container

    Here are few interesting points

    • The most obvious one, container should not require business objects
      assembled by it to implement any
      interface, to inherit any class, to
      call any API. This avoids direct
      dependency on the container.
    • The container should not require business objects to conform to any
      coding convention, such as “you have
      to expose public constructor”, “you
      have to expose Java Bean setters”,
      “you have to have a method named like
      injectXXX”, “you have to use a special
      annotation” etc. Such restriction
      places an implicit dependency on the
      container because the programmers of
      the business objects still have to be
      aware of the do’s and dont’s from the
      container.

    • Do not depend on any IoC container API
      in your IoC objects. It is a tragedy
      to violate the principle of IoC by
      using an IoC container.

    • IoC container
      is for the code that assembly objects
      together; it is for the configuration
      of the system. After all, it is not
      for the business objects.
    • Declarative API is preferable. It is nice to expose a declarative API rather than one that requires procedural coding.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

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.