liveBook · Manning

Fluent interface

Also called fluent api

A fluent interface is an API design style in which operations return objects or values that enable readable chaining of subsequent calls.

How 6 Manning books explain it

Building Web APIs with ASP.NET Core

The Entity Framework Core Fluent API is a programmatic configuration interface that defines entity mappings and relationships through chained method calls.

How it is used
Configures EF Core entity mappings and relationships in DbContext for a board-game database.
How deep it goes
Works through composite-key and relationship method chains, then leaves additional one-to-many and many-to-many configurations as exercises.
Examples
Uses board-game junction entities for composite keys and exercises involving publishers and categories.
What you can do after
Build it from scratch in EF Core by configuring composite keys, foreign keys, required relationships, and cascade deletion in OnModelCreating.

Read how Building Web APIs with ASP.NET Core explains fluent interface →

Kafka Streams in Action, Second Edition

A fluent interface is an API design pattern in which methods return objects that allow successive operations to be chained in a readable expression.

How it is used
Builds concise Kafka Streams topologies by chaining source, transformation, and sink operations.
How deep it goes
Explains returned stream objects and demonstrates a complete chain, but does not descend into API internals.
Examples
Uses the Yelling app to uppercase records flowing from src-topic into out-topic.
What you can do after
Builds Kafka Streams topologies from source to sink using chained Java API calls.

Read how Kafka Streams in Action, Second Edition explains fluent interface →

Idiomatic Rust

A fluent interface is an API style in which chained method calls express a sequence of operations through return values designed for further chaining.

How it is used
Uses method chaining to make sequential operations and builder configuration concise.
How deep it goes
Explains return types, Iterator::map, consuming self, struct spread, and fluent builder construction, but does not develop broader alternatives.
Examples
Demonstrates Iterator::map and a Bicycle builder configured with make, model, size, color, and build.
What you can do after
Apply it via Rust methods that return a chainable type, including consuming builder methods and a terminating build operation.

Read how Idiomatic Rust explains fluent interface →

ASP.NET Core in Action, 3e

A fluent API is a chainable programming interface that configures entity mappings through method calls rather than declarative attributes.

How it is used
Configures entity mappings, application options, and validation rules through readable method chains.
How deep it goes
Defines chaining, demonstrates validation and reusable extensions, and stops short of explaining fluent-interface implementation internals.
Examples
Uses currency conversion validators, allowed currency codes, cross-property checks, EF Core mappings, and OptionsBuilder<T> configuration.
What you can do after
Apply it via FluentValidation to compose property rules, custom predicates, reusable extensions, and dependency-backed checks.

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

Data-Oriented Programming in Java

Fluent chaining is an API style in which successive operations are linked through return values to form an expression-like sequence.

How it is used
Uses return values to express readable sequences of immutable transformations and composable business rules.
How deep it goes
Explains chaining through returned values, contrasts nested alternatives, and stops short of broader API design guidance.
Examples
Demonstrates Ball.step, vector transformations, and rule expressions built with and, or, and not.
What you can do after
Apply it via immutable value methods and default interface methods to build readable transformation or rule expressions.

Read how Data-Oriented Programming in Java explains fluent interface →

Effective Behavior-Driven Development

An API design style in which chained calls or expressions read as a sequence of operations.

How it is used
Uses chained configuration methods to make Object Mother setup for test orders more concise and readable.
How deep it goes
Defines chaining through methods returning their class and weighs readability against implementation effort and debugging difficulty.
Examples
Shows an order configured with WithItem or WithItems and completed with Build, contrasted with separate calls.
What you can do after
Apply fluent chaining to configure an order through an Object Mother before building it.

Read how Effective Behavior-Driven Development explains fluent interface →

Also covered in

What to know first

Related concepts

Questions about fluent interface

What is fluent interface?

A fluent interface is an API design style in which operations return objects or values that enable readable chaining of subsequent calls.

Which Manning books explain fluent interface?

Building Web APIs with ASP.NET Core, Kafka Streams in Action, Second Edition, Idiomatic Rust, ASP.NET Core in Action, 3e, Data-Oriented Programming in Java and Effective Behavior-Driven Development.

What should I know before learning fluent interface?

Manning books that teach fluent interface usually introduce builder pattern, foreign key, method and struct first.

What is the difference between fluent interface and static method?

A fluent interface is an API design style in which operations return objects or values that enable readable chaining of subsequent calls. A static method is a function associated with a type rather than an instance, callable without an instance receiver.

What is fluent interface also called?

Fluent interface is also called fluent api.

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.