liveBook · Manning

User-defined type

A user-defined type is a type declared by a user or programmer rather than supplied as a built-in type.

How 5 Manning books explain it

Learn Go with Pocket-Sized Projects

A custom type is a programmer-defined Go type that gives a distinct name and type identity to an underlying representation.

How it is used
Uses named types to clarify parameter meanings, domain fields, and package APIs.
How deep it goes
Works through declarations, typed calls, private fields, parsing, and validation; does not examine runtime type internals.
Examples
Shows language-coded greetings, a privately represented Decimal, and separately typed habit IDs, names, and weekly frequencies.
What you can do after
Build it from scratch with Go type declarations and typed fields, then add construction or validation where values need constraints.

Read how Learn Go with Pocket-Sized Projects explains user-defined type →

Go in Action, Second Edition

A defined type is a programmer-declared type that creates a distinct named type with an underlying type and can have its own methods.

How it is used
Models recipe-domain concepts with distinct names so intent is clearer and accidental misuse can be caught at compile time.
How deep it goes
Defines the declaration syntax, contrasts defined types with aliases, and develops struct and collection types into a recipe model.
Examples
Uses measurement magnitudes and units, ingredient lists, recipe steps, and a grocery list.
What you can do after
Build it from scratch: define domain-specific Go types and compose them into a recipe model with shared behavior.

Read how Go in Action, Second Edition explains user-defined type →

ScyllaDB in Action

A user-defined type is a named custom data type whose fields can have different types and that can be used as a column, collection element, or key value in ScyllaDB.

How it is used
Groups related, differently typed properties into one value for schemas such as contact details and image metadata.
How deep it goes
Defines creation, insertion, null behavior, frozen collection use, and Python driver mapping; defers required-field enforcement to application code.
Examples
Uses contact_info fields and an image type with path and caption in an article image gallery.
What you can do after
Apply it via CQL schemas and Python driver registration to store and retrieve structured image metadata.

Read how ScyllaDB in Action explains user-defined type →

Spring in Action, Sixth Edition

A Cassandra user-defined type is a schema-defined composite type whose fields can be stored together in a column.

How it is used
Stores denormalized composite data, especially copied related records inside Cassandra collection columns.
How deep it goes
Explains collection constraints, denormalization, annotation, separate classes, and optional fields without covering schema operations.
Examples
Uses taco ingredients, IngredientUDT, TacoUDT, and a stored ingredient collection as concrete mapping examples.
What you can do after
Build it from scratch by defining a separate annotated UDT class for structured values embedded in Cassandra columns.

Read how Spring in Action, Sixth Edition explains user-defined type →

React in Depth

A custom type is a programmer-defined type specification that restricts or describes the values permitted in a program.

How it is used
Constrains variables, function results, and React component props to documented value shapes.
How deep it goes
Explains unions, literal values, interfaces, optional properties, and unknown, but defers technical differences between interfaces and type aliases.
Examples
Uses nullable names, status literals, invalid assignments, and typed React component props with optional fields.
What you can do after
Apply it via TypeScript to reject invalid values and document React component interfaces.

Read how React in Depth explains user-defined type →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.