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 <[EMAIL PROTECTED]>
To: Jakarta Commons Developers List <[email protected]>
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
Stefan Rufer | [EMAIL PROTECTED]
phone +41 (0)44 247 79 92 | fax +41 (0)44 247 70 75
Netcetera AG | 8040 Zürich | Switzerland | http://netcetera.ch
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to