Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>Dependency Inversion Principle</strong>; One of the five <a href="http://en.wikipedia.org/wiki/SOLID_%28object-oriented_design%29" rel="nofollow noreferrer">Object Oriented Design Principles</a>. Check out the answers to this question; <a href="https://stackoverflow.com/questions/62539/what-is-the-dependency-inversion-principle-and-why-is-it-important">"What is the Dependency Inversion Principle and why is it important?"</a> - there's some really good information there.</p> <blockquote> <p>In conventional application architecture, lower-level components are designed to be consumed by higher-level components which enable increasingly complex systems to be built. In this composition, higher-level components depend directly upon lower-level components to achieve some task. This dependency upon lower-level components limits the reuse opportunities of the higher-level components.</p> </blockquote> <p>In '<em>simple</em>' terms, this means that when you rely upon a concrete instance of an object - you're building a dependency in to your code (albeit without that intention), this then limits the ability to re-use it. </p> <p>Remember that a <strong>Concrete Type</strong> is a type of class that can be instantiated and a <strong>Abstract Type</strong> is a type that cannot; i.e an interface. (See the <a href="http://en.wikipedia.org/wiki/Class_%28computer_programming%29#Abstract_and_Concrete" rel="nofollow noreferrer">Taxonomy of Classes</a>)</p> <p>If you code to a specific concrete class then you will always have the requirement for that class. However, if you code to an interface (an <em>abstraction</em>) then it's possible to adapt your code to work with any number of classes; as long as they implement that common interface.</p> <p>So in Java, it means that where possible you should code to an Interface - and avoid making your code depend on specific items. This is often as simple as passing <code>Interface</code> types as parameters and return types; as opposed to concrete classes. </p> <p>Less dependencies = More ability to re-use code. More dependencies = More requirements to be able to re-use code.</p> <p><strong>This will be a re-occuring theme when you're studying Design Patterns!</strong></p> <p><a href="http://en.wikipedia.org/wiki/Dependency_inversion_principle" rel="nofollow noreferrer">Dependency Inversion Principle</a> on Wikipedia.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload