Click here to Skip to main content
15,891,777 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more: (untagged)
Hello Everyone,

Although i have gone through with many Links but still not able to understand how they are different.

Following links i already checked.
- One, Two, Three, Four

Even in some posts answer were not marked. Does DIP always include OCP and not vice-verse?
Posted

1 solution

This is because you are reading wrong articles.

They are all based on wrong, or counter-productive formulation of the artificial problems. First one tries to "find" one or another principle in quite a pointless piece of code doing who-knows-what, other "focus" on "vs" or "difference". Those "vs" and "difference" are undefinable and carry no real meaning, and questions in such terms are incorrect.

Instead, you may need just to understand each of the two principles, their applications and value. And you probably need to start with some reasonable explanation of these principles. In particular:
http://en.wikipedia.org/wiki/Open_Closed_Principle[^],
http://en.wikipedia.org/wiki/Dependency_inversion_principle[^].

See also: http://en.wikipedia.org/wiki/SOLID_%28object-oriented_design%29[^].

Explaining anything in a Quick Answer written specially for you would not make much sense here. Why would it be better than available literature?

—SA
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 9-Apr-14 12:02pm    
I saw your comment where you suggested to up-vote your question. The question is quite bad, and I would gladly vote another 1 for it, especially after your comments. You apparently don't understand your fallacy. Also, I could note that you don't appreciate other posts. No, it would not be a reason not to appreciate yours, but only if your posts were good. We don't fight for votes here, they are not so important; at maximum, we inform some members of our solutions...
—SA
girishmeena 10-Apr-14 9:48am    
Ok, I will do my best in future. Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900