liveBook · Manning

Converter

A converter is a component or operation that transforms data or values from one type or representation into another.

How 4 Manning books explain it

Java Persistence with Spring Data and Hibernate epub

A custom type converter is application-defined conversion logic that translates values between a domain type and a persistence representation.

How it is used
Uses converters as a buffer between domain properties and database representations during mapping and schema changes.
How deep it goes
Explains bidirectional AttributeConverter methods, property and nested mappings, and an alternative for a later schema migration.
Examples
Uses monetary amounts stored as currency-bearing strings and zipcodes reconstructed as concrete subtypes.
What you can do after
Apply conversion via JPA AttributeConverter and @Convert to basic or nested properties.

Read how Java Persistence with Spring Data and Hibernate epub explains converter →

Kafka Streams in Action, Second Edition

A converter is a Kafka Connect component that changes data between Connect's internal representation and a serialization format used by Kafka or an external system.

How it is used
Configures Kafka Connect to serialize keys and values entering Kafka or deserialize them for external systems.
How deep it goes
Defines conversion direction and key/value settings, but stops short of implementing a custom converter.
Examples
Uses StringConverter for keys, JsonConverter for values, and a JDBC source connector with schemas disabled.
What you can do after
Operate/configure Kafka Connect converters through worker defaults, connector overrides, and key/value serialization settings.

Read how Kafka Streams in Action, Second Edition explains converter →

Spring in Action, Sixth Edition

A Spring Converter is a class implementing the Converter interface to transform a value from one type into another during data binding.

How it is used
Bridges submitted form values and domain objects during Spring MVC data binding.
How deep it goes
Explains interface implementation, lookup logic, bean discovery, and automatic registration, but defers database-backed conversion.
Examples
Uses taco ingredient checkboxes, ingredient IDs, a Map lookup, and IngredientByIdConverter as concrete implementation artifacts.
What you can do after
Build it from scratch by implementing Converter<String, Ingredient> and registering the class as a Spring component.

Read how Spring in Action, Sixth Edition explains converter →

ASP.NET Core in Action, 3e

A type converter is a .NET conversion component or convention that converts values between specified types, including converting textual input to another type.

How it is used
Converts string request values while Razor Pages model binding supplies handler parameters.
How deep it goes
Identifies primitive types, TryParse, and TypeConverter as supported paths without detailing converter implementation.
Examples
Uses a Razor Page handler that accepts an integer number and calculates its square.
What you can do after
Apply model binding to receive converted primitive values and recognize custom types supported by TryParse or TypeConverter.

Read how ASP.NET Core in Action, 3e explains converter →

Also covered in

What to know first

Related concepts

Questions about converter

What is converter?

A converter is a component or operation that transforms data or values from one type or representation into another.

Which Manning books explain converter?

Java Persistence with Spring Data and Hibernate epub, Kafka Streams in Action, Second Edition, Spring in Action, Sixth Edition and ASP.NET Core in Action, 3e.

What should I know before learning converter?

Manning books that teach converter usually introduce JSON and serialization first.

What kinds of converter are there?

Kinds of converter include to_a and to_f.

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.