[csv] Object Mapping Proposal

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

[csv] Object Mapping Proposal

Ulbricht, Frank

Hello there,

 

about 15 years ago I started to write a CSV library. Our company is using it for a long time now. Over the time a lot of interesting features were added. Now I have decided to replace it with the commons-csv. This API looks very good and it provides some low-level features our library is missing (e.g. multi-line records with escaping).

 

Nevertheless, we have a lot of high-level features for easily mapping between objects and the csv files. I am planning to migrate those to use the commons-csv for the I/O work. And I want to use this chance to redesign our APIs.

 

Now a thought crossed my mind, how about contributing this to the commons-csv? In order to get an idea want I am planning to do I have attached a sample project to this mail. It is just an idea, far from being perfect. It shall demonstrate how it may look like one day.

 

Sure, in the moment this sample uses a lot of pretty cool Java 8 stuff, but there are ways to make it available to earlier Java versions too.

 

Please have a look at the class “CSVObjectParserTest” it and tell me what you think.

 

Thank you,

Frank.

 

P.S. Looks like my previous mail was ignored because the subscription process was not yet finished. If not, please ignore the duplicate mail.



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

commons-csv.zip (10K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [csv] Object Mapping Proposal

Bruno P. Kinoshita
Hi Frank,
Is the project hosted in GitHub too? 
I think it sounds like a good and useful idea to include it in commons-csv. Last week I had to import some mainframe files using a Cobol copybook, with hundreds of fields, into Hadoop HDFS. I converted the file into a CSV, but some fields were multiline (or had binary content with \n, \r, etc).

I had to hack the code and escape these values before using the data. Probably your code could have saved me some time :) I tried to use commons-csv and Python for pre-processing the csv after reading the Cobol, but with no luck.

Thanks!Bruno
 

      From: "Ulbricht, Frank" <[hidden email]>
 To: "[hidden email]" <[hidden email]>
 Sent: Friday, November 28, 2014 6:13 AM
 Subject: [csv] Object Mapping Proposal
   
 <!--#yiv9591682121 _filtered #yiv9591682121 {font-family:"Cambria Math";panose-1:2 4 5 3 5 4 6 3 2 4;} _filtered #yiv9591682121 {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;}#yiv9591682121 #yiv9591682121 p.yiv9591682121MsoNormal, #yiv9591682121 li.yiv9591682121MsoNormal, #yiv9591682121 div.yiv9591682121MsoNormal {margin:0cm;margin-bottom:.0001pt;font-size:12.0pt;font-family:"Times New Roman", serif;}#yiv9591682121 a:link, #yiv9591682121 span.yiv9591682121MsoHyperlink {color:#0563C1;text-decoration:underline;}#yiv9591682121 a:visited, #yiv9591682121 span.yiv9591682121MsoHyperlinkFollowed {color:#954F72;text-decoration:underline;}#yiv9591682121 span.yiv9591682121E-MailFormatvorlage17 {font-family:"Calibri", sans-serif;color:windowtext;}#yiv9591682121 .yiv9591682121MsoChpDefault {font-family:"Calibri", sans-serif;} _filtered #yiv9591682121 {margin:70.85pt 70.85pt 2.0cm 70.85pt;}#yiv9591682121 div.yiv9591682121WordSection1 {}-->Hello there,    about 15 years ago I started to write a CSV library. Our company is using it for a long time now. Over the time a lot of interesting features were added. Now I have decided to replace it with the commons-csv. This API looks very good and it provides some low-level features our library is missing (e.g. multi-line records with escaping).    Nevertheless, we have a lot of high-level features for easily mapping between objects and the csv files. I am planning to migrate those to use the commons-csv for the I/O work. And I want to use this chance to redesign our APIs.    Now a thought crossed my mind, how about contributing this to the commons-csv? In order to get an idea want I am planning to do I have attached a sample project to this mail. It is just an idea, far from being perfect. It shall demonstrate how it may look like one day.    Sure, in the moment this sample uses a lot of pretty cool Java 8 stuff, but there are ways to make it available to earlier Java versions too.    Please have a look at the class “CSVObjectParserTest” it and tell me what you think.    Thank you, Frank.    P.S. Looks like my previous mail was ignored because the subscription process was not yet finished. If not, please ignore the duplicate mail.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

   
Reply | Threaded
Open this post in threaded view
|

Re: [csv] Object Mapping Proposal

garydgregory
In reply to this post by Ulbricht, Frank
How would mapping have helped you?

Gary 

<div>-------- Original message --------</div><div>From: "Bruno P. Kinoshita" <[hidden email]> </div><div>Date:11/28/2014  11:00  (GMT-05:00) </div><div>To: Commons Developers List <[hidden email]> </div><div>Cc:  </div><div>Subject: Re: [csv] Object Mapping Proposal </div><div>
</div>Hi Frank,
Is the project hosted in GitHub too?
I think it sounds like a good and useful idea to include it in commons-csv. Last week I had to import some mainframe files using a Cobol copybook, with hundreds of fields, into Hadoop HDFS. I converted the file into a CSV, but some fields were multiline (or had binary content with \n, \r, etc).

I had to hack the code and escape these values before using the data. Probably your code could have saved me some time :) I tried to use commons-csv and Python for pre-processing the csv after reading the Cobol, but with no luck.

Thanks!Bruno


      From: "Ulbricht, Frank" <[hidden email]>
To: "[hidden email]" <[hidden email]>
Sent: Friday, November 28, 2014 6:13 AM
Subject: [csv] Object Mapping Proposal
   
<!--#yiv9591682121 _filtered #yiv9591682121 {font-family:"Cambria Math";panose-1:2 4 5 3 5 4 6 3 2 4;} _filtered #yiv9591682121 {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;}#yiv9591682121 #yiv9591682121 p.yiv9591682121MsoNormal, #yiv9591682121 li.yiv9591682121MsoNormal, #yiv9591682121 div.yiv9591682121MsoNormal {margin:0cm;margin-bottom:.0001pt;font-size:12.0pt;font-family:"Times New Roman", serif;}#yiv9591682121 a:link, #yiv9591682121 span.yiv9591682121MsoHyperlink {color:#0563C1;text-decoration:underline;}#yiv9591682121 a:visited, #yiv9591682121 span.yiv9591682121MsoHyperlinkFollowed {color:#954F72;text-decoration:underline;}#yiv9591682121 span.yiv9591682121E-MailFormatvorlage17 {font-family:"Calibri", sans-serif;color:windowtext;}#yiv9591682121 .yiv9591682121MsoChpDefault {font-family:"Calibri", sans-serif;} _filtered #yiv9591682121 {margin:70.85pt 70.85pt 2.0cm 70.85pt;}#yiv9591682121 div.yiv9591682121WordSection1 {}-->Hello there,    about 15 years ago I started to write a CSV library. Our company is using it for a long time now. Over the time a lot of interesting features were added. Now I have decided to replace it with the commons-csv. This API looks very good and it provides some low-level features our library is missing (e.g. multi-line records with escaping).    Nevertheless, we have a lot of high-level features for easily mapping between objects and the csv files. I am planning to migrate those to use the commons-csv for the I/O work. And I want to use this chance to redesign our APIs.    Now a thought crossed my mind, how about contributing this to the commons-csv? In order to get an idea want I am planning to do I have attached a sample project to this mail. It is just an idea, far from being perfect. It shall demonstrate how it may look like one day.    Sure, in the moment this sample uses a lot of pretty cool Java 8 stuff, but there are ways to make it available to earlier Java versions too.    Please have a look at the class “CSVObjectParserTest” it and tell me what you think.    Thank you, Frank.    P.S. Looks like my previous mail was ignored because the subscription process was not yet finished. If not, please ignore the duplicate mail.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

   
Reply | Threaded
Open this post in threaded view
|

RE: [csv] Object Mapping Proposal

garydgregory
In reply to this post by Ulbricht, Frank
This is probably out of scope for a light weight component like Commons CSV. You could use Hibernate for all your mapping needs.

Gary 

<div>-------- Original message --------</div><div>From: "Ulbricht, Frank" <[hidden email]> </div><div>Date:11/28/2014  03:13  (GMT-05:00) </div><div>To: [hidden email] </div><div>Cc:  </div><div>Subject: [csv] Object Mapping Proposal </div><div>
</div>Hello there,
 
about 15 years ago I started to write a CSV library. Our company is using it for a long time now. Over the time a lot of interesting features were added. Now I have decided to replace it with the commons-csv. This API looks very good and it provides some low-level features our library is missing (e.g. multi-line records with escaping).
 
Nevertheless, we have a lot of high-level features for easily mapping between objects and the csv files. I am planning to migrate those to use the commons-csv for the I/O work. And I want to use this chance to redesign our APIs.
 
Now a thought crossed my mind, how about contributing this to the commons-csv? In order to get an idea want I am planning to do I have attached a sample project to this mail. It is just an idea, far from being perfect. It shall demonstrate how it may look like one day.
 
Sure, in the moment this sample uses a lot of pretty cool Java 8 stuff, but there are ways to make it available to earlier Java versions too.
 
Please have a look at the class “CSVObjectParserTest” it and tell me what you think.
 
Thank you,
Frank.
 
P.S. Looks like my previous mail was ignored because the subscription process was not yet finished. If not, please ignore the duplicate mail.
Reply | Threaded
Open this post in threaded view
|

Re: [csv] Object Mapping Proposal

Matt Benson-2
In reply to this post by Bruno P. Kinoshita
Bruno, it sounds like you could have used the [flatfile] component from the
Commons sandbox. ;-)

Matt
On Nov 28, 2014 10:01 AM, "Bruno P. Kinoshita" <[hidden email]>
wrote:

> Hi Frank,
> Is the project hosted in GitHub too?
> I think it sounds like a good and useful idea to include it in
> commons-csv. Last week I had to import some mainframe files using a Cobol
> copybook, with hundreds of fields, into Hadoop HDFS. I converted the file
> into a CSV, but some fields were multiline (or had binary content with \n,
> \r, etc).
>
> I had to hack the code and escape these values before using the data.
> Probably your code could have saved me some time :) I tried to use
> commons-csv and Python for pre-processing the csv after reading the Cobol,
> but with no luck.
>
> Thanks!Bruno
>
>
>       From: "Ulbricht, Frank" <[hidden email]>
>  To: "[hidden email]" <[hidden email]>
>  Sent: Friday, November 28, 2014 6:13 AM
>  Subject: [csv] Object Mapping Proposal
>
>  <!--#yiv9591682121 _filtered #yiv9591682121 {font-family:"Cambria
> Math";panose-1:2 4 5 3 5 4 6 3 2 4;} _filtered #yiv9591682121
> {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;}#yiv9591682121
> #yiv9591682121 p.yiv9591682121MsoNormal, #yiv9591682121
> li.yiv9591682121MsoNormal, #yiv9591682121 div.yiv9591682121MsoNormal
> {margin:0cm;margin-bottom:.0001pt;font-size:12.0pt;font-family:"Times New
> Roman", serif;}#yiv9591682121 a:link, #yiv9591682121
> span.yiv9591682121MsoHyperlink
> {color:#0563C1;text-decoration:underline;}#yiv9591682121 a:visited,
> #yiv9591682121 span.yiv9591682121MsoHyperlinkFollowed
> {color:#954F72;text-decoration:underline;}#yiv9591682121
> span.yiv9591682121E-MailFormatvorlage17 {font-family:"Calibri",
> sans-serif;color:windowtext;}#yiv9591682121 .yiv9591682121MsoChpDefault
> {font-family:"Calibri", sans-serif;} _filtered #yiv9591682121
> {margin:70.85pt 70.85pt 2.0cm 70.85pt;}#yiv9591682121
> div.yiv9591682121WordSection1 {}-->Hello there,    about 15 years ago I
> started to write a CSV library. Our company is using it for a long time
> now. Over the time a lot of interesting features were added. Now I have
> decided to replace it with the commons-csv. This API looks very good and it
> provides some low-level features our library is missing (e.g. multi-line
> records with escaping).    Nevertheless, we have a lot of high-level
> features for easily mapping between objects and the csv files. I
> am planning to migrate those to use the commons-csv for the I/O work. And I
> want to use this chance to redesign our APIs.    Now a thought crossed my
> mind, how about contributing this to the commons-csv? In order to get an
> idea want I am planning to do I have attached a sample project to this
> mail. It is just an idea, far from being perfect. It shall demonstrate how
> it may look like one day.    Sure, in the moment this sample uses a lot of
> pretty cool Java 8 stuff, but there are ways to make it available to
> earlier Java versions too.    Please have a look at the class
> “CSVObjectParserTest” it and tell me what you think.    Thank you, Frank.
>   P.S. Looks like my previous mail was ignored because the subscription
> process was not yet finished. If not, please ignore the duplicate mail.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: [csv] Object Mapping Proposal

Bruno P. Kinoshita
Hi Matt!!
I had a look at flatfile, but to be honest I couldn't undestand how it works. Will check out the source code to play with it later.
Bruno

 
      From: Matt Benson <[hidden email]>
 To: Bruno P. Kinoshita <[hidden email]>; [hidden email]
 Sent: Friday, November 28, 2014 4:57 PM
 Subject: Re: [csv] Object Mapping Proposal
   
Bruno, it sounds like you could have used the [flatfile] component from the
Commons sandbox. ;-)

Matt
On Nov 28, 2014 10:01 AM, "Bruno P. Kinoshita" <[hidden email]>
wrote:

> Hi Frank,
> Is the project hosted in GitHub too?
> I think it sounds like a good and useful idea to include it in
> commons-csv. Last week I had to import some mainframe files using a Cobol
> copybook, with hundreds of fields, into Hadoop HDFS. I converted the file
> into a CSV, but some fields were multiline (or had binary content with \n,
> \r, etc).
>
> I had to hack the code and escape these values before using the data.
> Probably your code could have saved me some time :) I tried to use
> commons-csv and Python for pre-processing the csv after reading the Cobol,
> but with no luck.
>
> Thanks!Bruno
>
>
>      From: "Ulbricht, Frank" <[hidden email]>
>  To: "[hidden email]" <[hidden email]>
>  Sent: Friday, November 28, 2014 6:13 AM
>  Subject: [csv] Object Mapping Proposal
>
>  <!--#yiv9591682121 _filtered #yiv9591682121 {font-family:"Cambria
> Math";panose-1:2 4 5 3 5 4 6 3 2 4;} _filtered #yiv9591682121
> {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;}#yiv9591682121
> #yiv9591682121 p.yiv9591682121MsoNormal, #yiv9591682121
> li.yiv9591682121MsoNormal, #yiv9591682121 div.yiv9591682121MsoNormal
> {margin:0cm;margin-bottom:.0001pt;font-size:12.0pt;font-family:"Times New
> Roman", serif;}#yiv9591682121 a:link, #yiv9591682121
> span.yiv9591682121MsoHyperlink
> {color:#0563C1;text-decoration:underline;}#yiv9591682121 a:visited,
> #yiv9591682121 span.yiv9591682121MsoHyperlinkFollowed
> {color:#954F72;text-decoration:underline;}#yiv9591682121
> span.yiv9591682121E-MailFormatvorlage17 {font-family:"Calibri",
> sans-serif;color:windowtext;}#yiv9591682121 .yiv9591682121MsoChpDefault
> {font-family:"Calibri", sans-serif;} _filtered #yiv9591682121
> {margin:70.85pt 70.85pt 2.0cm 70.85pt;}#yiv9591682121
> div.yiv9591682121WordSection1 {}-->Hello there,    about 15 years ago I


> started to write a CSV library. Our company is using it for a long time
> now. Over the time a lot of interesting features were added. Now I have
> decided to replace it with the commons-csv. This API looks very good and it
> provides some low-level features our library is missing (e.g. multi-line
> records with escaping).    Nevertheless, we have a lot of high-level
> features for easily mapping between objects and the csv files. I
> am planning to migrate those to use the commons-csv for the I/O work. And I
> want to use this chance to redesign our APIs.    Now a thought crossed my
> mind, how about contributing this to the commons-csv? In order to get an
> idea want I am planning to do I have attached a sample project to this
> mail. It is just an idea, far from being perfect. It shall demonstrate how
> it may look like one day.    Sure, in the moment this sample uses a lot of
> pretty cool Java 8 stuff, but there are ways to make it available to
> earlier Java versions too.    Please have a look at the class
> “CSVObjectParserTest” it and tell me what you think.    Thank you, Frank.
>  P.S. Looks like my previous mail was ignored because the subscription
> process was not yet finished. If not, please ignore the duplicate mail.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
>

   
Reply | Threaded
Open this post in threaded view
|

Re: [csv] Object Mapping Proposal

Bruno P. Kinoshita
In reply to this post by garydgregory
Ops, got excited about the multiline feature (which I'd be +1 for an issue with a patch for [csv]), but reading the title of the thread I realize that the proposal is for Object Mapping :)

It wouldn't have helped me at all.

Sorry
Bruno
 

      From: Gary Gregory <[hidden email]>
 To: Commons Developers List <[hidden email]>
 Sent: Friday, November 28, 2014 4:35 PM
 Subject: Re: [csv] Object Mapping Proposal
   
How would mapping have helped you?

Gary 

<div>-------- Original message --------</div><div>From: "Bruno P. Kinoshita" <[hidden email]> </div><div>Date:11/28/2014  11:00  (GMT-05:00) </div><div>To: Commons Developers List <[hidden email]> </div><div>Cc:  </div><div>Subject: Re: [csv] Object Mapping Proposal </div><div>
</div>Hi Frank,
Is the project hosted in GitHub too?
I think it sounds like a good and useful idea to include it in commons-csv. Last week I had to import some mainframe files using a Cobol copybook, with hundreds of fields, into Hadoop HDFS. I converted the file into a CSV, but some fields were multiline (or had binary content with \n, \r, etc).

I had to hack the code and escape these values before using the data. Probably your code could have saved me some time :) I tried to use commons-csv and Python for pre-processing the csv after reading the Cobol, but with no luck.

Thanks!Bruno


      From: "Ulbricht, Frank" <[hidden email]>
To: "[hidden email]" <[hidden email]>
Sent: Friday, November 28, 2014 6:13 AM
Subject: [csv] Object Mapping Proposal
 
<!--#yiv9591682121 _filtered #yiv9591682121 {font-family:"Cambria Math";panose-1:2 4 5 3 5 4 6 3 2 4;} _filtered #yiv9591682121 {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;}#yiv9591682121 #yiv9591682121 p.yiv9591682121MsoNormal, #yiv9591682121 li.yiv9591682121MsoNormal, #yiv9591682121 div.yiv9591682121MsoNormal {margin:0cm;margin-bottom:.0001pt;font-size:12.0pt;font-family:"Times New Roman", serif;}#yiv9591682121 a:link, #yiv9591682121 span.yiv9591682121MsoHyperlink {color:#0563C1;text-decoration:underline;}#yiv9591682121 a:visited, #yiv9591682121 span.yiv9591682121MsoHyperlinkFollowed {color:#954F72;text-decoration:underline;}#yiv9591682121 span.yiv9591682121E-MailFormatvorlage17 {font-family:"Calibri", sans-serif;color:windowtext;}#yiv9591682121 .yiv9591682121MsoChpDefault {font-family:"Calibri", sans-serif;} _filtered #yiv9591682121 {margin:70.85pt 70.85pt 2.0cm 70.85pt;}#yiv9591682121 div.yiv9591682121WordSection1 {}-->Hello there,    about 15 years ago I started to write a CSV library. Our company is using it for a long time now. Over the time a lot of interesting features were added. Now I have decided to replace it with the commons-csv. This API looks very good and it provides some low-level features our library is missing (e.g. multi-line records with escaping).    Nevertheless, we have a lot of high-level features for easily mapping between objects and the csv files. I am planning to migrate those to use the commons-csv for the I/O work. And I want to use this chance to redesign our APIs.    Now a thought crossed my mind, how about contributing this to the commons-csv? In order to get an idea want I am planning to do I have attached a sample project to this mail. It is just an idea, far from being perfect. It shall demonstrate how it may look like one day.    Sure, in the moment this sample uses a lot of pretty cool Java 8 stuff, but there are ways to make it available to earlier Java versions too.    Please have a look at the class “CSVObjectParserTest” it and tell me what you think.    Thank you, Frank.    P.S. Looks like my previous mail was ignored because the subscription process was not yet finished. If not, please ignore the duplicate mail.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

 


   
Reply | Threaded
Open this post in threaded view
|

Re: [csv] Object Mapping Proposal

Benedikt Ritter-4
In reply to this post by garydgregory
2014-11-28 19:41 GMT+01:00 Gary Gregory <[hidden email]>:

> This is probably out of scope for a light weight component like Commons
> CSV. You could use Hibernate for all your mapping needs.
>

I don't understand what hibernate has to do with this, since it is an
object-relational mapping framework and Frank's proposal is about mapping
between CSV data and pojos... We talked about a mapping functionality for
csv before. I agree that it is out of scope of what we have currently. but
I could imagine to transform csv to a multiproject, that has a core
component and a mapping component (and probably more)

Frank, the mailing list server will strip any attachments. Can you create a
github repository, so we can discuss your proposal in more detail?

TIA!
Benedikt


>
> Gary
>
> <div>-------- Original message --------</div><div>From: "Ulbricht, Frank" <
> [hidden email]> </div><div>Date:11/28/2014  03:13  (GMT-05:00)
> </div><div>To: [hidden email] </div><div>Cc:  </div><div>Subject:
> [csv] Object Mapping Proposal </div><div>
> </div>Hello there,
>
> about 15 years ago I started to write a CSV library. Our company is using
> it for a long time now. Over the time a lot of interesting features were
> added. Now I have decided to replace it with the commons-csv. This API
> looks very good and it provides some low-level features our library is
> missing (e.g. multi-line records with escaping).
>
> Nevertheless, we have a lot of high-level features for easily mapping
> between objects and the csv files. I am planning to migrate those to use
> the commons-csv for the I/O work. And I want to use this chance to redesign
> our APIs.
>
> Now a thought crossed my mind, how about contributing this to the
> commons-csv? In order to get an idea want I am planning to do I have
> attached a sample project to this mail. It is just an idea, far from being
> perfect. It shall demonstrate how it may look like one day.
>
> Sure, in the moment this sample uses a lot of pretty cool Java 8 stuff,
> but there are ways to make it available to earlier Java versions too.
>
> Please have a look at the class “CSVObjectParserTest” it and tell me what
> you think.
>
> Thank you,
> Frank.
>
> P.S. Looks like my previous mail was ignored because the subscription
> process was not yet finished. If not, please ignore the duplicate mail.
>



--
http://people.apache.org/~britter/
http://www.systemoutprintln.de/
http://twitter.com/BenediktRitter
http://github.com/britter
Reply | Threaded
Open this post in threaded view
|

Re: [csv] Object Mapping Proposal

sebb-2-2
On 29 November 2014 at 10:34, Benedikt Ritter <[hidden email]> wrote:

> 2014-11-28 19:41 GMT+01:00 Gary Gregory <[hidden email]>:
>
>> This is probably out of scope for a light weight component like Commons
>> CSV. You could use Hibernate for all your mapping needs.
>>
>
> I don't understand what hibernate has to do with this, since it is an
> object-relational mapping framework and Frank's proposal is about mapping
> between CSV data and pojos... We talked about a mapping functionality for
> csv before. I agree that it is out of scope of what we have currently. but
> I could imagine to transform csv to a multiproject, that has a core
> component and a mapping component (and probably more)
>
> Frank, the mailing list server will strip any attachments. Can you create a
> github repository, so we can discuss your proposal in more detail?

Alternatively, sign up for JIRA and create a "new feature" issue under CSV.
Files can be attached to the issue.

> TIA!
> Benedikt
>
>
>>
>> Gary
>>
>> <div>-------- Original message --------</div><div>From: "Ulbricht, Frank" <
>> [hidden email]> </div><div>Date:11/28/2014  03:13  (GMT-05:00)
>> </div><div>To: [hidden email] </div><div>Cc:  </div><div>Subject:
>> [csv] Object Mapping Proposal </div><div>
>> </div>Hello there,
>>
>> about 15 years ago I started to write a CSV library. Our company is using
>> it for a long time now. Over the time a lot of interesting features were
>> added. Now I have decided to replace it with the commons-csv. This API
>> looks very good and it provides some low-level features our library is
>> missing (e.g. multi-line records with escaping).
>>
>> Nevertheless, we have a lot of high-level features for easily mapping
>> between objects and the csv files. I am planning to migrate those to use
>> the commons-csv for the I/O work. And I want to use this chance to redesign
>> our APIs.
>>
>> Now a thought crossed my mind, how about contributing this to the
>> commons-csv? In order to get an idea want I am planning to do I have
>> attached a sample project to this mail. It is just an idea, far from being
>> perfect. It shall demonstrate how it may look like one day.
>>
>> Sure, in the moment this sample uses a lot of pretty cool Java 8 stuff,
>> but there are ways to make it available to earlier Java versions too.
>>
>> Please have a look at the class “CSVObjectParserTest” it and tell me what
>> you think.
>>
>> Thank you,
>> Frank.
>>
>> P.S. Looks like my previous mail was ignored because the subscription
>> process was not yet finished. If not, please ignore the duplicate mail.
>>
>
>
>
> --
> http://people.apache.org/~britter/
> http://www.systemoutprintln.de/
> http://twitter.com/BenediktRitter
> http://github.com/britter

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [csv] Object Mapping Proposal

garydgregory
In reply to this post by Ulbricht, Frank
Hibernate is all about mappings. Yes,  it sits on top of JDBC but that just means you need a CSV or perhaps Excel driver. There is a lot more value in creating/reusing a simple CSV JDBC driver than creating another custom mapping/binding framework which duplicates some features of a JDBC driver and Hibernate...

My 2c,
Gary 

<div>-------- Original message --------</div><div>From: Benedikt Ritter <[hidden email]> </div><div>Date:11/29/2014  05:34  (GMT-05:00) </div><div>To: Commons Developers List <[hidden email]> </div><div>Cc:  </div><div>Subject: Re: [csv] Object Mapping Proposal </div><div>
</div>2014-11-28 19:41 GMT+01:00 Gary Gregory <[hidden email]>:

> This is probably out of scope for a light weight component like Commons
> CSV. You could use Hibernate for all your mapping needs.
>

I don't understand what hibernate has to do with this, since it is an
object-relational mapping framework and Frank's proposal is about mapping
between CSV data and pojos... We talked about a mapping functionality for
csv before. I agree that it is out of scope of what we have currently. but
I could imagine to transform csv to a multiproject, that has a core
component and a mapping component (and probably more)

Frank, the mailing list server will strip any attachments. Can you create a
github repository, so we can discuss your proposal in more detail?

TIA!
Benedikt


>
> Gary
>
> <div>-------- Original message --------</div><div>From: "Ulbricht, Frank" <
> [hidden email]> </div><div>Date:11/28/2014  03:13  (GMT-05:00)
> </div><div>To: [hidden email] </div><div>Cc:  </div><div>Subject:
> [csv] Object Mapping Proposal </div><div>
> </div>Hello there,
>
> about 15 years ago I started to write a CSV library. Our company is using
> it for a long time now. Over the time a lot of interesting features were
> added. Now I have decided to replace it with the commons-csv. This API
> looks very good and it provides some low-level features our library is
> missing (e.g. multi-line records with escaping).
>
> Nevertheless, we have a lot of high-level features for easily mapping
> between objects and the csv files. I am planning to migrate those to use
> the commons-csv for the I/O work. And I want to use this chance to redesign
> our APIs.
>
> Now a thought crossed my mind, how about contributing this to the
> commons-csv? In order to get an idea want I am planning to do I have
> attached a sample project to this mail. It is just an idea, far from being
> perfect. It shall demonstrate how it may look like one day.
>
> Sure, in the moment this sample uses a lot of pretty cool Java 8 stuff,
> but there are ways to make it available to earlier Java versions too.
>
> Please have a look at the class “CSVObjectParserTest” it and tell me what
> you think.
>
> Thank you,
> Frank.
>
> P.S. Looks like my previous mail was ignored because the subscription
> process was not yet finished. If not, please ignore the duplicate mail.
>



--
http://people.apache.org/~britter/
http://www.systemoutprintln.de/
http://twitter.com/BenediktRitter
http://github.com/britter
Reply | Threaded
Open this post in threaded view
|

Re: [csv] Object Mapping Proposal

Matt Benson-2
I thought the original proposal was more akin to Java beans property
editors, i.e. simple parsing of objects from a string representation. There
are any number of libraries that support this kind of basic
string-to-object conversion. Actually flatfile has some support for this in
its built in Morph [1] integration as well. I also intend, in the future,
to support flatfile in my own Therian [2] object transformation library
(the logistics of this are complicated until/unless flatfile can graduate
from the sandbox), but FWIW I have a preference for pulling CSV through
conversion instead of the other way around. If anything of this nature
should be added to CSV I would recommend considering property editors,
keeping it quite simple to maintain the component's focus.

Matt

[1] http://morph.sourceforge.net/
[2] http://mbenson.github.io/therian/
 On Nov 29, 2014 6:38 AM, "Gary Gregory" <[hidden email]> wrote:

> Hibernate is all about mappings. Yes,  it sits on top of JDBC but that
> just means you need a CSV or perhaps Excel driver. There is a lot more
> value in creating/reusing a simple CSV JDBC driver than creating another
> custom mapping/binding framework which duplicates some features of a JDBC
> driver and Hibernate...
>
> My 2c,
> Gary
>
> <div>-------- Original message --------</div><div>From: Benedikt Ritter <
> [hidden email]> </div><div>Date:11/29/2014  05:34  (GMT-05:00)
> </div><div>To: Commons Developers List <[hidden email]>
> </div><div>Cc:  </div><div>Subject: Re: [csv] Object Mapping Proposal
> </div><div>
> </div>2014-11-28 19:41 GMT+01:00 Gary Gregory <[hidden email]>:
>
> > This is probably out of scope for a light weight component like Commons
> > CSV. You could use Hibernate for all your mapping needs.
> >
>
> I don't understand what hibernate has to do with this, since it is an
> object-relational mapping framework and Frank's proposal is about mapping
> between CSV data and pojos... We talked about a mapping functionality for
> csv before. I agree that it is out of scope of what we have currently. but
> I could imagine to transform csv to a multiproject, that has a core
> component and a mapping component (and probably more)
>
> Frank, the mailing list server will strip any attachments. Can you create a
> github repository, so we can discuss your proposal in more detail?
>
> TIA!
> Benedikt
>
>
> >
> > Gary
> >
> > <div>-------- Original message --------</div><div>From: "Ulbricht,
> Frank" <
> > [hidden email]> </div><div>Date:11/28/2014  03:13  (GMT-05:00)
> > </div><div>To: [hidden email] </div><div>Cc:
> </div><div>Subject:
> > [csv] Object Mapping Proposal </div><div>
> > </div>Hello there,
> >
> > about 15 years ago I started to write a CSV library. Our company is using
> > it for a long time now. Over the time a lot of interesting features were
> > added. Now I have decided to replace it with the commons-csv. This API
> > looks very good and it provides some low-level features our library is
> > missing (e.g. multi-line records with escaping).
> >
> > Nevertheless, we have a lot of high-level features for easily mapping
> > between objects and the csv files. I am planning to migrate those to use
> > the commons-csv for the I/O work. And I want to use this chance to
> redesign
> > our APIs.
> >
> > Now a thought crossed my mind, how about contributing this to the
> > commons-csv? In order to get an idea want I am planning to do I have
> > attached a sample project to this mail. It is just an idea, far from
> being
> > perfect. It shall demonstrate how it may look like one day.
> >
> > Sure, in the moment this sample uses a lot of pretty cool Java 8 stuff,
> > but there are ways to make it available to earlier Java versions too.
> >
> > Please have a look at the class “CSVObjectParserTest” it and tell me what
> > you think.
> >
> > Thank you,
> > Frank.
> >
> > P.S. Looks like my previous mail was ignored because the subscription
> > process was not yet finished. If not, please ignore the duplicate mail.
> >
>
>
>
> --
> http://people.apache.org/~britter/
> http://www.systemoutprintln.de/
> http://twitter.com/BenediktRitter
> http://github.com/britter
>
Reply | Threaded
Open this post in threaded view
|

Re: [csv] Object Mapping Proposal

Jörg Schaible
Matt Benson wrote:

> I thought the original proposal was more akin to Java beans property
> editors, i.e. simple parsing of objects from a string representation.
> There are any number of libraries that support this kind of basic
> string-to-object conversion. Actually flatfile has some support for this
> in its built in Morph [1] integration as well. I also intend, in the
> future, to support flatfile in my own Therian [2] object transformation
> library (the logistics of this are complicated until/unless flatfile can
> graduate from the sandbox), but FWIW I have a preference for pulling CSV
> through conversion instead of the other way around. If anything of this
> nature should be added to CSV I would recommend considering property
> editors, keeping it quite simple to maintain the component's focus.

+1

- Jörg


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [csv] Object Mapping Proposal

Ulbricht, Frank
In reply to this post by garydgregory
Hello guys,

I have created a new feature request CSV-146, so you may have a look on my code.

Thanks,
Frank.

Von: Gary Gregory<mailto:[hidden email]>
Gesendet: ‎Samstag‎, ‎29‎. ‎November‎ ‎2014 ‎13‎:‎38
An: [hidden email]<mailto:[hidden email]>

Hibernate is all about mappings. Yes,  it sits on top of JDBC but that just means you need a CSV or perhaps Excel driver. There is a lot more value in creating/reusing a simple CSV JDBC driver than creating another custom mapping/binding framework which duplicates some features of a JDBC driver and Hibernate...

My 2c,
Gary

<div>-------- Original message --------</div><div>From: Benedikt Ritter <[hidden email]> </div><div>Date:11/29/2014  05:34  (GMT-05:00) </div><div>To: Commons Developers List <[hidden email]> </div><div>Cc:  </div><div>Subject: Re: [csv] Object Mapping Proposal </div><div>
</div>2014-11-28 19:41 GMT+01:00 Gary Gregory <[hidden email]>:

> This is probably out of scope for a light weight component like Commons
> CSV. You could use Hibernate for all your mapping needs.
>

I don't understand what hibernate has to do with this, since it is an
object-relational mapping framework and Frank's proposal is about mapping
between CSV data and pojos... We talked about a mapping functionality for
csv before. I agree that it is out of scope of what we have currently. but
I could imagine to transform csv to a multiproject, that has a core
component and a mapping component (and probably more)

Frank, the mailing list server will strip any attachments. Can you create a
github repository, so we can discuss your proposal in more detail?

TIA!
Benedikt


>
> Gary
>
> <div>-------- Original message --------</div><div>From: "Ulbricht, Frank" <
> [hidden email]> </div><div>Date:11/28/2014  03:13  (GMT-05:00)
> </div><div>To: [hidden email] </div><div>Cc:  </div><div>Subject:
> [csv] Object Mapping Proposal </div><div>
> </div>Hello there,
>
> about 15 years ago I started to write a CSV library. Our company is using
> it for a long time now. Over the time a lot of interesting features were
> added. Now I have decided to replace it with the commons-csv. This API
> looks very good and it provides some low-level features our library is
> missing (e.g. multi-line records with escaping).
>
> Nevertheless, we have a lot of high-level features for easily mapping
> between objects and the csv files. I am planning to migrate those to use
> the commons-csv for the I/O work. And I want to use this chance to redesign
> our APIs.
>
> Now a thought crossed my mind, how about contributing this to the
> commons-csv? In order to get an idea want I am planning to do I have
> attached a sample project to this mail. It is just an idea, far from being
> perfect. It shall demonstrate how it may look like one day.
>
> Sure, in the moment this sample uses a lot of pretty cool Java 8 stuff,
> but there are ways to make it available to earlier Java versions too.
>
> Please have a look at the class “CSVObjectParserTest” it and tell me what
> you think.
>
> Thank you,
> Frank.
>
> P.S. Looks like my previous mail was ignored because the subscription
> process was not yet finished. If not, please ignore the duplicate mail.
>



--
http://people.apache.org/~britter/
http://www.systemoutprintln.de/
http://twitter.com/BenediktRitter
http://github.com/britter
Reply | Threaded
Open this post in threaded view
|

Re: [csv] Object Mapping Proposal

garydgregory
FYI: the proposal depends on Java 8 and BeanUtils which is fine if it is in
a separate module. Unless we want to make a Commons CSV 1.2 depend on Java
8.

I'm not sure if I like the 'story' from a user-POV but it's a start ;-)

I was wondering more about an annotation based system, but that would be
more intrusive...

Discuss!

Gary

On Sat, Nov 29, 2014 at 3:34 PM, Ulbricht, Frank <[hidden email]>
wrote:

> Hello guys,
>
> I have created a new feature request CSV-146, so you may have a look on my
> code.
>
> Thanks,
> Frank.
>
> Von: Gary Gregory<mailto:[hidden email]>
> Gesendet: ‎Samstag‎, ‎29‎. ‎November‎ ‎2014 ‎13‎:‎38
> An: [hidden email]<mailto:[hidden email]>
>
> Hibernate is all about mappings. Yes,  it sits on top of JDBC but that
> just means you need a CSV or perhaps Excel driver. There is a lot more
> value in creating/reusing a simple CSV JDBC driver than creating another
> custom mapping/binding framework which duplicates some features of a JDBC
> driver and Hibernate...
>
> My 2c,
> Gary
>
> <div>-------- Original message --------</div><div>From: Benedikt Ritter <
> [hidden email]> </div><div>Date:11/29/2014  05:34  (GMT-05:00)
> </div><div>To: Commons Developers List <[hidden email]>
> </div><div>Cc:  </div><div>Subject: Re: [csv] Object Mapping Proposal
> </div><div>
> </div>2014-11-28 19:41 GMT+01:00 Gary Gregory <[hidden email]>:
>
> > This is probably out of scope for a light weight component like Commons
> > CSV. You could use Hibernate for all your mapping needs.
> >
>
> I don't understand what hibernate has to do with this, since it is an
> object-relational mapping framework and Frank's proposal is about mapping
> between CSV data and pojos... We talked about a mapping functionality for
> csv before. I agree that it is out of scope of what we have currently. but
> I could imagine to transform csv to a multiproject, that has a core
> component and a mapping component (and probably more)
>
> Frank, the mailing list server will strip any attachments. Can you create a
> github repository, so we can discuss your proposal in more detail?
>
> TIA!
> Benedikt
>
>
> >
> > Gary
> >
> > <div>-------- Original message --------</div><div>From: "Ulbricht,
> Frank" <
> > [hidden email]> </div><div>Date:11/28/2014  03:13  (GMT-05:00)
> > </div><div>To: [hidden email] </div><div>Cc:
> </div><div>Subject:
> > [csv] Object Mapping Proposal </div><div>
> > </div>Hello there,
> >
> > about 15 years ago I started to write a CSV library. Our company is using
> > it for a long time now. Over the time a lot of interesting features were
> > added. Now I have decided to replace it with the commons-csv. This API
> > looks very good and it provides some low-level features our library is
> > missing (e.g. multi-line records with escaping).
> >
> > Nevertheless, we have a lot of high-level features for easily mapping
> > between objects and the csv files. I am planning to migrate those to use
> > the commons-csv for the I/O work. And I want to use this chance to
> redesign
> > our APIs.
> >
> > Now a thought crossed my mind, how about contributing this to the
> > commons-csv? In order to get an idea want I am planning to do I have
> > attached a sample project to this mail. It is just an idea, far from
> being
> > perfect. It shall demonstrate how it may look like one day.
> >
> > Sure, in the moment this sample uses a lot of pretty cool Java 8 stuff,
> > but there are ways to make it available to earlier Java versions too.
> >
> > Please have a look at the class “CSVObjectParserTest” it and tell me what
> > you think.
> >
> > Thank you,
> > Frank.
> >
> > P.S. Looks like my previous mail was ignored because the subscription
> > process was not yet finished. If not, please ignore the duplicate mail.
> >
>
>
>
> --
> http://people.apache.org/~britter/
> http://www.systemoutprintln.de/
> http://twitter.com/BenediktRitter
> http://github.com/britter
>



--
E-Mail: [hidden email] | [hidden email]
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory