Re: [CSV] Should the Builder API be optional?

2013-04-10 Thread Oliver Heger
Am 09.04.2013 08:48, schrieb Benedikt Ritter: 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:

Re: [CSV] Should the Builder API be optional?

2013-04-10 Thread Benedikt Ritter
2013/4/10 Oliver Heger oliver.he...@oliver-heger.de Am 09.04.2013 08:48, schrieb Benedikt Ritter: 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

Re: [CSV] Should the Builder API be optional?

2013-04-09 Thread Benedikt Ritter
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:

Re: [CSV] Should the Builder API be optional?

2013-04-09 Thread Benedikt Ritter
2013/4/9 Gary Gregory garydgreg...@gmail.com WRT org.apache.commons.csv.CSVFormat.CSVFormat(char, Character, Quote, Character, Character, boolean, boolean, String, String, String[]) There does not seem to be a good reason why this is not public. The only argument I've heard is that some

Re: [CSV] Should the Builder API be optional?

2013-04-09 Thread Adrian Crum
True. Users are free to create their own facade to make object construction easier. -Adrian On 4/9/2013 6:22 AM, Gary Gregory wrote: WRT org.apache.commons.csv.CSVFormat.CSVFormat(char, Character, Quote, Character, Character, boolean, boolean, String, String, String[]) There does not seem to

Re: [CSV] Should the Builder API be optional?

2013-04-09 Thread Emmanuel Bourg
Le 09/04/2013 08:48, Benedikt Ritter a écrit : 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

Re: [CSV] Should the Builder API be optional?

2013-04-09 Thread Emmanuel Bourg
Le 09/04/2013 07:22, Gary Gregory a écrit : WRT org.apache.commons.csv.CSVFormat.CSVFormat(char, Character, Quote, Character, Character, boolean, boolean, String, String, String[]) There does not seem to be a good reason why this is not public. The only argument I've heard is that some

Re: [CSV] Should the Builder API be optional?

2013-04-08 Thread Emmanuel Bourg
Le 07/04/2013 20:14, Benedikt Ritter a écrit : where are we standing with this? I see that Gary has added parse(Reader) to the Builder as a short cut. We were talking about making the builder less visible. How do you feel about renaming the newBuilder() methods to newFormat()? Sure why not,

Re: [CSV] Should the Builder API be optional?

2013-04-08 Thread Gary Gregory
On Mon, Apr 8, 2013 at 4:35 PM, Emmanuel Bourg ebo...@apache.org wrote: Le 07/04/2013 20:14, Benedikt Ritter a écrit : where are we standing with this? I see that Gary has added parse(Reader) to the Builder as a short cut. We were talking about making the builder less visible. How do you

Re: [CSV] Should the Builder API be optional?

2013-04-08 Thread Emmanuel Bourg
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:

Re: [CSV] Should the Builder API be optional?

2013-04-08 Thread Gary Gregory
I would be ok with making the parser and format ctors public. What else? I agree that we should not force force folks into an API pattern but here it's not a big API at least. Gary On Apr 8, 2013, at 17:02, Emmanuel Bourg ebo...@apache.org wrote: Le 08/04/2013 22:39, Gary Gregory a écrit :

Re: [CSV] Should the Builder API be optional?

2013-04-08 Thread Gary Gregory
WRT org.apache.commons.csv.CSVFormat.CSVFormat(char, Character, Quote, Character, Character, boolean, boolean, String, String, String[]) There does not seem to be a good reason why this is not public. The only argument I've heard is that some people do not like to use long ctors. But so what? If

Re: [CSV] Should the Builder API be optional?

2013-04-07 Thread Benedikt Ritter
Hey guys, where are we standing with this? I see that Gary has added parse(Reader) to the Builder as a short cut. We were talking about making the builder less visible. How do you feel about renaming the newBuilder() methods to newFormat()? Benedikt 2013/3/26 sebb seb...@gmail.com On 26

Re: [CSV] Should the Builder API be optional?

2013-04-07 Thread James Ring
+1 this is best. If the CSVParser is stateless then each of its 'with...' methods should return a new CSVParser. On Mar 26, 2013 9:03 AM, Emmanuel Bourg ebo...@apache.org wrote: Le 26/03/2013 16:58, Gary Gregory a écrit : Is it worth providing this shortcut: IterableCSVRecord parse =

[CSV] Should the Builder API be optional?

2013-03-26 Thread Gary Gregory
Hi All: This is a discussion to see if we should remove the requirement to use the builder pattern. Right now, the CSVParser Javadoc has this simple example: Reader in = new StringReader(a\tb\nc\td); CSVFormat format = new CSVFormat('\t', '', '#'); ListCSVRecord records = new CSVParser(in,

Re: [CSV] Should the Builder API be optional?

2013-03-26 Thread sebb
On 26 March 2013 14:05, Gary Gregory garydgreg...@gmail.com wrote: Hi All: This is a discussion to see if we should remove the requirement to use the builder pattern. Right now, the CSVParser Javadoc has this simple example: Reader in = new StringReader(a\tb\nc\td); CSVFormat format = new

Re: [CSV] Should the Builder API be optional?

2013-03-26 Thread Emmanuel Bourg
Le 26/03/2013 15:05, Gary Gregory a écrit : So I have two questions: Should the CSVFormat be made public? Would that make Emmanuel happy? I am guessing not due to the 9 params. If the ctor is made public, should we add a bunch of ctors for simpler or all cases? Well guessed. The whole

Re: [CSV] Should the Builder API be optional?

2013-03-26 Thread Gary Gregory
On Tue, Mar 26, 2013 at 11:18 AM, Emmanuel Bourg ebo...@apache.org wrote: Le 26/03/2013 15:05, Gary Gregory a écrit : So I have two questions: Should the CSVFormat be made public? Would that make Emmanuel happy? I am guessing not due to the 9 params. If the ctor is made public,

Re: [CSV] Should the Builder API be optional?

2013-03-26 Thread Emmanuel Bourg
Le 26/03/2013 16:31, Gary Gregory a écrit : Right, so here we are now with the fluent builder API. You've expressed discontent. So now what can we do? How do you think the API can be made better? Would you prefer to see many ctors on CVSFormat in addition to the fluent API so you can choose

Re: [CSV] Should the Builder API be optional?

2013-03-26 Thread Gary Gregory
On Tue, Mar 26, 2013 at 10:05 AM, Gary Gregory garydgreg...@gmail.comwrote: Hi All: This is a discussion to see if we should remove the requirement to use the builder pattern. Right now, the CSVParser Javadoc has this simple example: Reader in = new StringReader(a\tb\nc\td); CSVFormat

Re: [CSV] Should the Builder API be optional?

2013-03-26 Thread Simone Tripodi
Well I understand not everybody is comfortable with a fluent API, that's probably not what we are used to see in the Java sphere, but we see more and more successful projects following this pattern. There are already several CSV APIs built around the traditional constructors/accessors

Re: [CSV] Should the Builder API be optional?

2013-03-26 Thread Emmanuel Bourg
Le 26/03/2013 16:58, Gary Gregory a écrit : Is it worth providing this shortcut: IterableCSVRecord parse = CSVFormat.newBuilder(). withCommentStart('#').withDelimiter('\t').withQuoteChar('').parse(in); the builder would implement parse() I still think the builder is useless. My initial

Re: [CSV] Should the Builder API be optional?

2013-03-26 Thread Gary Gregory
On Tue, Mar 26, 2013 at 12:01 PM, Simone Tripodi simonetrip...@apache.orgwrote: Well I understand not everybody is comfortable with a fluent API, that's probably not what we are used to see in the Java sphere, but we see more and more successful projects following this pattern.

Re: [CSV] Should the Builder API be optional?

2013-03-26 Thread Gary Gregory
On Tue, Mar 26, 2013 at 10:05 AM, Gary Gregory garydgreg...@gmail.comwrote: Hi All: This is a discussion to see if we should remove the requirement to use the builder pattern. Right now, the CSVParser Javadoc has this simple example: Reader in = new StringReader(a\tb\nc\td); CSVFormat

Re: [CSV] Should the Builder API be optional?

2013-03-26 Thread Benedikt Ritter
2013/3/26 Gary Gregory garydgreg...@gmail.com On Tue, Mar 26, 2013 at 12:03 PM, Emmanuel Bourg ebo...@apache.org wrote: Le 26/03/2013 16:58, Gary Gregory a écrit : Is it worth providing this shortcut: IterableCSVRecord parse = CSVFormat.newBuilder().

Re: [CSV] Should the Builder API be optional?

2013-03-26 Thread Emmanuel Bourg
Le 26/03/2013 17:18, Benedikt Ritter a écrit : This was my attention when I initially created the patch for the builder. the newBuilder() method was called newFormat() back then. We changed it to not confuse users with what objects they are dealing with. With newBuilder() changed back to

Re: [CSV] Should the Builder API be optional?

2013-03-26 Thread sebb
On 26 March 2013 16:18, Benedikt Ritter brit...@apache.org wrote: 2013/3/26 Gary Gregory garydgreg...@gmail.com On Tue, Mar 26, 2013 at 12:03 PM, Emmanuel Bourg ebo...@apache.org wrote: Le 26/03/2013 16:58, Gary Gregory a écrit : Is it worth providing this shortcut:

Re: [CSV] Should the Builder API be optional?

2013-03-26 Thread Gary Gregory
On Tue, Mar 26, 2013 at 12:35 PM, sebb seb...@gmail.com wrote: On 26 March 2013 16:18, Benedikt Ritter brit...@apache.org wrote: 2013/3/26 Gary Gregory garydgreg...@gmail.com On Tue, Mar 26, 2013 at 12:03 PM, Emmanuel Bourg ebo...@apache.org wrote: Le 26/03/2013 16:58, Gary Gregory

Re: [CSV] Should the Builder API be optional?

2013-03-26 Thread Benedikt Ritter
2013/3/26 Gary Gregory garydgreg...@gmail.com On Tue, Mar 26, 2013 at 12:35 PM, sebb seb...@gmail.com wrote: On 26 March 2013 16:18, Benedikt Ritter brit...@apache.org wrote: 2013/3/26 Gary Gregory garydgreg...@gmail.com On Tue, Mar 26, 2013 at 12:03 PM, Emmanuel Bourg

Re: [CSV] Should the Builder API be optional?

2013-03-26 Thread sebb
On 26 March 2013 16:53, Benedikt Ritter brit...@apache.org wrote: 2013/3/26 Gary Gregory garydgreg...@gmail.com On Tue, Mar 26, 2013 at 12:35 PM, sebb seb...@gmail.com wrote: On 26 March 2013 16:18, Benedikt Ritter brit...@apache.org wrote: 2013/3/26 Gary Gregory garydgreg...@gmail.com