Anurag Agarwal 670c4e43f3 Java 11 migrate 7 remaining f (#1115)
* Moves facade to Java 11

* Moves factory-kit to Java 11

* Moves factory-method to Java 11

* Moves feature-toggle to Java 11

* Moves fluentinterface to Java 11

* Moves flux to Java 11

* Moves flyweight to Java 11

* Moves front-controller to Java 11

* Uses stream properly

* Resolves issues with ci
2019-12-22 14:41:19 +02:00
..
2019-12-07 18:03:49 +02:00
2019-12-22 14:41:19 +02:00
2019-12-18 22:04:08 +02:00

layout, title, folder, permalink, categories, tags
layout title folder permalink categories tags
pattern Fluent Interface fluentinterface /patterns/fluentinterface/ Functional
Reactive

Intent

A fluent interface provides an easy-readable, flowing interface, that often mimics a domain specific language. Using this pattern results in code that can be read nearly as human language.

Implementation

A fluent interface can be implemented using any of

  • Method Chaining - calling a method returns some object on which further methods can be called.
  • Static Factory Methods and Imports
  • Named parameters - can be simulated in Java using static factory methods.

Class diagram

Fluent Interface

Applicability

Use the Fluent Interface pattern when

  • you provide an API that would benefit from a DSL-like usage
  • you have objects that are difficult to configure or use

Real world examples

Credits