Gilles created TEXT-38:
--------------------------

             Summary: Fluent API in {{RandomStringBuilder}}
                 Key: TEXT-38
                 URL: https://issues.apache.org/jira/browse/TEXT-38
             Project: Commons Text
          Issue Type: Improvement
            Reporter: Gilles
             Fix For: 1.0


It can be construed as potentially dangerous to let user code change any of the 
settings of the builder, as other parts of the code could be using a reference 
to the same instance.

In Commons Math, where the fluent API pattern was applied, a new builder 
(immutable) instance would be created.  For example, see [this 
class|https://git1-us-west.apache.org/repos/asf?p=commons-math.git;a=blob;f=src/main/java/org/apache/commons/math4/fitting/SimpleCurveFitter.java;h=54f6cbfe1e003cec74f2b0e71efc1b13000a5525;hb=HEAD].




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to