A transitive dependency is a
functional dependency
In relational database theory, a functional dependency is a constraint between two sets of attributes in a relation from a database. In other words, a functional dependency is a constraint between two attributes in a relation.
Given a relation '' ...
which holds by virtue of
transitivity among various software components.
Computer programs
In a
computer program
A computer program is a sequence or set of instructions in a programming language for a computer to execute. Computer programs are one component of software, which also includes documentation and other intangible components.
A computer progra ...
a direct dependency is functionality exported by a
library
A library is a collection of materials, books or media that are accessible for use and not just for display purposes. A library provides physical (hard copies) or digital access (soft copies) materials, and may be a physical location or a vi ...
, or
API
An application programming interface (API) is a way for two or more computer programs to communicate with each other. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how ...
, or any
software component
Component-based software engineering (CBSE), also called component-based development (CBD), is a branch of software engineering that emphasizes the separation of concerns with respect to the wide-ranging functionality available throughout a give ...
that is referenced directly by the program itself.
A transitive dependency is any dependency that is induced by the components that the program references directly.
E.g. a call to a
function will usually induce a transitive dependency to a library that manages the I/O to write the log message in a file.
Dependencies and transitive dependencies can be resolved at different times, depending on how the
computer program
A computer program is a sequence or set of instructions in a programming language for a computer to execute. Computer programs are one component of software, which also includes documentation and other intangible components.
A computer progra ...
is assembled and/or executed: e.g. a
compiler
In computing, a compiler is a computer program that translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primarily used for programs that ...
can have a
link phase where the dependencies are resolved. Sometimes the build system even allows management of the transitive dependencies.
Similarly, when a
computer uses
services, a
computer program
A computer program is a sequence or set of instructions in a programming language for a computer to execute. Computer programs are one component of software, which also includes documentation and other intangible components.
A computer progra ...
can depend on a service that should be started before to execute the program.
A transitive dependency in such case is any other service that the service we depend directly on depends on, e.g. a
web browser
A web browser is application software for accessing websites. When a user requests a web page from a particular website, the browser retrieves its files from a web server and then displays the page on the user's screen. Browsers are used on ...
depends on a
Domain Name Resolution service to convert a web
URL
A Uniform Resource Locator (URL), colloquially termed as a web address, is a reference to a web resource that specifies its location on a computer network and a mechanism for retrieving it. A URL is a specific type of Uniform Resource Identifi ...
in an
IP address
An Internet Protocol address (IP address) is a numerical label such as that is connected to a computer network that uses the Internet Protocol for communication.. Updated by . An IP address serves two main functions: network interface ident ...
; the DNS will depend on a networking service to access a remote name server.
The Linux boot system
is based on a set of configurations that ''declare'' the dependencies of the modules to be started: at boot time analyzes all the transitive dependencies to decide the execution order of each module to start.
Database Management Systems
Let A, B, and C designate three distinct (but not necessarily disjoint) sets of attributes of a relation. Suppose all three of the following conditions hold:
# A → B
# It is not the case that B → A
# B → C
Then the functional dependency A → C (which follows from 1 and 3 by the
axiom of transitivity) is a transitive dependency.
In
database normalization
Database normalization or database normalisation (see spelling differences) is the process of structuring a relational database in accordance with a series of so-called normal forms in order to reduce data redundancy and improve data integrit ...
, one of the important features of
third normal form
Third normal form (3NF) is a database schema design approach for relational databases which uses normalizing principles to reduce the duplication of data, avoid data anomalies, ensure referential integrity, and simplify data management. It was de ...
is that it excludes certain types of transitive dependencies.
E.F. Codd, the inventor of the
relational model
The relational model (RM) is an approach to managing data using a structure and language consistent with first-order predicate logic, first described in 1969 by English computer scientist Edgar F. Codd, where all data is represented in terms of tup ...
, introduced the concepts of transitive dependence and third normal form in 1971.
[Codd, E.F. "Further Normalization of the Data Base Relational Model." (Presented at Courant Computer Science Symposia Series 6, "Data Base Systems," New York City, May 24th-25th, 1971.) IBM Research Report RJ909 (August 31st, 1971). Republished in Randall J. Rustin (ed.), ''Data Base Systems: Courant Computer Science Symposia Series 6''. Prentice-Hall, 1972. See pages 45-51, which cover third normal form and transitive dependence.]
Example
A transitive dependency occurs in the following relation:
The functional dependency → applies; that is, if we know the book, we know the author's nationality. Furthermore:
* →
* does not →
* →
Therefore → {Author nationality} is a transitive dependency.
Transitive dependency occurred because a non-key attribute (Author) was determining another non-key attribute (Author nationality).
Notes
Database constraints
Database theory