2013/4/8 Emmanuel Bourg <ebo...@apache.org> > Le 08/04/2013 22:39, Gary Gregory a écrit : > > > But that's the price for immutability for some of these objects. > > Not sure, we already achieved immutability last year without paying this > price: > > > http://svn.apache.org/repos/asf/commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVFormat.java?p=1305548 > > This design was sacrified for the sake of implementing a "by the book" > builder pattern that brings no real benefit in term of usability. It's > just a useless layer of complexity. >
You're right, the old impl was already immutable. The problem was, that it was not possible for a CSVFormat to validate itself at construction time. We had to call the package private validate() method. I think we have been through this several times. All arguments have been exchanged. If there is a way to let a CSVFormat validate itself by the time it is constructed with the old AP, I'm more than happy to drop the builder. This is not about implementing "by the book" builder patterns. Benedikt > > > Emmanuel Bourg > > > -- http://people.apache.org/~britter/ http://www.systemoutprintln.de/ http://twitter.com/BenediktRitter http://github.com/britter