You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: faq.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,3 +61,7 @@ As for performance and scalability, pools can become bottlenecks, if all the
61
61
pooled objects are in use and more clients need them, threads will become
62
62
blocked waiting for available object from the pool. This is not the case with
63
63
Flyweight.
64
+
65
+
### Q7: What are the differences between FluentInterface and Builder patterns? {#Q7}
66
+
67
+
Fluent interfaces are sometimes confused with the Builder pattern, because they share method chaining and a fluent usage. However, fluent interfaces are not primarily used to create shared (mutable) objects, but to configure complex objects without having to respecify the target object on every property change.
**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.
13
+
14
+
**Implementation:**
15
+
16
+
A fluent interface can be implemented using any of
17
+
18
+
* Method Chaining - calling a method returns some object on which further methods can be called.
19
+
* Static Factory Methods and Imports
20
+
* Named parameters - can be simulated in Java using static factory methods.
0 commit comments