Repaso
EspaƱol
Design & PracticesFoundationsDP-59

In software, what is a 'dependency'?

Options

  1. A bug that only appears when another bug exists in the code
  2. Something your code needs to work: a library, package or service (Correct option)
  3. A very old piece of code that nobody dares to change
  4. A deployment deadline that is set by the whole team

Answer

Something your code needs in order to work: a library, a package, or another service

Why

If your app uses the library requests to call APIs, then requests is a dependency.

A database or another service your app calls is also a dependency.

Tools such as Maven (Java), pip (Python) and npm (JavaScript) download and manage dependencies for you.

'Dependency injection' is a different but related idea: passing what a class needs from outside.

Remember

Dependency = something you rely on.

Key terms

Practice this question in Repaso