Re: [CSV] Discussion about the new CSVFormatBuilder

2012-11-26 Thread Gary Gregory
Now what? I'd like to release a 1.0 but we need to come to some agreement on a config API... Gary On Thu, Nov 22, 2012 at 3:16 AM, Benedikt Ritter wrote: > Maybe we first have to decide if we want validation of CSVFormats at > construction time or not. If not, the changes of CSV-68 can be rever

Re: [CSV] Discussion about the new CSVFormatBuilder

2012-11-22 Thread Benedikt Ritter
Maybe we first have to decide if we want validation of CSVFormats at construction time or not. If not, the changes of CSV-68 can be reverted. Benedikt 2012/11/21 James Carman > I don't really have a problem with the extra call to build() before > you have something useful. It does give us the

Re: [CSV] Discussion about the new CSVFormatBuilder

2012-11-21 Thread James Carman
I don't really have a problem with the extra call to build() before you have something useful. It does give us the ability to do validation on the object before you build it. If we choose not to do the validation at this time, that's fine, but if we ever do choose to add that in the future, we do

Re: [CSV] Discussion about the new CSVFormatBuilder

2012-11-20 Thread Emmanuel Bourg
Le 20/11/2012 23:57, Gary Gregory a écrit : > Ok this is good. Let's see some healthy debating. :) Until the debate degrades my mental health... > What is the alternate API? The pre CSV-68 API. > To me the bother is the extra build() call, but that's the pattern. A pattern is not a feature o

Re: [CSV] Discussion about the new CSVFormatBuilder

2012-11-20 Thread Ted Dunning
Another way of looking at the builder style is that it is Java's way of using keyword arguments for complex constructors. It also allows a reasonable amount of future-proofing. These benefits are hard to replicate with constructors. On the other hand, builder-style patterns are a royal pain with

Re: [CSV] Discussion about the new CSVFormatBuilder

2012-11-20 Thread Gary Gregory
Ok this is good. Let's see some healthy debating. :) What is the alternate API? To me the bother is the extra build() call, but that's the pattern. Could an alt API be used and co-exist? Is making the ctor an option? It would have to do some validation. Gary On Nov 20, 2012, at 16:59, Emmanue

Re: [CSV] Discussion about the new CSVFormatBuilder

2012-11-20 Thread Emmanuel Bourg
Le 20/11/2012 20:01, Benedikt Ritter a écrit : > Please share your thoughts about the builder. Sorry Benedikt but I have to say I really don't like this design. I prefer a simpler API for the reasons you mentioned in the disadvantages. The minor improvements from the developer's point of view are

Re: [CSV] Discussion about the new CSVFormatBuilder

2012-11-20 Thread Benedikt Ritter
Hey Ted, no I was referring to the comments of CSV-68, where it was stated that no other CSV library provides validation of the used CSV formats (and hence it can be removed from commons csv entirely). Benedikt 2012/11/20 Ted Dunning > Surely you meant to say no other commons library. > > Bui

Re: [CSV] Discussion about the new CSVFormatBuilder

2012-11-20 Thread Ted Dunning
Surely you meant to say no other commons library. Builder patterns are relatively common. See guava for instance: http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/base/Splitter.html On Tue, Nov 20, 2012 at 11:49 AM, Gary Gregory wrote: > - it has been argued that usin

Re: [CSV] Discussion about the new CSVFormatBuilder

2012-11-20 Thread Gary Gregory
On Tue, Nov 20, 2012 at 2:01 PM, Benedikt Ritter wrote: > Hi, > > Gary and I did some work on CSV-68 Use the Builder Pattern to create > CSVFormats [1]. > We have implemented a builder for CSVFormats in trunk. It is capable of... > > ...creating a CSVFormat from scratch by only passing in a delimi

[CSV] Discussion about the new CSVFormatBuilder

2012-11-20 Thread Benedikt Ritter
Hi, Gary and I did some work on CSV-68 Use the Builder Pattern to create CSVFormats [1]. We have implemented a builder for CSVFormats in trunk. It is capable of... ...creating a CSVFormat from scratch by only passing in a delimiter: CSVFormat format = CSVFormat.newBuilder(',').build(); ...creati