You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Jacopo Cappellato <ja...@gmail.com> on 2011/01/28 17:13:55 UTC

[csv] Fixes for commons-csv

Hi all,

I am a committer of the Apache OFBiz project and I am using commons-csv for a project at work.
I am wondering if there are plans to maintain the common-csv package; if I will submit some patches and small enhancements will they be considered?
If there is interest around this, I  may also be available to help to resolve some of the Jira task listed here:

https://issues.apache.org/jira/browse/SANDBOX/fixforversion/12313514

in order to be able to issue a release.

Kind regards,

Jacopo
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


RE: [csv] Fixes for commons-csv

Posted by Gary Gregory <GG...@seagullsoftware.com>.
> -----Original Message-----
> From: adrian.crum@sandglass-software.com [mailto:adrian.crum@sandglass-
> software.com]
> Sent: Tuesday, February 01, 2011 12:00
> To: dev@commons.apache.org
> Subject: RE: [csv] Fixes for commons-csv
> 
> Having a JDBC driver would make using CSV files a lot simpler. If the
> "guts" were pluggable, you could use the same driver for SDF files,
> Excel files, Open Doc data, etc.

But then you get into Eclipse ODA territory... 

How configurable does it have to be? 

For example: http://csvjdbc.sourceforge.net/

Gary

> 
> -Adrian
> 
> Quoting Gary Gregory <GG...@seagullsoftware.com>:
> 
> > Hi All,
> >
> > I've just come across the need to do CSV work but from the JDBC POV.
> >
> > This made me think of this project and whether a JDBC CSV driver
> > could use [csv] as it's guts.
> >
> > The higher-level issue though, is whether I would use [csv] at all
> > when I can use a more complete API like JDBC.
> >
> > This might explain why [csv] never made it out of the sandbox.
> >
> > My question to Jacopo is: Have you considered going the JDBC route?
> >
> > Curious,
> >
> > Gary Gregory
> > Senior Software Engineer
> > Rocket Software
> > 3340 Peachtree Road, Suite 820 . Atlanta, GA 30326 . USA
> > Tel: +1.404.760.1560
> > Email: ggregory@seagullsoftware.com
> > Web: seagull.rocketsoftware.com
> >
> >
> >
> >> -----Original Message-----
> >> From: Jacopo Cappellato [mailto:jacopo.cappellato@gmail.com]
> >> Sent: Friday, January 28, 2011 12:54
> >> To: Commons Developers List
> >> Subject: Re: [csv] Fixes for commons-csv
> >>
> >> Hi Gary,
> >>
> >> first of all, thanks for the quick response; please see my comments
> inline:
> >>
> >> On Jan 28, 2011, at 5:23 PM, Gary Gregory wrote:
> >>
> >> > Hi Jacopo,
> >> >
> >> > First, yes, please contribute updates and fixes.
> >> >
> >>
> >> Great, will do.
> >>
> >> > Would you be willing to contribute more than 'small' things to turn
> the
> >> project into a real 1.0 release?
> >>
> >> I think that the answer is "yes": we are using a snapshot for a project
> >> here at work and it would be great if we could use a real release; I
> would
> >> be happy to help in the process.
> >>
> >> Kind regards,
> >>
> >> Jacopo
> >>
> >> >
> >> > I've not looked at the component in a loooong time so I am not sure
> what
> >> would be needed.
> >> >
> >> > Gary Gregory
> >> > Senior Software Engineer
> >> > Rocket Software
> >> > 3340 Peachtree Road, Suite 820 . Atlanta, GA 30326 . USA
> >> > Tel: +1.404.760.1560
> >> > Email: ggregory@seagullsoftware.com
> >> > Web: seagull.rocketsoftware.com
> >> >
> >> >
> >> >
> >> >> -----Original Message-----
> >> >> From: Jacopo Cappellato [mailto:jacopo.cappellato@gmail.com]
> >> >> Sent: Friday, January 28, 2011 11:14
> >> >> To: dev@commons.apache.org
> >> >> Subject: [csv] Fixes for commons-csv
> >> >>
> >> >> Hi all,
> >> >>
> >> >> I am a committer of the Apache OFBiz project and I am using commons-
> csv
> >> for
> >> >> a project at work.
> >> >> I am wondering if there are plans to maintain the common-csv package;
> if
> >> I
> >> >> will submit some patches and small enhancements will they be
> considered?
> >> >> If there is interest around this, I  may also be available to help to
> >> >> resolve some of the Jira task listed here:
> >> >>
> >> >> https://issues.apache.org/jira/browse/SANDBOX/fixforversion/12313514
> >> >>
> >> >> in order to be able to issue a release.
> >> >>
> >> >> Kind regards,
> >> >>
> >> >> Jacopo
> >> >> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> >> >> For additional commands, e-mail: dev-help@commons.apache.org
> >> >
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> >> > For additional commands, e-mail: dev-help@commons.apache.org
> >> >
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> >> For additional commands, e-mail: dev-help@commons.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> > For additional commands, e-mail: dev-help@commons.apache.org
> >
> >
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


RE: [csv] Fixes for commons-csv

Posted by ad...@sandglass-software.com.
Having a JDBC driver would make using CSV files a lot simpler. If the  
"guts" were pluggable, you could use the same driver for SDF files,  
Excel files, Open Doc data, etc.

-Adrian

Quoting Gary Gregory <GG...@seagullsoftware.com>:

> Hi All,
>
> I've just come across the need to do CSV work but from the JDBC POV.
>
> This made me think of this project and whether a JDBC CSV driver  
> could use [csv] as it's guts.
>
> The higher-level issue though, is whether I would use [csv] at all  
> when I can use a more complete API like JDBC.
>
> This might explain why [csv] never made it out of the sandbox.
>
> My question to Jacopo is: Have you considered going the JDBC route?
>
> Curious,
>
> Gary Gregory
> Senior Software Engineer
> Rocket Software
> 3340 Peachtree Road, Suite 820 . Atlanta, GA 30326 . USA
> Tel: +1.404.760.1560
> Email: ggregory@seagullsoftware.com
> Web: seagull.rocketsoftware.com 
>
>
>
>> -----Original Message-----
>> From: Jacopo Cappellato [mailto:jacopo.cappellato@gmail.com]
>> Sent: Friday, January 28, 2011 12:54
>> To: Commons Developers List
>> Subject: Re: [csv] Fixes for commons-csv
>>
>> Hi Gary,
>>
>> first of all, thanks for the quick response; please see my comments inline:
>>
>> On Jan 28, 2011, at 5:23 PM, Gary Gregory wrote:
>>
>> > Hi Jacopo,
>> >
>> > First, yes, please contribute updates and fixes.
>> >
>>
>> Great, will do.
>>
>> > Would you be willing to contribute more than 'small' things to turn the
>> project into a real 1.0 release?
>>
>> I think that the answer is "yes": we are using a snapshot for a project
>> here at work and it would be great if we could use a real release; I would
>> be happy to help in the process.
>>
>> Kind regards,
>>
>> Jacopo
>>
>> >
>> > I've not looked at the component in a loooong time so I am not sure what
>> would be needed.
>> >
>> > Gary Gregory
>> > Senior Software Engineer
>> > Rocket Software
>> > 3340 Peachtree Road, Suite 820 . Atlanta, GA 30326 . USA
>> > Tel: +1.404.760.1560
>> > Email: ggregory@seagullsoftware.com
>> > Web: seagull.rocketsoftware.com
>> >
>> >
>> >
>> >> -----Original Message-----
>> >> From: Jacopo Cappellato [mailto:jacopo.cappellato@gmail.com]
>> >> Sent: Friday, January 28, 2011 11:14
>> >> To: dev@commons.apache.org
>> >> Subject: [csv] Fixes for commons-csv
>> >>
>> >> Hi all,
>> >>
>> >> I am a committer of the Apache OFBiz project and I am using commons-csv
>> for
>> >> a project at work.
>> >> I am wondering if there are plans to maintain the common-csv package; if
>> I
>> >> will submit some patches and small enhancements will they be considered?
>> >> If there is interest around this, I  may also be available to help to
>> >> resolve some of the Jira task listed here:
>> >>
>> >> https://issues.apache.org/jira/browse/SANDBOX/fixforversion/12313514
>> >>
>> >> in order to be able to issue a release.
>> >>
>> >> Kind regards,
>> >>
>> >> Jacopo
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> >> For additional commands, e-mail: dev-help@commons.apache.org
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> > For additional commands, e-mail: dev-help@commons.apache.org
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [csv] Fixes for commons-csv

Posted by Jacopo Cappellato <ja...@gmail.com>.
Hi Gary,

On Feb 1, 2011, at 3:50 PM, Gary Gregory wrote:

> Hi All,
> 
> I've just come across the need to do CSV work but from the JDBC POV.
> 
> This made me think of this project and whether a JDBC CSV driver could use [csv] as it's guts.
> 
> The higher-level issue though, is whether I would use [csv] at all when I can use a more complete API like JDBC.
> 
> This might explain why [csv] never made it out of the sandbox.
> 
> My question to Jacopo is: Have you considered going the JDBC route?

I am currently using commons-csv simply as a tool to read data from CSV files (then with custom scripts the records are processed and transformed into data for the Apache OFBiz ERP).
I have never considered the JDBC route, even if I am not 100% sure I understand how you would use this,

Kind regards,

Jacopo

> 
> Curious,
> 
> Gary Gregory
> Senior Software Engineer
> Rocket Software
> 3340 Peachtree Road, Suite 820 . Atlanta, GA 30326 . USA
> Tel: +1.404.760.1560
> Email: ggregory@seagullsoftware.com
> Web: seagull.rocketsoftware.com  
> 
> 
> 
>> -----Original Message-----
>> From: Jacopo Cappellato [mailto:jacopo.cappellato@gmail.com]
>> Sent: Friday, January 28, 2011 12:54
>> To: Commons Developers List
>> Subject: Re: [csv] Fixes for commons-csv
>> 
>> Hi Gary,
>> 
>> first of all, thanks for the quick response; please see my comments inline:
>> 
>> On Jan 28, 2011, at 5:23 PM, Gary Gregory wrote:
>> 
>>> Hi Jacopo,
>>> 
>>> First, yes, please contribute updates and fixes.
>>> 
>> 
>> Great, will do.
>> 
>>> Would you be willing to contribute more than 'small' things to turn the
>> project into a real 1.0 release?
>> 
>> I think that the answer is "yes": we are using a snapshot for a project
>> here at work and it would be great if we could use a real release; I would
>> be happy to help in the process.
>> 
>> Kind regards,
>> 
>> Jacopo
>> 
>>> 
>>> I've not looked at the component in a loooong time so I am not sure what
>> would be needed.
>>> 
>>> Gary Gregory
>>> Senior Software Engineer
>>> Rocket Software
>>> 3340 Peachtree Road, Suite 820 . Atlanta, GA 30326 . USA
>>> Tel: +1.404.760.1560
>>> Email: ggregory@seagullsoftware.com
>>> Web: seagull.rocketsoftware.com
>>> 
>>> 
>>> 
>>>> -----Original Message-----
>>>> From: Jacopo Cappellato [mailto:jacopo.cappellato@gmail.com]
>>>> Sent: Friday, January 28, 2011 11:14
>>>> To: dev@commons.apache.org
>>>> Subject: [csv] Fixes for commons-csv
>>>> 
>>>> Hi all,
>>>> 
>>>> I am a committer of the Apache OFBiz project and I am using commons-csv
>> for
>>>> a project at work.
>>>> I am wondering if there are plans to maintain the common-csv package; if
>> I
>>>> will submit some patches and small enhancements will they be considered?
>>>> If there is interest around this, I  may also be available to help to
>>>> resolve some of the Jira task listed here:
>>>> 
>>>> https://issues.apache.org/jira/browse/SANDBOX/fixforversion/12313514
>>>> 
>>>> in order to be able to issue a release.
>>>> 
>>>> Kind regards,
>>>> 
>>>> Jacopo
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>> For additional commands, e-mail: dev-help@commons.apache.org
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: dev-help@commons.apache.org
>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


RE: [csv] Fixes for commons-csv

Posted by Gary Gregory <GG...@seagullsoftware.com>.
Hi All,

I've just come across the need to do CSV work but from the JDBC POV.

This made me think of this project and whether a JDBC CSV driver could use [csv] as it's guts.

The higher-level issue though, is whether I would use [csv] at all when I can use a more complete API like JDBC.

This might explain why [csv] never made it out of the sandbox.

My question to Jacopo is: Have you considered going the JDBC route?

Curious,

Gary Gregory
Senior Software Engineer
Rocket Software
3340 Peachtree Road, Suite 820 . Atlanta, GA 30326 . USA
Tel: +1.404.760.1560
Email: ggregory@seagullsoftware.com
Web: seagull.rocketsoftware.com  



> -----Original Message-----
> From: Jacopo Cappellato [mailto:jacopo.cappellato@gmail.com]
> Sent: Friday, January 28, 2011 12:54
> To: Commons Developers List
> Subject: Re: [csv] Fixes for commons-csv
> 
> Hi Gary,
> 
> first of all, thanks for the quick response; please see my comments inline:
> 
> On Jan 28, 2011, at 5:23 PM, Gary Gregory wrote:
> 
> > Hi Jacopo,
> >
> > First, yes, please contribute updates and fixes.
> >
> 
> Great, will do.
> 
> > Would you be willing to contribute more than 'small' things to turn the
> project into a real 1.0 release?
> 
> I think that the answer is "yes": we are using a snapshot for a project
> here at work and it would be great if we could use a real release; I would
> be happy to help in the process.
> 
> Kind regards,
> 
> Jacopo
> 
> >
> > I've not looked at the component in a loooong time so I am not sure what
> would be needed.
> >
> > Gary Gregory
> > Senior Software Engineer
> > Rocket Software
> > 3340 Peachtree Road, Suite 820 . Atlanta, GA 30326 . USA
> > Tel: +1.404.760.1560
> > Email: ggregory@seagullsoftware.com
> > Web: seagull.rocketsoftware.com
> >
> >
> >
> >> -----Original Message-----
> >> From: Jacopo Cappellato [mailto:jacopo.cappellato@gmail.com]
> >> Sent: Friday, January 28, 2011 11:14
> >> To: dev@commons.apache.org
> >> Subject: [csv] Fixes for commons-csv
> >>
> >> Hi all,
> >>
> >> I am a committer of the Apache OFBiz project and I am using commons-csv
> for
> >> a project at work.
> >> I am wondering if there are plans to maintain the common-csv package; if
> I
> >> will submit some patches and small enhancements will they be considered?
> >> If there is interest around this, I  may also be available to help to
> >> resolve some of the Jira task listed here:
> >>
> >> https://issues.apache.org/jira/browse/SANDBOX/fixforversion/12313514
> >>
> >> in order to be able to issue a release.
> >>
> >> Kind regards,
> >>
> >> Jacopo
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> >> For additional commands, e-mail: dev-help@commons.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> > For additional commands, e-mail: dev-help@commons.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [csv] Fixes for commons-csv

Posted by Jacopo Cappellato <ja...@gmail.com>.
Thank you Simone!

Ciao

Jacopo

On Jan 28, 2011, at 8:39 PM, Simone Tripodi wrote:

> Hi all guys,
> count also on my help if needed, I can help on applying patches and
> for the release process.
> Looking forward for news,
> Simo
> 
> http://people.apache.org/~simonetripodi/
> http://www.99soft.org/
> 
> 
> 
> On Fri, Jan 28, 2011 at 6:54 PM, Jacopo Cappellato
> <ja...@gmail.com> wrote:
>> Hi Gary,
>> 
>> first of all, thanks for the quick response; please see my comments inline:
>> 
>> On Jan 28, 2011, at 5:23 PM, Gary Gregory wrote:
>> 
>>> Hi Jacopo,
>>> 
>>> First, yes, please contribute updates and fixes.
>>> 
>> 
>> Great, will do.
>> 
>>> Would you be willing to contribute more than 'small' things to turn the project into a real 1.0 release?
>> 
>> I think that the answer is "yes": we are using a snapshot for a project here at work and it would be great if we could use a real release; I would be happy to help in the process.
>> 
>> Kind regards,
>> 
>> Jacopo
>> 
>>> 
>>> I've not looked at the component in a loooong time so I am not sure what would be needed.
>>> 
>>> Gary Gregory
>>> Senior Software Engineer
>>> Rocket Software
>>> 3340 Peachtree Road, Suite 820 . Atlanta, GA 30326 . USA
>>> Tel: +1.404.760.1560
>>> Email: ggregory@seagullsoftware.com
>>> Web: seagull.rocketsoftware.com
>>> 
>>> 
>>> 
>>>> -----Original Message-----
>>>> From: Jacopo Cappellato [mailto:jacopo.cappellato@gmail.com]
>>>> Sent: Friday, January 28, 2011 11:14
>>>> To: dev@commons.apache.org
>>>> Subject: [csv] Fixes for commons-csv
>>>> 
>>>> Hi all,
>>>> 
>>>> I am a committer of the Apache OFBiz project and I am using commons-csv for
>>>> a project at work.
>>>> I am wondering if there are plans to maintain the common-csv package; if I
>>>> will submit some patches and small enhancements will they be considered?
>>>> If there is interest around this, I  may also be available to help to
>>>> resolve some of the Jira task listed here:
>>>> 
>>>> https://issues.apache.org/jira/browse/SANDBOX/fixforversion/12313514
>>>> 
>>>> in order to be able to issue a release.
>>>> 
>>>> Kind regards,
>>>> 
>>>> Jacopo
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>> For additional commands, e-mail: dev-help@commons.apache.org
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: dev-help@commons.apache.org
>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>> 
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [csv] Fixes for commons-csv

Posted by Simone Tripodi <si...@apache.org>.
Hi all guys,
count also on my help if needed, I can help on applying patches and
for the release process.
Looking forward for news,
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/



On Fri, Jan 28, 2011 at 6:54 PM, Jacopo Cappellato
<ja...@gmail.com> wrote:
> Hi Gary,
>
> first of all, thanks for the quick response; please see my comments inline:
>
> On Jan 28, 2011, at 5:23 PM, Gary Gregory wrote:
>
>> Hi Jacopo,
>>
>> First, yes, please contribute updates and fixes.
>>
>
> Great, will do.
>
>> Would you be willing to contribute more than 'small' things to turn the project into a real 1.0 release?
>
> I think that the answer is "yes": we are using a snapshot for a project here at work and it would be great if we could use a real release; I would be happy to help in the process.
>
> Kind regards,
>
> Jacopo
>
>>
>> I've not looked at the component in a loooong time so I am not sure what would be needed.
>>
>> Gary Gregory
>> Senior Software Engineer
>> Rocket Software
>> 3340 Peachtree Road, Suite 820 . Atlanta, GA 30326 . USA
>> Tel: +1.404.760.1560
>> Email: ggregory@seagullsoftware.com
>> Web: seagull.rocketsoftware.com
>>
>>
>>
>>> -----Original Message-----
>>> From: Jacopo Cappellato [mailto:jacopo.cappellato@gmail.com]
>>> Sent: Friday, January 28, 2011 11:14
>>> To: dev@commons.apache.org
>>> Subject: [csv] Fixes for commons-csv
>>>
>>> Hi all,
>>>
>>> I am a committer of the Apache OFBiz project and I am using commons-csv for
>>> a project at work.
>>> I am wondering if there are plans to maintain the common-csv package; if I
>>> will submit some patches and small enhancements will they be considered?
>>> If there is interest around this, I  may also be available to help to
>>> resolve some of the Jira task listed here:
>>>
>>> https://issues.apache.org/jira/browse/SANDBOX/fixforversion/12313514
>>>
>>> in order to be able to issue a release.
>>>
>>> Kind regards,
>>>
>>> Jacopo
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [csv] Fixes for commons-csv

Posted by Jacopo Cappellato <ja...@gmail.com>.
Hi Gary,

first of all, thanks for the quick response; please see my comments inline:

On Jan 28, 2011, at 5:23 PM, Gary Gregory wrote:

> Hi Jacopo,
> 
> First, yes, please contribute updates and fixes.
> 

Great, will do.

> Would you be willing to contribute more than 'small' things to turn the project into a real 1.0 release?

I think that the answer is "yes": we are using a snapshot for a project here at work and it would be great if we could use a real release; I would be happy to help in the process.

Kind regards,

Jacopo

> 
> I've not looked at the component in a loooong time so I am not sure what would be needed.
> 
> Gary Gregory
> Senior Software Engineer
> Rocket Software
> 3340 Peachtree Road, Suite 820 . Atlanta, GA 30326 . USA
> Tel: +1.404.760.1560
> Email: ggregory@seagullsoftware.com
> Web: seagull.rocketsoftware.com  
> 
> 
> 
>> -----Original Message-----
>> From: Jacopo Cappellato [mailto:jacopo.cappellato@gmail.com]
>> Sent: Friday, January 28, 2011 11:14
>> To: dev@commons.apache.org
>> Subject: [csv] Fixes for commons-csv
>> 
>> Hi all,
>> 
>> I am a committer of the Apache OFBiz project and I am using commons-csv for
>> a project at work.
>> I am wondering if there are plans to maintain the common-csv package; if I
>> will submit some patches and small enhancements will they be considered?
>> If there is interest around this, I  may also be available to help to
>> resolve some of the Jira task listed here:
>> 
>> https://issues.apache.org/jira/browse/SANDBOX/fixforversion/12313514
>> 
>> in order to be able to issue a release.
>> 
>> Kind regards,
>> 
>> Jacopo
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [csv] Proposal to remove setter methods from CSVStrategy

Posted by Simone Tripodi <si...@apache.org>.
indeed, if not, it doesn't worth the value changing the actual design :P
Have a nice WE!
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/



On Sat, Jan 29, 2011 at 9:49 PM, Gary Gregory
<GG...@seagullsoftware.com> wrote:
> Are people really using these classes in an MT way?  These seem like the kind of classes you do not share between threads. My op only though.
>
> Gary
>
> On Jan 29, 2011, at 12:27, "Simone Tripodi" <si...@apache.org> wrote:
>
>> Hi all guys!!! :)
>> I'd suggest to apply Jacopo's suggestion, making strategies' fields as
>> final would help classes becoming thread-safe; to fix the issue of
>> construction described by Stephen, it would be useful adding builder
>> classes (optionally implemented as static inner classes).
>> WDYT? HTH, that's just my opinion,
>> Simo
>>
>> http://people.apache.org/~simonetripodi/
>> http://www.99soft.org/
>>
>>
>>
>> On Sat, Jan 29, 2011 at 2:33 PM, Jacopo Cappellato
>> <ja...@gmail.com> wrote:
>>> Thank you Stephen,
>>>
>>> I understand this; alternatively we could implement a factory method that clones DEFAULT_STRATEGY, EXCEL_STRATEGY, TDF_STRATEGY; but I will definitely postpone any decision, it is not a big deal for me and we can wait for additional feedback.
>>>
>>> Jacopo
>>>
>>> On Jan 29, 2011, at 1:16 PM, Stephen Colebourne wrote:
>>>
>>>> Traditionally, many commons projects has taken no position on the
>>>> correct way to instantiate objects, whether via constructor or bean
>>>> methods. This was to allow construction from tools such as Velocity.
>>>> It is also still easier to construct using Spring via bean methods
>>>> rather than the constructor.
>>>>
>>>> These days, immutability and concurrency are more important, so this
>>>> change may be applicable, buts its good to understand the history and
>>>> wide use cases of classes like these.
>>>>
>>>> Stephen
>>>>
>>>>
>>>> On 29 January 2011 12:04, Jacopo Cappellato <ja...@gmail.com> wrote:
>>>>> Hi all,
>>>>>
>>>>> in my opinion all the setter methods should be removed from the CSVStrategy class: in this way the fields will only be set using the constructors and they will become readonly.
>>>>> The main issue I see with the current implementation is that a calling method can modify the values of the fields of the following static objects declared in CSVStrategy (changing the default behavior for all subsequent code that uses for example CSVStrategy.DEFAULT_STRATEGY):
>>>>>
>>>>>    public static CSVStrategy DEFAULT_STRATEGY = new CSVStrategy(',', '"', COMMENTS_DISABLED, ESCAPE_DISABLED, true,
>>>>>                                                                 true, false, true);
>>>>>    public static CSVStrategy EXCEL_STRATEGY   = new CSVStrategy(',', '"', COMMENTS_DISABLED, ESCAPE_DISABLED, false,
>>>>>                                                                 false, false, false);
>>>>>    public static CSVStrategy TDF_STRATEGY     = new CSVStrategy('\t', '"', COMMENTS_DISABLED, ESCAPE_DISABLED, true,
>>>>>                                                                 true, false, true);
>>>>>
>>>>> What do you think?
>>>>>
>>>>> Jacopo
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


RE: [csv] fixing code formatting inconsistencies

Posted by Gary Gregory <GG...@seagullsoftware.com>.
Do yourself a favor and use a code formatter like Eclipse's ;)

Gary Gregory
Senior Software Engineer
Rocket Software
3340 Peachtree Road, Suite 820 . Atlanta, GA 30326 . USA
Tel: +1.404.760.1560
Email: ggregory@seagullsoftware.com
Web: seagull.rocketsoftware.com  



> -----Original Message-----
> From: Jacopo Cappellato [mailto:jacopo.cappellato@gmail.com]
> Sent: Monday, January 31, 2011 06:28
> To: Commons Developers List
> Subject: Re: [csv] fixing code formatting inconsistencies
> 
> 
> On Jan 31, 2011, at 12:12 PM, Jörg Schaible wrote:
> 
> > Hi Jacopo,
> >
> > Jacopo Cappellato wrote:
> >
> >> I would like to fix some of the code formatting inconsistencies in the
> >> classes commons-csv, starting with indentation: most of the classes use
> >> the 4-blanks unit for indentation but CSVParser, CSVPrinter and
> >> ExtendedBufferedReader use a 2-blanks unit; there are also some
> >> inconsistencies within the same class. Is it ok if I apply to all of
> them
> >> 4-blanks unit for indentation? I know that each project in Commons can
> >> adopt a different formatting convention, but since in commons-csv there
> is
> >> some confusion, do we have a generic guideline for this?
> >
> > http://wiki.apache.org/commons/CodeStyle
> >
> > If you follow this, there should be no complaints - in general at least
> ;-)
> >
> 
> Thank you Jörg!
> 
> > BTW: If you apply a patch, simply resolve(*) or close the issue.
> 
> Unfortunately I don't think I have karma to do this.
> 
> Jacopo
> 
> >
> > *) My personal preference, there's no consensus. I am closing normally
> when
> > the component is finally released.
> >
> > - Jörg
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> > For additional commands, e-mail: dev-help@commons.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [csv] fixing code formatting inconsistencies

Posted by Jacopo Cappellato <ja...@gmail.com>.
Thank you Jörg.

Jacopo

On Feb 1, 2011, at 5:49 PM, Jörg Schaible wrote:

> Hi Jacopo,
> 
> Jacopo Cappellato wrote:
> 
>> 
>> On Jan 31, 2011, at 12:12 PM, Jörg Schaible wrote:
>> 
>>> Hi Jacopo,
>>> 
>>> Jacopo Cappellato wrote:
>>> 
>>>> I would like to fix some of the code formatting inconsistencies in the
>>>> classes commons-csv, starting with indentation: most of the classes use
>>>> the 4-blanks unit for indentation but CSVParser, CSVPrinter and
>>>> ExtendedBufferedReader use a 2-blanks unit; there are also some
>>>> inconsistencies within the same class. Is it ok if I apply to all of
>>>> them 4-blanks unit for indentation? I know that each project in Commons
>>>> can adopt a different formatting convention, but since in commons-csv
>>>> there is some confusion, do we have a generic guideline for this?
>>> 
>>> http://wiki.apache.org/commons/CodeStyle
>>> 
>>> If you follow this, there should be no complaints - in general at least
>>> ;-)
>>> 
>> 
>> Thank you Jörg!
>> 
>>> BTW: If you apply a patch, simply resolve(*) or close the issue.
>> 
>> Unfortunately I don't think I have karma to do this.
> 
> Granted :)
> 
> - Jörg
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [csv] fixing code formatting inconsistencies

Posted by Jörg Schaible <jo...@gmx.de>.
Hi Jacopo,

Jacopo Cappellato wrote:

> 
> On Jan 31, 2011, at 12:12 PM, Jörg Schaible wrote:
> 
>> Hi Jacopo,
>> 
>> Jacopo Cappellato wrote:
>> 
>>> I would like to fix some of the code formatting inconsistencies in the
>>> classes commons-csv, starting with indentation: most of the classes use
>>> the 4-blanks unit for indentation but CSVParser, CSVPrinter and
>>> ExtendedBufferedReader use a 2-blanks unit; there are also some
>>> inconsistencies within the same class. Is it ok if I apply to all of
>>> them 4-blanks unit for indentation? I know that each project in Commons
>>> can adopt a different formatting convention, but since in commons-csv
>>> there is some confusion, do we have a generic guideline for this?
>> 
>> http://wiki.apache.org/commons/CodeStyle
>> 
>> If you follow this, there should be no complaints - in general at least
>> ;-)
>> 
> 
> Thank you Jörg!
> 
>> BTW: If you apply a patch, simply resolve(*) or close the issue.
> 
> Unfortunately I don't think I have karma to do this.

Granted :)

- Jörg


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [csv] fixing code formatting inconsistencies

Posted by Jacopo Cappellato <ja...@gmail.com>.
On Jan 31, 2011, at 12:12 PM, Jörg Schaible wrote:

> Hi Jacopo,
> 
> Jacopo Cappellato wrote:
> 
>> I would like to fix some of the code formatting inconsistencies in the
>> classes commons-csv, starting with indentation: most of the classes use
>> the 4-blanks unit for indentation but CSVParser, CSVPrinter and
>> ExtendedBufferedReader use a 2-blanks unit; there are also some
>> inconsistencies within the same class. Is it ok if I apply to all of them
>> 4-blanks unit for indentation? I know that each project in Commons can
>> adopt a different formatting convention, but since in commons-csv there is
>> some confusion, do we have a generic guideline for this?
> 
> http://wiki.apache.org/commons/CodeStyle
> 
> If you follow this, there should be no complaints - in general at least ;-)
> 

Thank you Jörg!

> BTW: If you apply a patch, simply resolve(*) or close the issue.

Unfortunately I don't think I have karma to do this.

Jacopo

> 
> *) My personal preference, there's no consensus. I am closing normally when 
> the component is finally released.
> 
> - Jörg
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


RE: [csv] fixing code formatting inconsistencies

Posted by Gary Gregory <GG...@seagullsoftware.com>.
Note that some rules can be recorded in a Checkstyle configuration that runs as part of the Maven build.

Gary 

> -----Original Message-----
> From: Jörg Schaible [mailto:joerg.schaible@scalaris.com]
> Sent: Monday, January 31, 2011 06:12
> To: dev@commons.apache.org
> Subject: Re: [csv] fixing code formatting inconsistencies
> 
> Hi Jacopo,
> 
> Jacopo Cappellato wrote:
> 
> > I would like to fix some of the code formatting inconsistencies in the
> > classes commons-csv, starting with indentation: most of the classes use
> > the 4-blanks unit for indentation but CSVParser, CSVPrinter and
> > ExtendedBufferedReader use a 2-blanks unit; there are also some
> > inconsistencies within the same class. Is it ok if I apply to all of them
> > 4-blanks unit for indentation? I know that each project in Commons can
> > adopt a different formatting convention, but since in commons-csv there
> is
> > some confusion, do we have a generic guideline for this?
> 
> http://wiki.apache.org/commons/CodeStyle
> 
> If you follow this, there should be no complaints - in general at least ;-)
> 
> BTW: If you apply a patch, simply resolve(*) or close the issue.
> 
> *) My personal preference, there's no consensus. I am closing normally when
> the component is finally released.
> 
> - Jörg
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org


Re: [csv] fixing code formatting inconsistencies

Posted by Jörg Schaible <jo...@scalaris.com>.
Hi Jacopo,

Jacopo Cappellato wrote:

> I would like to fix some of the code formatting inconsistencies in the
> classes commons-csv, starting with indentation: most of the classes use
> the 4-blanks unit for indentation but CSVParser, CSVPrinter and
> ExtendedBufferedReader use a 2-blanks unit; there are also some
> inconsistencies within the same class. Is it ok if I apply to all of them
> 4-blanks unit for indentation? I know that each project in Commons can
> adopt a different formatting convention, but since in commons-csv there is
> some confusion, do we have a generic guideline for this?

http://wiki.apache.org/commons/CodeStyle

If you follow this, there should be no complaints - in general at least ;-)

BTW: If you apply a patch, simply resolve(*) or close the issue.

*) My personal preference, there's no consensus. I am closing normally when 
the component is finally released.

- Jörg


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


[csv] fixing code formatting inconsistencies

Posted by Jacopo Cappellato <ja...@gmail.com>.
I would like to fix some of the code formatting inconsistencies in the classes commons-csv, starting with indentation:
most of the classes use the 4-blanks unit for indentation but CSVParser, CSVPrinter and ExtendedBufferedReader use a 2-blanks unit; there are also some inconsistencies within the same class.
Is it ok if I apply to all of them 4-blanks unit for indentation?
I know that each project in Commons can adopt a different formatting convention, but since in commons-csv there is some confusion, do we have a generic guideline for this?

Kind regards,

Jacopo



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [csv] Proposal to remove setter methods from CSVStrategy

Posted by sebb <se...@gmail.com>.
On 30 January 2011 16:45, Stephen Colebourne <sc...@joda.org> wrote:
> On 30 January 2011 15:11, sebb <se...@gmail.com> wrote:
>> On 30 January 2011 09:09, Stephen Colebourne <sc...@joda.org> wrote:
>>> The modern standard for altering immutable classes was laid down by Joda-Time
>>>
>>> strategy = strategy.withCommentStart("#");
>>
>> Not sure I undestand that.
>
> An immutable setter, as in
> http://joda-time.sourceforge.net/api-release/org/joda/time/DateTime.html#withYear%28int%29

OK, I see. I though that was a Joda-Time method example, but I now see
it was translated for CSV.

> Stephen
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [csv] Proposal to remove setter methods from CSVStrategy

Posted by Stephen Colebourne <sc...@joda.org>.
On 30 January 2011 15:11, sebb <se...@gmail.com> wrote:
> On 30 January 2011 09:09, Stephen Colebourne <sc...@joda.org> wrote:
>> The modern standard for altering immutable classes was laid down by Joda-Time
>>
>> strategy = strategy.withCommentStart("#");
>
> Not sure I undestand that.

An immutable setter, as in
http://joda-time.sourceforge.net/api-release/org/joda/time/DateTime.html#withYear%28int%29

Stephen

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [csv] Proposal to remove setter methods from CSVStrategy

Posted by sebb <se...@gmail.com>.
On 30 January 2011 09:09, Stephen Colebourne <sc...@joda.org> wrote:
> The modern standard for altering immutable classes was laid down by Joda-Time
>
> strategy = strategy.withCommentStart("#");

Not sure I undestand that.

> Really, though the question is whether it shoudl be immutable or not.

+1

Whatever decision is taken needs to be documented:
if the class is intended to be immutable, then this needs to be
documented so future maintainers don't break it, and so users know it
is thread-safe.
If not immutable, then the class thread-safety still needs to be documented.

> Stephen
>
>
> On 30 January 2011 04:51, Jacopo Cappellato <ja...@gmail.com> wrote:
>> Hi Gary,
>>
>> I initially proposed the change when I noticed the following code in one of the automated tests of common-csv:
>>
>>    CSVStrategy strategy = (CSVStrategy)CSVStrategy.DEFAULT_STRATEGY.clone();
>>    strategy.setCommentStart('#');
>>    TestCSVParser parser = new TestCSVParser(new StringReader(code), strategy);
>>
>> and I realized the importance, in a calling method that alters the default settings, of using "clone".
>> But apart from this I don't have real world use cases that describe issues around this.
>>
>> Jacopo
>>
>>
>> On Jan 29, 2011, at 9:49 PM, Gary Gregory wrote:
>>
>>> Are people really using these classes in an MT way?  These seem like the kind of classes you do not share between threads. My op only though.
>>>
>>> Gary
>>>
>>> On Jan 29, 2011, at 12:27, "Simone Tripodi" <si...@apache.org> wrote:
>>>
>>>> Hi all guys!!! :)
>>>> I'd suggest to apply Jacopo's suggestion, making strategies' fields as
>>>> final would help classes becoming thread-safe; to fix the issue of
>>>> construction described by Stephen, it would be useful adding builder
>>>> classes (optionally implemented as static inner classes).
>>>> WDYT? HTH, that's just my opinion,
>>>> Simo
>>>>
>>>> http://people.apache.org/~simonetripodi/
>>>> http://www.99soft.org/
>>>>
>>>>
>>>>
>>>> On Sat, Jan 29, 2011 at 2:33 PM, Jacopo Cappellato
>>>> <ja...@gmail.com> wrote:
>>>>> Thank you Stephen,
>>>>>
>>>>> I understand this; alternatively we could implement a factory method that clones DEFAULT_STRATEGY, EXCEL_STRATEGY, TDF_STRATEGY; but I will definitely postpone any decision, it is not a big deal for me and we can wait for additional feedback.
>>>>>
>>>>> Jacopo
>>>>>
>>>>> On Jan 29, 2011, at 1:16 PM, Stephen Colebourne wrote:
>>>>>
>>>>>> Traditionally, many commons projects has taken no position on the
>>>>>> correct way to instantiate objects, whether via constructor or bean
>>>>>> methods. This was to allow construction from tools such as Velocity.
>>>>>> It is also still easier to construct using Spring via bean methods
>>>>>> rather than the constructor.
>>>>>>
>>>>>> These days, immutability and concurrency are more important, so this
>>>>>> change may be applicable, buts its good to understand the history and
>>>>>> wide use cases of classes like these.
>>>>>>
>>>>>> Stephen
>>>>>>
>>>>>>
>>>>>> On 29 January 2011 12:04, Jacopo Cappellato <ja...@gmail.com> wrote:
>>>>>>> Hi all,
>>>>>>>
>>>>>>> in my opinion all the setter methods should be removed from the CSVStrategy class: in this way the fields will only be set using the constructors and they will become readonly.
>>>>>>> The main issue I see with the current implementation is that a calling method can modify the values of the fields of the following static objects declared in CSVStrategy (changing the default behavior for all subsequent code that uses for example CSVStrategy.DEFAULT_STRATEGY):
>>>>>>>
>>>>>>>   public static CSVStrategy DEFAULT_STRATEGY = new CSVStrategy(',', '"', COMMENTS_DISABLED, ESCAPE_DISABLED, true,
>>>>>>>                                                                true, false, true);
>>>>>>>   public static CSVStrategy EXCEL_STRATEGY   = new CSVStrategy(',', '"', COMMENTS_DISABLED, ESCAPE_DISABLED, false,
>>>>>>>                                                                false, false, false);
>>>>>>>   public static CSVStrategy TDF_STRATEGY     = new CSVStrategy('\t', '"', COMMENTS_DISABLED, ESCAPE_DISABLED, true,
>>>>>>>                                                                true, false, true);
>>>>>>>
>>>>>>> What do you think?
>>>>>>>
>>>>>>> Jacopo
>>>>>>>
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>>>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>>>>
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [csv] Proposal to remove setter methods from CSVStrategy

Posted by Stephen Colebourne <sc...@joda.org>.
The modern standard for altering immutable classes was laid down by Joda-Time

strategy = strategy.withCommentStart("#");

Really, though the question is whether it shoudl be immutable or not.

Stephen


On 30 January 2011 04:51, Jacopo Cappellato <ja...@gmail.com> wrote:
> Hi Gary,
>
> I initially proposed the change when I noticed the following code in one of the automated tests of common-csv:
>
>    CSVStrategy strategy = (CSVStrategy)CSVStrategy.DEFAULT_STRATEGY.clone();
>    strategy.setCommentStart('#');
>    TestCSVParser parser = new TestCSVParser(new StringReader(code), strategy);
>
> and I realized the importance, in a calling method that alters the default settings, of using "clone".
> But apart from this I don't have real world use cases that describe issues around this.
>
> Jacopo
>
>
> On Jan 29, 2011, at 9:49 PM, Gary Gregory wrote:
>
>> Are people really using these classes in an MT way?  These seem like the kind of classes you do not share between threads. My op only though.
>>
>> Gary
>>
>> On Jan 29, 2011, at 12:27, "Simone Tripodi" <si...@apache.org> wrote:
>>
>>> Hi all guys!!! :)
>>> I'd suggest to apply Jacopo's suggestion, making strategies' fields as
>>> final would help classes becoming thread-safe; to fix the issue of
>>> construction described by Stephen, it would be useful adding builder
>>> classes (optionally implemented as static inner classes).
>>> WDYT? HTH, that's just my opinion,
>>> Simo
>>>
>>> http://people.apache.org/~simonetripodi/
>>> http://www.99soft.org/
>>>
>>>
>>>
>>> On Sat, Jan 29, 2011 at 2:33 PM, Jacopo Cappellato
>>> <ja...@gmail.com> wrote:
>>>> Thank you Stephen,
>>>>
>>>> I understand this; alternatively we could implement a factory method that clones DEFAULT_STRATEGY, EXCEL_STRATEGY, TDF_STRATEGY; but I will definitely postpone any decision, it is not a big deal for me and we can wait for additional feedback.
>>>>
>>>> Jacopo
>>>>
>>>> On Jan 29, 2011, at 1:16 PM, Stephen Colebourne wrote:
>>>>
>>>>> Traditionally, many commons projects has taken no position on the
>>>>> correct way to instantiate objects, whether via constructor or bean
>>>>> methods. This was to allow construction from tools such as Velocity.
>>>>> It is also still easier to construct using Spring via bean methods
>>>>> rather than the constructor.
>>>>>
>>>>> These days, immutability and concurrency are more important, so this
>>>>> change may be applicable, buts its good to understand the history and
>>>>> wide use cases of classes like these.
>>>>>
>>>>> Stephen
>>>>>
>>>>>
>>>>> On 29 January 2011 12:04, Jacopo Cappellato <ja...@gmail.com> wrote:
>>>>>> Hi all,
>>>>>>
>>>>>> in my opinion all the setter methods should be removed from the CSVStrategy class: in this way the fields will only be set using the constructors and they will become readonly.
>>>>>> The main issue I see with the current implementation is that a calling method can modify the values of the fields of the following static objects declared in CSVStrategy (changing the default behavior for all subsequent code that uses for example CSVStrategy.DEFAULT_STRATEGY):
>>>>>>
>>>>>>   public static CSVStrategy DEFAULT_STRATEGY = new CSVStrategy(',', '"', COMMENTS_DISABLED, ESCAPE_DISABLED, true,
>>>>>>                                                                true, false, true);
>>>>>>   public static CSVStrategy EXCEL_STRATEGY   = new CSVStrategy(',', '"', COMMENTS_DISABLED, ESCAPE_DISABLED, false,
>>>>>>                                                                false, false, false);
>>>>>>   public static CSVStrategy TDF_STRATEGY     = new CSVStrategy('\t', '"', COMMENTS_DISABLED, ESCAPE_DISABLED, true,
>>>>>>                                                                true, false, true);
>>>>>>
>>>>>> What do you think?
>>>>>>
>>>>>> Jacopo
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>>>>
>>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [csv] Proposal to remove setter methods from CSVStrategy

Posted by Jacopo Cappellato <ja...@gmail.com>.
Hi Adrian,

yes this is what I was thinking when I mentioned the factory method.

Jacopo

On Jan 30, 2011, at 8:06 AM, Adrian Crum wrote:

> From my perspective, if DEFAULT_STRATEGY, EXCEL_STRATEGY, or TDF_STRATEGY are mutable, then copies of them should be returned in a factory method. Ideally, a selector would be passed to a factory method:
> 
> CSVStrategy strategy = CSVStrategy.getInstance(CSVStrategy.DEFAULT_STRATEGY);
> 
> 
> -Adrian
> 
> 
> On 1/29/2011 8:51 PM, Jacopo Cappellato wrote:
>> Hi Gary,
>> 
>> I initially proposed the change when I noticed the following code in one of the automated tests of common-csv:
>> 
>>     CSVStrategy strategy = (CSVStrategy)CSVStrategy.DEFAULT_STRATEGY.clone();
>>     strategy.setCommentStart('#');
>>     TestCSVParser parser = new TestCSVParser(new StringReader(code), strategy);
>> 
>> and I realized the importance, in a calling method that alters the default settings, of using "clone".
>> But apart from this I don't have real world use cases that describe issues around this.
>> 
>> Jacopo
>> 
>> 
>> On Jan 29, 2011, at 9:49 PM, Gary Gregory wrote:
>> 
>>> Are people really using these classes in an MT way?  These seem like the kind of classes you do not share between threads. My op only though.
>>> 
>>> Gary
>>> 
>>> On Jan 29, 2011, at 12:27, "Simone Tripodi"<si...@apache.org>  wrote:
>>> 
>>>> Hi all guys!!! :)
>>>> I'd suggest to apply Jacopo's suggestion, making strategies' fields as
>>>> final would help classes becoming thread-safe; to fix the issue of
>>>> construction described by Stephen, it would be useful adding builder
>>>> classes (optionally implemented as static inner classes).
>>>> WDYT? HTH, that's just my opinion,
>>>> Simo
>>>> 
>>>> http://people.apache.org/~simonetripodi/
>>>> http://www.99soft.org/
>>>> 
>>>> 
>>>> 
>>>> On Sat, Jan 29, 2011 at 2:33 PM, Jacopo Cappellato
>>>> <ja...@gmail.com>  wrote:
>>>>> Thank you Stephen,
>>>>> 
>>>>> I understand this; alternatively we could implement a factory method that clones DEFAULT_STRATEGY, EXCEL_STRATEGY, TDF_STRATEGY; but I will definitely postpone any decision, it is not a big deal for me and we can wait for additional feedback.
>>>>> 
>>>>> Jacopo
>>>>> 
>>>>> On Jan 29, 2011, at 1:16 PM, Stephen Colebourne wrote:
>>>>> 
>>>>>> Traditionally, many commons projects has taken no position on the
>>>>>> correct way to instantiate objects, whether via constructor or bean
>>>>>> methods. This was to allow construction from tools such as Velocity.
>>>>>> It is also still easier to construct using Spring via bean methods
>>>>>> rather than the constructor.
>>>>>> 
>>>>>> These days, immutability and concurrency are more important, so this
>>>>>> change may be applicable, buts its good to understand the history and
>>>>>> wide use cases of classes like these.
>>>>>> 
>>>>>> Stephen
>>>>>> 
>>>>>> 
>>>>>> On 29 January 2011 12:04, Jacopo Cappellato<ja...@gmail.com>  wrote:
>>>>>>> Hi all,
>>>>>>> 
>>>>>>> in my opinion all the setter methods should be removed from the CSVStrategy class: in this way the fields will only be set using the constructors and they will become readonly.
>>>>>>> The main issue I see with the current implementation is that a calling method can modify the values of the fields of the following static objects declared in CSVStrategy (changing the default behavior for all subsequent code that uses for example CSVStrategy.DEFAULT_STRATEGY):
>>>>>>> 
>>>>>>>   public static CSVStrategy DEFAULT_STRATEGY = new CSVStrategy(',', '"', COMMENTS_DISABLED, ESCAPE_DISABLED, true,
>>>>>>>                                                                true, false, true);
>>>>>>>   public static CSVStrategy EXCEL_STRATEGY   = new CSVStrategy(',', '"', COMMENTS_DISABLED, ESCAPE_DISABLED, false,
>>>>>>>                                                                false, false, false);
>>>>>>>   public static CSVStrategy TDF_STRATEGY     = new CSVStrategy('\t', '"', COMMENTS_DISABLED, ESCAPE_DISABLED, true,
>>>>>>>                                                                true, false, true);
>>>>>>> 
>>>>>>> What do you think?
>>>>>>> 
>>>>>>> Jacopo
>>>>>>> 
>>>>>>> 
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>>>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>>>>> 
>>>>>>> 
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>>>> 
>>>>> 
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>>> 
>>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: dev-help@commons.apache.org
>>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [csv] Proposal to remove setter methods from CSVStrategy

Posted by Adrian Crum <ad...@sandglass-software.com>.
 From my perspective, if DEFAULT_STRATEGY, EXCEL_STRATEGY, or TDF_STRATEGY are mutable, then copies of them should be returned in a factory method. Ideally, a selector would be passed to a factory method:

CSVStrategy strategy = CSVStrategy.getInstance(CSVStrategy.DEFAULT_STRATEGY);


-Adrian


On 1/29/2011 8:51 PM, Jacopo Cappellato wrote:
> Hi Gary,
>
> I initially proposed the change when I noticed the following code in one of the automated tests of common-csv:
>
>      CSVStrategy strategy = (CSVStrategy)CSVStrategy.DEFAULT_STRATEGY.clone();
>      strategy.setCommentStart('#');
>      TestCSVParser parser = new TestCSVParser(new StringReader(code), strategy);
>
> and I realized the importance, in a calling method that alters the default settings, of using "clone".
> But apart from this I don't have real world use cases that describe issues around this.
>
> Jacopo
>
>
> On Jan 29, 2011, at 9:49 PM, Gary Gregory wrote:
>
>> Are people really using these classes in an MT way?  These seem like the kind of classes you do not share between threads. My op only though.
>>
>> Gary
>>
>> On Jan 29, 2011, at 12:27, "Simone Tripodi"<si...@apache.org>  wrote:
>>
>>> Hi all guys!!! :)
>>> I'd suggest to apply Jacopo's suggestion, making strategies' fields as
>>> final would help classes becoming thread-safe; to fix the issue of
>>> construction described by Stephen, it would be useful adding builder
>>> classes (optionally implemented as static inner classes).
>>> WDYT? HTH, that's just my opinion,
>>> Simo
>>>
>>> http://people.apache.org/~simonetripodi/
>>> http://www.99soft.org/
>>>
>>>
>>>
>>> On Sat, Jan 29, 2011 at 2:33 PM, Jacopo Cappellato
>>> <ja...@gmail.com>  wrote:
>>>> Thank you Stephen,
>>>>
>>>> I understand this; alternatively we could implement a factory method that clones DEFAULT_STRATEGY, EXCEL_STRATEGY, TDF_STRATEGY; but I will definitely postpone any decision, it is not a big deal for me and we can wait for additional feedback.
>>>>
>>>> Jacopo
>>>>
>>>> On Jan 29, 2011, at 1:16 PM, Stephen Colebourne wrote:
>>>>
>>>>> Traditionally, many commons projects has taken no position on the
>>>>> correct way to instantiate objects, whether via constructor or bean
>>>>> methods. This was to allow construction from tools such as Velocity.
>>>>> It is also still easier to construct using Spring via bean methods
>>>>> rather than the constructor.
>>>>>
>>>>> These days, immutability and concurrency are more important, so this
>>>>> change may be applicable, buts its good to understand the history and
>>>>> wide use cases of classes like these.
>>>>>
>>>>> Stephen
>>>>>
>>>>>
>>>>> On 29 January 2011 12:04, Jacopo Cappellato<ja...@gmail.com>  wrote:
>>>>>> Hi all,
>>>>>>
>>>>>> in my opinion all the setter methods should be removed from the CSVStrategy class: in this way the fields will only be set using the constructors and they will become readonly.
>>>>>> The main issue I see with the current implementation is that a calling method can modify the values of the fields of the following static objects declared in CSVStrategy (changing the default behavior for all subsequent code that uses for example CSVStrategy.DEFAULT_STRATEGY):
>>>>>>
>>>>>>    public static CSVStrategy DEFAULT_STRATEGY = new CSVStrategy(',', '"', COMMENTS_DISABLED, ESCAPE_DISABLED, true,
>>>>>>                                                                 true, false, true);
>>>>>>    public static CSVStrategy EXCEL_STRATEGY   = new CSVStrategy(',', '"', COMMENTS_DISABLED, ESCAPE_DISABLED, false,
>>>>>>                                                                 false, false, false);
>>>>>>    public static CSVStrategy TDF_STRATEGY     = new CSVStrategy('\t', '"', COMMENTS_DISABLED, ESCAPE_DISABLED, true,
>>>>>>                                                                 true, false, true);
>>>>>>
>>>>>> What do you think?
>>>>>>
>>>>>> Jacopo
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>>>>
>>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [csv] Proposal to remove setter methods from CSVStrategy

Posted by Jacopo Cappellato <ja...@gmail.com>.
Hi Gary,

I initially proposed the change when I noticed the following code in one of the automated tests of common-csv:

    CSVStrategy strategy = (CSVStrategy)CSVStrategy.DEFAULT_STRATEGY.clone();
    strategy.setCommentStart('#');
    TestCSVParser parser = new TestCSVParser(new StringReader(code), strategy);

and I realized the importance, in a calling method that alters the default settings, of using "clone".
But apart from this I don't have real world use cases that describe issues around this.

Jacopo


On Jan 29, 2011, at 9:49 PM, Gary Gregory wrote:

> Are people really using these classes in an MT way?  These seem like the kind of classes you do not share between threads. My op only though. 
> 
> Gary
> 
> On Jan 29, 2011, at 12:27, "Simone Tripodi" <si...@apache.org> wrote:
> 
>> Hi all guys!!! :)
>> I'd suggest to apply Jacopo's suggestion, making strategies' fields as
>> final would help classes becoming thread-safe; to fix the issue of
>> construction described by Stephen, it would be useful adding builder
>> classes (optionally implemented as static inner classes).
>> WDYT? HTH, that's just my opinion,
>> Simo
>> 
>> http://people.apache.org/~simonetripodi/
>> http://www.99soft.org/
>> 
>> 
>> 
>> On Sat, Jan 29, 2011 at 2:33 PM, Jacopo Cappellato
>> <ja...@gmail.com> wrote:
>>> Thank you Stephen,
>>> 
>>> I understand this; alternatively we could implement a factory method that clones DEFAULT_STRATEGY, EXCEL_STRATEGY, TDF_STRATEGY; but I will definitely postpone any decision, it is not a big deal for me and we can wait for additional feedback.
>>> 
>>> Jacopo
>>> 
>>> On Jan 29, 2011, at 1:16 PM, Stephen Colebourne wrote:
>>> 
>>>> Traditionally, many commons projects has taken no position on the
>>>> correct way to instantiate objects, whether via constructor or bean
>>>> methods. This was to allow construction from tools such as Velocity.
>>>> It is also still easier to construct using Spring via bean methods
>>>> rather than the constructor.
>>>> 
>>>> These days, immutability and concurrency are more important, so this
>>>> change may be applicable, buts its good to understand the history and
>>>> wide use cases of classes like these.
>>>> 
>>>> Stephen
>>>> 
>>>> 
>>>> On 29 January 2011 12:04, Jacopo Cappellato <ja...@gmail.com> wrote:
>>>>> Hi all,
>>>>> 
>>>>> in my opinion all the setter methods should be removed from the CSVStrategy class: in this way the fields will only be set using the constructors and they will become readonly.
>>>>> The main issue I see with the current implementation is that a calling method can modify the values of the fields of the following static objects declared in CSVStrategy (changing the default behavior for all subsequent code that uses for example CSVStrategy.DEFAULT_STRATEGY):
>>>>> 
>>>>>   public static CSVStrategy DEFAULT_STRATEGY = new CSVStrategy(',', '"', COMMENTS_DISABLED, ESCAPE_DISABLED, true,
>>>>>                                                                true, false, true);
>>>>>   public static CSVStrategy EXCEL_STRATEGY   = new CSVStrategy(',', '"', COMMENTS_DISABLED, ESCAPE_DISABLED, false,
>>>>>                                                                false, false, false);
>>>>>   public static CSVStrategy TDF_STRATEGY     = new CSVStrategy('\t', '"', COMMENTS_DISABLED, ESCAPE_DISABLED, true,
>>>>>                                                                true, false, true);
>>>>> 
>>>>> What do you think?
>>>>> 
>>>>> Jacopo
>>>>> 
>>>>> 
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>>> 
>>>>> 
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>> 
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: dev-help@commons.apache.org
>>> 
>>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [csv] Proposal to remove setter methods from CSVStrategy

Posted by Gary Gregory <GG...@seagullsoftware.com>.
Are people really using these classes in an MT way?  These seem like the kind of classes you do not share between threads. My op only though. 

Gary

On Jan 29, 2011, at 12:27, "Simone Tripodi" <si...@apache.org> wrote:

> Hi all guys!!! :)
> I'd suggest to apply Jacopo's suggestion, making strategies' fields as
> final would help classes becoming thread-safe; to fix the issue of
> construction described by Stephen, it would be useful adding builder
> classes (optionally implemented as static inner classes).
> WDYT? HTH, that's just my opinion,
> Simo
> 
> http://people.apache.org/~simonetripodi/
> http://www.99soft.org/
> 
> 
> 
> On Sat, Jan 29, 2011 at 2:33 PM, Jacopo Cappellato
> <ja...@gmail.com> wrote:
>> Thank you Stephen,
>> 
>> I understand this; alternatively we could implement a factory method that clones DEFAULT_STRATEGY, EXCEL_STRATEGY, TDF_STRATEGY; but I will definitely postpone any decision, it is not a big deal for me and we can wait for additional feedback.
>> 
>> Jacopo
>> 
>> On Jan 29, 2011, at 1:16 PM, Stephen Colebourne wrote:
>> 
>>> Traditionally, many commons projects has taken no position on the
>>> correct way to instantiate objects, whether via constructor or bean
>>> methods. This was to allow construction from tools such as Velocity.
>>> It is also still easier to construct using Spring via bean methods
>>> rather than the constructor.
>>> 
>>> These days, immutability and concurrency are more important, so this
>>> change may be applicable, buts its good to understand the history and
>>> wide use cases of classes like these.
>>> 
>>> Stephen
>>> 
>>> 
>>> On 29 January 2011 12:04, Jacopo Cappellato <ja...@gmail.com> wrote:
>>>> Hi all,
>>>> 
>>>> in my opinion all the setter methods should be removed from the CSVStrategy class: in this way the fields will only be set using the constructors and they will become readonly.
>>>> The main issue I see with the current implementation is that a calling method can modify the values of the fields of the following static objects declared in CSVStrategy (changing the default behavior for all subsequent code that uses for example CSVStrategy.DEFAULT_STRATEGY):
>>>> 
>>>>    public static CSVStrategy DEFAULT_STRATEGY = new CSVStrategy(',', '"', COMMENTS_DISABLED, ESCAPE_DISABLED, true,
>>>>                                                                 true, false, true);
>>>>    public static CSVStrategy EXCEL_STRATEGY   = new CSVStrategy(',', '"', COMMENTS_DISABLED, ESCAPE_DISABLED, false,
>>>>                                                                 false, false, false);
>>>>    public static CSVStrategy TDF_STRATEGY     = new CSVStrategy('\t', '"', COMMENTS_DISABLED, ESCAPE_DISABLED, true,
>>>>                                                                 true, false, true);
>>>> 
>>>> What do you think?
>>>> 
>>>> Jacopo
>>>> 
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>> 
>>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: dev-help@commons.apache.org
>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>> 
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [csv] Proposal to remove setter methods from CSVStrategy

Posted by Simone Tripodi <si...@apache.org>.
Hi all guys!!! :)
I'd suggest to apply Jacopo's suggestion, making strategies' fields as
final would help classes becoming thread-safe; to fix the issue of
construction described by Stephen, it would be useful adding builder
classes (optionally implemented as static inner classes).
WDYT? HTH, that's just my opinion,
Simo

http://people.apache.org/~simonetripodi/
http://www.99soft.org/



On Sat, Jan 29, 2011 at 2:33 PM, Jacopo Cappellato
<ja...@gmail.com> wrote:
> Thank you Stephen,
>
> I understand this; alternatively we could implement a factory method that clones DEFAULT_STRATEGY, EXCEL_STRATEGY, TDF_STRATEGY; but I will definitely postpone any decision, it is not a big deal for me and we can wait for additional feedback.
>
> Jacopo
>
> On Jan 29, 2011, at 1:16 PM, Stephen Colebourne wrote:
>
>> Traditionally, many commons projects has taken no position on the
>> correct way to instantiate objects, whether via constructor or bean
>> methods. This was to allow construction from tools such as Velocity.
>> It is also still easier to construct using Spring via bean methods
>> rather than the constructor.
>>
>> These days, immutability and concurrency are more important, so this
>> change may be applicable, buts its good to understand the history and
>> wide use cases of classes like these.
>>
>> Stephen
>>
>>
>> On 29 January 2011 12:04, Jacopo Cappellato <ja...@gmail.com> wrote:
>>> Hi all,
>>>
>>> in my opinion all the setter methods should be removed from the CSVStrategy class: in this way the fields will only be set using the constructors and they will become readonly.
>>> The main issue I see with the current implementation is that a calling method can modify the values of the fields of the following static objects declared in CSVStrategy (changing the default behavior for all subsequent code that uses for example CSVStrategy.DEFAULT_STRATEGY):
>>>
>>>    public static CSVStrategy DEFAULT_STRATEGY = new CSVStrategy(',', '"', COMMENTS_DISABLED, ESCAPE_DISABLED, true,
>>>                                                                 true, false, true);
>>>    public static CSVStrategy EXCEL_STRATEGY   = new CSVStrategy(',', '"', COMMENTS_DISABLED, ESCAPE_DISABLED, false,
>>>                                                                 false, false, false);
>>>    public static CSVStrategy TDF_STRATEGY     = new CSVStrategy('\t', '"', COMMENTS_DISABLED, ESCAPE_DISABLED, true,
>>>                                                                 true, false, true);
>>>
>>> What do you think?
>>>
>>> Jacopo
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [csv] Proposal to remove setter methods from CSVStrategy

Posted by Jacopo Cappellato <ja...@gmail.com>.
Thank you Stephen,

I understand this; alternatively we could implement a factory method that clones DEFAULT_STRATEGY, EXCEL_STRATEGY, TDF_STRATEGY; but I will definitely postpone any decision, it is not a big deal for me and we can wait for additional feedback. 

Jacopo

On Jan 29, 2011, at 1:16 PM, Stephen Colebourne wrote:

> Traditionally, many commons projects has taken no position on the
> correct way to instantiate objects, whether via constructor or bean
> methods. This was to allow construction from tools such as Velocity.
> It is also still easier to construct using Spring via bean methods
> rather than the constructor.
> 
> These days, immutability and concurrency are more important, so this
> change may be applicable, buts its good to understand the history and
> wide use cases of classes like these.
> 
> Stephen
> 
> 
> On 29 January 2011 12:04, Jacopo Cappellato <ja...@gmail.com> wrote:
>> Hi all,
>> 
>> in my opinion all the setter methods should be removed from the CSVStrategy class: in this way the fields will only be set using the constructors and they will become readonly.
>> The main issue I see with the current implementation is that a calling method can modify the values of the fields of the following static objects declared in CSVStrategy (changing the default behavior for all subsequent code that uses for example CSVStrategy.DEFAULT_STRATEGY):
>> 
>>    public static CSVStrategy DEFAULT_STRATEGY = new CSVStrategy(',', '"', COMMENTS_DISABLED, ESCAPE_DISABLED, true,
>>                                                                 true, false, true);
>>    public static CSVStrategy EXCEL_STRATEGY   = new CSVStrategy(',', '"', COMMENTS_DISABLED, ESCAPE_DISABLED, false,
>>                                                                 false, false, false);
>>    public static CSVStrategy TDF_STRATEGY     = new CSVStrategy('\t', '"', COMMENTS_DISABLED, ESCAPE_DISABLED, true,
>>                                                                 true, false, true);
>> 
>> What do you think?
>> 
>> Jacopo
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>> 
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [csv] Proposal to remove setter methods from CSVStrategy

Posted by Stephen Colebourne <sc...@joda.org>.
Traditionally, many commons projects has taken no position on the
correct way to instantiate objects, whether via constructor or bean
methods. This was to allow construction from tools such as Velocity.
It is also still easier to construct using Spring via bean methods
rather than the constructor.

These days, immutability and concurrency are more important, so this
change may be applicable, buts its good to understand the history and
wide use cases of classes like these.

Stephen


On 29 January 2011 12:04, Jacopo Cappellato <ja...@gmail.com> wrote:
> Hi all,
>
> in my opinion all the setter methods should be removed from the CSVStrategy class: in this way the fields will only be set using the constructors and they will become readonly.
> The main issue I see with the current implementation is that a calling method can modify the values of the fields of the following static objects declared in CSVStrategy (changing the default behavior for all subsequent code that uses for example CSVStrategy.DEFAULT_STRATEGY):
>
>    public static CSVStrategy DEFAULT_STRATEGY = new CSVStrategy(',', '"', COMMENTS_DISABLED, ESCAPE_DISABLED, true,
>                                                                 true, false, true);
>    public static CSVStrategy EXCEL_STRATEGY   = new CSVStrategy(',', '"', COMMENTS_DISABLED, ESCAPE_DISABLED, false,
>                                                                 false, false, false);
>    public static CSVStrategy TDF_STRATEGY     = new CSVStrategy('\t', '"', COMMENTS_DISABLED, ESCAPE_DISABLED, true,
>                                                                 true, false, true);
>
> What do you think?
>
> Jacopo
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


[csv] Proposal to remove setter methods from CSVStrategy

Posted by Jacopo Cappellato <ja...@gmail.com>.
Hi all,

in my opinion all the setter methods should be removed from the CSVStrategy class: in this way the fields will only be set using the constructors and they will become readonly.
The main issue I see with the current implementation is that a calling method can modify the values of the fields of the following static objects declared in CSVStrategy (changing the default behavior for all subsequent code that uses for example CSVStrategy.DEFAULT_STRATEGY):

    public static CSVStrategy DEFAULT_STRATEGY = new CSVStrategy(',', '"', COMMENTS_DISABLED, ESCAPE_DISABLED, true,
                                                                 true, false, true);
    public static CSVStrategy EXCEL_STRATEGY   = new CSVStrategy(',', '"', COMMENTS_DISABLED, ESCAPE_DISABLED, false,
                                                                 false, false, false);
    public static CSVStrategy TDF_STRATEGY     = new CSVStrategy('\t', '"', COMMENTS_DISABLED, ESCAPE_DISABLED, true,
                                                                 true, false, true);

What do you think?

Jacopo


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


RE: [csv] Fixes for commons-csv

Posted by Gary Gregory <GG...@seagullsoftware.com>.
Hi Jacopo,

First, yes, please contribute updates and fixes.

Would you be willing to contribute more than 'small' things to turn the project into a real 1.0 release?

I've not looked at the component in a loooong time so I am not sure what would be needed.

Gary Gregory
Senior Software Engineer
Rocket Software
3340 Peachtree Road, Suite 820 . Atlanta, GA 30326 . USA
Tel: +1.404.760.1560
Email: ggregory@seagullsoftware.com
Web: seagull.rocketsoftware.com  



> -----Original Message-----
> From: Jacopo Cappellato [mailto:jacopo.cappellato@gmail.com]
> Sent: Friday, January 28, 2011 11:14
> To: dev@commons.apache.org
> Subject: [csv] Fixes for commons-csv
> 
> Hi all,
> 
> I am a committer of the Apache OFBiz project and I am using commons-csv for
> a project at work.
> I am wondering if there are plans to maintain the common-csv package; if I
> will submit some patches and small enhancements will they be considered?
> If there is interest around this, I  may also be available to help to
> resolve some of the Jira task listed here:
> 
> https://issues.apache.org/jira/browse/SANDBOX/fixforversion/12313514
> 
> in order to be able to issue a release.
> 
> Kind regards,
> 
> Jacopo
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [csv] Fixes for commons-csv

Posted by Phil Steitz <ph...@gmail.com>.
Welcome to Commons!

Phil

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [csv] Fixes for commons-csv

Posted by Jacopo Cappellato <ja...@gmail.com>.
Thanks Jörg!

Jacopo

On Jan 30, 2011, at 4:54 PM, Jörg Schaible wrote:

> Hi Jacopo,
> 
> Jacopo Cappellato wrote:
> 
>> Thank you Jörg.
>> 
>> At this point I would be happy to get karma for the sandbox (my account is
>> jacopoc): of course I will be very careful about my commits and I will
>> discuss any ideas here before.
> 
> You have karma now.
> 
> Cheers,
> Jörg
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [csv] Fixes for commons-csv

Posted by Jörg Schaible <jo...@gmx.de>.
Hi Jacopo,

Jacopo Cappellato wrote:

> Thank you Jörg.
> 
> At this point I would be happy to get karma for the sandbox (my account is
> jacopoc): of course I will be very careful about my commits and I will
> discuss any ideas here before.

You have karma now.

Cheers,
Jörg


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [csv] Fixes for commons-csv

Posted by Jacopo Cappellato <ja...@gmail.com>.
Thank you Jörg.

At this point I would be happy to get karma for the sandbox (my account is jacopoc): of course I will be very careful about my commits and I will discuss any ideas here before.

Kind regards,

Jacopo


On Jan 29, 2011, at 1:37 PM, Jörg Schaible wrote:

> Hi Jacopo,
> 
> Jacopo Cappellato wrote:
> 
>> Hi all,
>> 
>> I am a committer of the Apache OFBiz project and I am using commons-csv
>> for a project at work. I am wondering if there are plans to maintain the
>> common-csv package; if I will submit some patches and small enhancements
>> will they be considered?
> 
> Actually any ASF committer can have karma for the sandbox here in Commons 
> (see "The Sandbox" in http://wiki.apache.org/commons/CommonsEtiquette). 
> Simply ask for it :)
> 
> It's always preferred to keep track of changes for a component using JIRA 
> and discuss design or restructurings here on the list though.
> 
>> If there is interest around this, I  may also be available to help to
>> resolve some of the Jira task listed here:
>> 
>> https://issues.apache.org/jira/browse/SANDBOX/fixforversion/12313514
>> 
>> in order to be able to issue a release.
> 
> Sounds good.
> 
> - Jörg
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [csv] Fixes for commons-csv

Posted by Jörg Schaible <jo...@gmx.de>.
Hi Jacopo,

Jacopo Cappellato wrote:

> Hi all,
> 
> I am a committer of the Apache OFBiz project and I am using commons-csv
> for a project at work. I am wondering if there are plans to maintain the
> common-csv package; if I will submit some patches and small enhancements
> will they be considered?

Actually any ASF committer can have karma for the sandbox here in Commons 
(see "The Sandbox" in http://wiki.apache.org/commons/CommonsEtiquette). 
Simply ask for it :)

It's always preferred to keep track of changes for a component using JIRA 
and discuss design or restructurings here on the list though.

> If there is interest around this, I  may also be available to help to
> resolve some of the Jira task listed here:
> 
> https://issues.apache.org/jira/browse/SANDBOX/fixforversion/12313514
> 
> in order to be able to issue a release.

Sounds good.

- Jörg


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [csv] Fixes for commons-csv

Posted by Jacopo Cappellato <ja...@gmail.com>.
On Jan 30, 2011, at 10:17 PM, Niall Pemberton wrote:

> On Fri, Jan 28, 2011 at 4:13 PM, Jacopo Cappellato
> <ja...@gmail.com> wrote:
>> Hi all,
>> 
>> I am a committer of the Apache OFBiz project and I am using commons-csv for a project at work.
>> I am wondering if there are plans to maintain the common-csv package; if I will submit some patches and small enhancements will they be considered?
>> If there is interest around this, I  may also be available to help to resolve some of the Jira task listed here:
>> 
>> https://issues.apache.org/jira/browse/SANDBOX/fixforversion/12313514
>> 
>> in order to be able to issue a release.
> 
> A word of caution - Commons policy is that no Sandbox components can
> issue releases (and csv is in the Sandbox). So you will need to
> persuade the commons community to promote csv to be a "proper"
> component first.

Thank you Neal,

I am aware of the policies for the Sandbox; at the moment I am more interested in improving the commons-csv code a bit rather than having a proper component and then release and focusing on the tasks that in Jira have been assigned to the "CSV1.0 version" seem a good start to me.
But I understand that fixing all these issues doesn't mean that the product will be officially released.

Jacopo

> 
> Niall
> 
>> Kind regards,
>> 
>> Jacopo
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>> 
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [csv] Fixes for commons-csv

Posted by Niall Pemberton <ni...@gmail.com>.
On Fri, Jan 28, 2011 at 4:13 PM, Jacopo Cappellato
<ja...@gmail.com> wrote:
> Hi all,
>
> I am a committer of the Apache OFBiz project and I am using commons-csv for a project at work.
> I am wondering if there are plans to maintain the common-csv package; if I will submit some patches and small enhancements will they be considered?
> If there is interest around this, I  may also be available to help to resolve some of the Jira task listed here:
>
> https://issues.apache.org/jira/browse/SANDBOX/fixforversion/12313514
>
> in order to be able to issue a release.

A word of caution - Commons policy is that no Sandbox components can
issue releases (and csv is in the Sandbox). So you will need to
persuade the commons community to promote csv to be a "proper"
component first.

Niall

> Kind regards,
>
> Jacopo
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org