Results 1 to 2 of 2

Thread: Dependency Injection : Why we depend on container to inject objects,we can create...

Hybrid View

  1. #1

    Post Dependency Injection : Why we depend on container to inject objects,we can create...

    Hi, This is srikanth i am new to spring ,i faced an interview, i have explained the process of ioc and di.how di works they asked me :

    " Why container have to inject objects,u can create objects,what is the use of creating objects by container" explain.

    and please let me know the exact advantages that can be explained in the interview point of view.

    Please, reply for this quotion i have reffered many books but i hope i would find good answer here.

  2. #2

    Default

    I would refer to advantages of using DI to answer this question. I would also recommend to you to see a Google I/O presentation by Dhanji. http://code.google.com/p/google-guice/.

    I like it because he explains traditionally how we use to create objects, and then how factory pattern eased out the pain and finally about DI. You can also refer to book written by Dhanji himself. I hope this would clear your doubts.

    ~abhi

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •