Home

Subtype

A subtype is a category that represents a more specific form of a broader category. Subtyping is the relation by which a member of a subtype can be treated as a member of its supertype, while also possessing additional properties or restrictions. The term is used across disciplines, including mathematics and logic, computer science, biology, medicine, and linguistics.

In type theory and programming, a type B is a subtype of type A if every value

In data modeling and software design, subtypes appear in generalization–specialization hierarchies with supertype and subtype labels.

In biology and medicine, a subtype denotes a population or form within a larger category. In biology,

In linguistics and information organization, subtype distinctions help classify words, phrases, or data records into more

of
B
can
be
used
wherever
a
value
of
A
is
expected.
This
enables
polymorphism
and
code
reuse.
Subtyping
is
distinct
from
inheritance,
though
related,
and
may
involve
rules
about
how
function
types
vary
in
their
inputs
and
outputs
(covariance
and
contravariance).
Subtypes
may
be
disjoint
(a
value
belongs
to
one
subtype
only)
or
overlapping
(a
value
may
belong
to
several
subtypes).
Example:
supertype
Employee
with
subtypes
SalariedEmployee
and
HourlyEmployee;
subtypes
may
introduce
extra
attributes.
this
is
often
called
a
subspecies
or
variety;
in
medicine,
disease
subtypes
(for
example,
hormone
receptor–positive
or
HER2-positive
breast
cancer)
reflect
variation
that
affects
prognosis
or
treatment.
specific
classes,
aiding
retrieval
and
analysis.