camelCase
camelCase

Reputation: 13

What is the proper term for an API designed around the dotted notation?

I plan to ask another question on Stackoverflow but want to use the correct term. In recent years many APIs have been designed to support the following usage where a common type is returned.

var query= myList.Where(p=>p.X == "abc")
                   .Where(p=>p.BirthDate.Year == 1999)
                   .Where(p=>p.Y == 123 )
                   .Where(p=>p.Z == DateTime.Now );

What is the accepted software engineering term for this API style?

Upvotes: 1

Views: 142

Answers (2)

Shaun Mason
Shaun Mason

Reputation: 797

The concept your talking about is Method Chaining

x0n is correct that is a concept used in a Fluent Interface.

Upvotes: 1

x0n
x0n

Reputation: 52430

This is typically known as a "Fluent" interface, where methods on an instance return the instance itself, allowing chaining like your example.

http://en.wikipedia.org/wiki/Fluent_interface

Upvotes: 5

Related Questions