What is a dependency?
In software development, a dependency describes that a program needs a certain piece of code (e.g. frameworks, libraries) in order to function properly.
Dependencies are used when a program needs external software or libraries to function as planned. These external components are also known as packages.
All packages that a software needs to run must be installed when installing this software – otherwise the program will not work correctly. Here one also speaks of resolving the dependencies. Often z. B. a certain framework can be installed in addition to the actual software so that the program can be used correctly.
Management of dependencies
Package managers or package managers are tools that help, among other things, to manage the dependencies in a software in a clear manner. Among other things, they make the installation of new packages easier and help to keep packages up to date or to remove them. The alternative would be to manually manage all the required packages. In the case of smaller projects with few dependencies, the effort required for this is reasonable, but in the case of larger projects, without a package manager, the overview is quickly lacking.
Benefits of using dependencies
The use of external packages saves the developer work and time. Because often there are already mature solutions for everyday problems from a third party, which can easily be integrated into any project.
It is also possible to outsource certain functionalities within a company and provide them as packages for a wide variety of projects. So z. B. a uniform procedure for certain tasks can be achieved or, in general, development time for recurring and cross-project tasks can be saved.
The use of dependencies makes self-written code leaner and clearer. Because instead of programming the entire range of functions himself , the developer can concentrate largely on the project-specific functions.
Disadvantages of using dependencies
One disadvantage is that if an expected package is missing, errors in the software can occur. These errors range from unexpected behavior to loss of functionality. If z. For example, if a dependency was not resolved or resolved incorrectly, the program will not work and may have to be completely reinstalled.
Automatically updated packages from third-party providers can also be critical: If there are drastic changes between the version used for development and the more recent version, unexpected behavior can occur. It can e.g. For example, it can happen that a certain function is no longer available in the latest version of the package or that the results are slightly different. Ideally, this should be avoided as much as possible by the package publisher, but this is not guaranteed.