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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:14:54+00:00 2026-05-25T14:14:54+00:00

Can you briefly explain: What mainly differs Dependency Injection from Factory Design pattern? Additionally:

  • 0

Can you briefly explain: What mainly differs Dependency Injection from Factory Design pattern?

Additionally: Is it possible to demonstrate the difference very simply by a code example?

Thanks

  • 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-25T14:14:55+00:00Added an answer on May 25, 2026 at 2:14 pm

    With Factory (or any other Creation pattern), the caller has to know how to get the object and has to “explicitly” ask for it before consuming it.

    Car car = CarFactory.getCarByModel(LUXURY);
    

    Whereas when using DI, the responsibility to pass the desired object is delegated to some external (container mostly) entity which knows how to create the object (by reading the config already defined) and make it available to the caller silently.

    Car car = getCar();
    void setCar(Car car){..} // container sets the car fromoutside
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just moved to subversion...from visual studio. I love it already! Can someone briefly explain
Can someone briefly explain to me how ARC works? I know it's different from
Can someone briefly explain to me the difference between Visual Studio's solution file (.sln)
Can someone briefly explain on HOW and WHEN to use a ThreadFactory? An example
Can anyone briefly explain how to use the .NET folder type in Reddot, I
I'll explain briefly what I want to accomplish from a functional perspective. I'm working
Can anyone explain me briefly what exactly is component programming in .NET and why
Google-fu is failing me on this one. Can anyone briefly explain what the following
can someone briefly explain that what is exactly the role of info-plist in xcode
Can anyone briefly explain to me about what are the differentiation for these (Drawable

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.