Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Computer Science, what's the opposite of a dependency?

More specifically in programming, we use the term dependency when we are referring to a software component that is required by another piece of code to run.

What do you call that piece of code that requires the dependency to run? I don't think I know the word represent the relationship from the other way around.

like image 891
10110 Avatar asked Oct 08 '20 05:10

10110


People also ask

What is the meaning of dependency in computer science?

Dependency (computer science) or coupling, a state in which one object uses a function of another object. Data dependency, which describes a dependence relation between statements in a program. Dependence analysis, in compiler theory.

What is dependency and dependent?

“Dependence” and “dependency” are both words that reference reliance upon someone or something else for support. In short, “dependence” is a quality of reliance and “dependency” is the act or state of being dependent.

What is dependency in programming language?

In object-oriented programming (OOP) software design, dependency injection (DI) is the process of supplying a resource that a given piece of code requires. The required resource, which is often a component of the application itself, is called a dependency.

What is data dependency and its types?

A data dependency in computer science is a situation in which a program statement (instruction) refers to the data of a preceding statement. In compiler theory, the technique used to discover data dependencies among statements (or instructions) is called dependence analysis.


1 Answers

The opposite of a dependency is independency.

The inverse of a dependency is a dependent. This term applies specifically in programming to refer to the piece of code that requires the dependency to run.


The term is widely used. Some quotes to support the claim:

  • In the book Dependency Injection: Design patterns using Spring and Guice (so a book that is mainly about dependencies in the programming context):

    Dependency — A specific service that is required by another object to fulfill its function.
    Dependent — A client object that needs a dependency (or dependencies) in order to perform its function.

  • In the book The Unified Modeling Language Reference Manual, 2nd ed by Booch, Rumbaugh and Jacobson:

    Dependency: A relationship between two elements in which a change to one element (the supplier) may affect or supply information needed by the other element (the client). (...) the dependent elements are called clients.

  • In the semantic versioning manifesto, they explain how semver can allow to release new versions of dependencies without disrupting dependent software or packages.

  • In the documentation of Maven:

    Compile dependencies are available in all classpaths of a project. Furthermore, those dependencies are propagated to dependent projects.

  • Last but not least, linguist have also confirmed suitability of this term for very similar dependency management needs.

Dependency being a relation between something that is dependent and something that it depends on, there is a little residual ambiguity on the direction that is meant. Regardless the terms used, it's recommended to provide the definitions. Supplier/Client are alternatives that are imho more easily understood although not universally suitable.

like image 122
Christophe Avatar answered Sep 17 '22 02:09

Christophe