Chuck/Francis,

This is one approach I had been considering, so since you are both right, I'll now definitely choose that approach! .... I just needed to make sure I was not missing some more generic elegant way in eof.

I already have a DataMapping helper class that maps between target eo attribute keys and the csv field names. I'll upgrade that class to have a dictionary of optional ValueConverter classes for each destination key/keypath.

As always, thanks for the listening hears and constructive input,

Cheers, Kieran


On Jul 11, 2007, at 8:57 PM, Chuck Hill wrote:


A more generic and reusable solution would be to write CSVReader that takes a file reference, an array of key paths and an array of formatters to read CSV column strings, convert them if needed (with formatter) and set it (with key path and Key Value Coding). I've done this kind of thing in the past, and it's very handy. You can even create custom formatters to convert strings to special data (i.e. BooleanFormat, InetAddressFormat, etc.).

Interesting, that is precisely what I was about to suggest. I do the exact same thing. We must therefor be correct. Grin. It is definitely a more flexible solution and a better design for the problem at hand.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to