Search code examples
dependenciescomputer-scienceterminology

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.


Solution

  • 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.