6

http://tutorials.jenkov.com/ood/understanding-dependencies.html#whatis says that (emphasis mine):

Whenever a class A uses another class or interface B, then A depends on B. A cannot carry out it's work without B, and A cannot be reused without also reusing B. In such a situation the class A is called the "dependant" and the class or interface B is called the "dependency". A dependant depends on its dependencies.

According to Google's definition:

a dependent or subordinate thing, especially a country or province controlled by another.

Since A depends on B, the dependency is A and the dependant is B. This is contrary to the first quote. Or am I missing something?

3
  • I think this is just a quirk of the English language. Dependencies are typically indicated by "include" or "using" etc, and the word "Dependant" is used much less often.
    – Lunster
    Oct 29, 2017 at 14:22
  • 1
    Google's definition of... dependency? Is that the only definition? This might be better suited to English Language Learners.
    – jonrsharpe
    Oct 29, 2017 at 14:26
  • Oh you already have posted it elsewhere. Please don't cross-post.
    – jonrsharpe
    Oct 29, 2017 at 14:30

2 Answers 2

5

Terminology is context dependent. In general, the dependency is a synonym of dependence and describes not one entity, but state. According to Cambridge dictionary:

the situation in which you need something or someone all the time, especially in order to continue existing or operating.

So it's more about a relation to something. For example:

A minor child is dependent of his/her parents. The child is in a state of dependency. The dependency describes the relation between the child and its parents.

The google definition is only one of the available definitions (see for example the Collins dictionary), the one that is especially applicable in the context of geopolitics and real estate. For example:

Before 1776, America was a dependency of the British Empire. The dependency America was dependent on the Empire.

He bought a farm with several dependencies

The object oriented terminology is not so different from the more general definition: a dependency is a relationship between objects or classes. Here a more formal definition from the UML 2.5 standard:

7.7.1: A Dependency signifies a supplier/client relationship between model elements where the modification of a supplier may impact the client model elements.

So, restating what's in the tutorial, we can say that:

If A has to use B, A depends on B. There is a relation of dependency from A to B. A is said to be the dependent.

For practical reason and language convenience, B is often called the dependency (which is indeed the contrary of everyday's language). But in reality, it is still the relation of A to B that is the dependency.

0

The thing that is dependent on something is the dependency. I am dependent on H. I need H injected into me. H is a dependency of me.

0

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.