Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

11. Question Authority > Fluent Interfaces

Fluent Interfaces

A fluent interface is one of the types of domain-specific language (DSL) styles currently in vogue. In a fluent interface, you try to construct long sequences of code into sentences, rationalizing that complete chunks of thought in spoken languages follow this style. This style of coding is easier to read because, just like with English sentences, you know where one thought ends and the next begins.

Here is an example, based on one of my projects. We built an application that dealt with train cars, and each train car had a marketing description. Train cars have lots of rules and regulations associated with them, so getting testing scenarios just right was difficult. We constantly had to ask our business analysts if we had the perfectly nuanced definition of the type of car we needed to test. Here’s a simplified version of what we showed them:


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint