commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Rufer <stefan.ru...@netcetera.ch>
Subject Re: [csv] csv writer..
Date Tue, 14 Feb 2006 20:35:17 GMT
Sometimes one has to knock twice :-)

Basically I think it's a fine idea to have a csv writer with fixed width / 
separators configurable!

Additionally, my thoughts about the code:

IMO it's desirable to integrate CSVWriter and CSVPrinter - already the 
names state that they do very similar things and escaping/setting 
delimiters and so on is coded twice. Either use inheritance to extend 
CSVPrinter or (maybe even better) a delegation approach to add the 
additional functionality. For exaample methods like 
CSVPrinter.println(String[]) could be used to print in the fixed order 
given in the input array (with padding according to the config) and 
CSVWriter.writeRecord(Map) would only delegate to the CSVPrinter.

Then having a CSVConfig to set the different parameters looks good - 
especially with the load of parameters that are available. That's a thing 
the CSVPrinter could use as well.


Comments welcome!

cu
Stefan

On Fri, 10 Feb 2006, Martin van den Bemt wrote:

> From: Martin van den Bemt <mllist@mvdb.net>
> To: Jakarta Commons Developers List <commons-dev@jakarta.apache.org>
> Subject: Re: [csv] csv writer..
> Date: Fri, 10 Feb 2006 21:21:37 +0100
> 
> ping :)
>
> Mvgr,
> Martin
>
> Martin van den Bemt wrote:
>> My initial stuff has been committed. Let me know if it is usefull or 
>> someone wants it removed..
>> (package org.apache.commons.csv.writer)
>> It already does some (for me) usefull writing :)
>> 
>> Mvgr,
>> Martin
>> 
>> Martin van den Bemt wrote:
>> 
>>> Hi everyone (specifically Henri I guess),
>>> 
>>> I need to write a csv writer (fixed size columns, semi colon seperators, 
>>> etc) and I can do 2 things :
>>> 1) Create it as a project of my own.
>>> 2) Put in the csv component.
>>> 
>>> I prefer in this case the second and I will do my best to make it 
>>> something really nice, but it may not be exactly what people had in mind.
>>> 
>>> First goal is to get the job done I need, later goals are to make it 
>>> pretty..
>>> 
>>> Any objections doing my stuff in the csv component ?
>>> 
>>> Mvgr,
>>> Martin
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>>> 
>>> 
>>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>> 
>> 
>> 
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>

--
Stefan Rufer | stefan.rufer@netcetera.ch
phone +41 (0)44 247 79 92 | fax +41 (0)44 247 70 75
Netcetera AG | 8040 Z├╝rich | Switzerland | http://netcetera.ch

Mime
View raw message