Home

UDTs

User-defined types (UDTs) are data types created by programmers to represent domain concepts that are not covered by the language's built-in primitives. UDTs provide a way to model real objects, units, or values with tailored structure and constraints. They can be scalar, composite, or alias types, depending on the language or system.

In programming languages, UDTs include classes, structures, enums, unions, or type aliases that encapsulate data and,

In databases, UDTs allow storing domain-specific values consistently across tables and procedures. Examples include domain or

Design considerations include naming, versioning, compatibility, serialization format (JSON, XML), and performance implications. When used across

in
some
languages,
behavior.
They
enable
stronger
type
checking,
clearer
interfaces,
and
code
reuse.
They
may
be
defined
with
fields
and
methods,
and
can
be
serialized
or
mapped
to
storage,
interchanged
via
APIs,
or
bridged
between
languages
via
bindings.
Some
languages
support
advanced
features
for
UDTs,
such
as
generics,
inheritance,
or
interface
contracts.
alias
types
in
SQL
Server,
composite
types
or
enums
in
PostgreSQL,
and
user-defined
types
in
Oracle
or
other
systems.
A
composite
UDT
might
define
an
address
with
fields
for
street,
city,
and
postal
code,
while
a
domain
enforces
constraints
like
a
pattern
or
range
(for
example,
a
postal
code
format).
UDTs
can
improve
data
integrity,
readability,
and
cross-cutting
validation,
but
can
complicate
migrations
and
cross-system
portability.
APIs
or
storage
backends,
careful
mapping
between
the
UDT
and
primitive
types
is
required.