| Start |
|---|
| Fluent programming style In fluent programming style you return This allows you to chain the different method calls which makes your code shorter and easier to handle for the developers. Consider this non-fluent code: As the setter methods don't return anything, we need 4 instructions in the The idea is to always return some object to enable building of a method call chain and to use method names which reflect natural speaking. This fluent style makes the code more readable. |
| Truth - Fluent Testing Framework From "How to use Truth" http://google.github.io/truth/ (opens new window) RemarksGoals The primary goal of a Fluent Interface is increased readability. When used for constructing objects, the choices available to the caller can be made clearly and enforced via compile-time checks. For example, consider the following tree of options representing steps along the path to construct some complex object: A builder using a fluent interface would allow the caller to easily see what options are available at each step. For example, A -> B is possible, but A -> C is not and would result in a compile-time error. |
Read Article
https://develop.horje.com/learn/1434/reference