2013/8/8 Emmanuel Bourg <ebo...@apache.org>

> Le 08/08/2013 15:40, Gary Gregory a écrit :
>
> > Sans type names:
> >
> > parse(File, CSVFormat)
> > parse(String, Charset, ClassLoader, CSVFormat)
> > parse(String, Charset, CSVFormat)
> > [parse(String)]
> > parse(String, CSVFormat)
> > parse(URL, Charset, CSVFormat)
>
> That looks better. I would remove the methods for a classpath resource,
> that's a less common case. That would make:
>
> parse(File, CSVFormat)
> parse(String, CSVFormat)
> parse(URL, Charset, CSVFormat)
>
> And you probably want a charset for the File too.
>
>
> > [I'd probably remove parse(String) so that all APIs take a CSVFormat.]
>
> +1.
>
> And at this point you realize they could belong to CSVFormat, because
> they all need one to operate.
>
>     format.parse(file):
>

A format can parse something... That sounds strange to me.
Let's rename it to

   format.createParser(file)

I'm +1 for having only one place to create parsers.
And having less parameters is (in most cases) better.


>
> instead of:
>
>     CSVParser.parse(file, format);
>
>
> Emmanuel Bourg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org
>
>


-- 
http://people.apache.org/~britter/
http://www.systemoutprintln.de/
http://twitter.com/BenediktRitter
http://github.com/britter

Reply via email to