-1

Is there any difference between those two? I am trying to learn those topics and both looks same concept. In Factory pattern we will create FactoryClass which will be responsible for creating objects of other class (removing dependency). I believe it is the same concept for DIP. Correct me if I am wrong. Sorry! if it is dumb question!

0

1 Answer 1

0

I think these 2 are slightly different topics, however both about software design. DIP is more about how you should arrange your dependencies in a class, and Factory is a pattern which you can use to instantiate those dependencies.

There is a good article from Bob Martin on principles of object oriented design (SOLID included) - http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod

Also, please consider to read this article by Martin Fowler on Inversion of Control and Dependency Injection.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.