Hi,

while looking through the code, I was asking myself why we expose
implementation classes. Wouldn't it be better to extract interfaces from
CSVParser, CSVPrinter and CSVRecord? At least for the CSVRecord it would
make sense because users cannot create CSVRecord instances. Why binding
them to a concrete implementation?
Since CSVParser und CSVPrinter can only be created using the default ctor,
users would have to write something like (and though still defining a
dependency to the concrete implemenation):

CSVPrinter printer = new DefaultCSVPrinter(in, format);

It would even make sense to extract an Interface for Lexer and CSVLexer
although it is only used internally. Having an abstract class (Lexer) that
defines a abstract method, that is not used in one of the other methods,
but just defines an interface feels strange. And if we decide to expose the
lexer, so that users can plugin their own lexer implementations (for what
ever reason...) we would be set up for this.

WDYT?
Benedikt

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

Reply via email to