views:

32

answers:

0

With reference to an earlier question of mine on parsing fixed length field files, I have come up with another question at issue. I will probably be using a customised version of the FileHelpers library, with field start and length attributes that dynamically read the values for their target properties from a config file.

The text data is all un-normalised, i.e. it has a telephone extension, e.g. '2562', where I need to store an ExtID, which is an unnatural surrogate key. My question is, should I define the class mapped to the text file using ID values, and define the normalisation lookups together in the mapping from the text file, or just store the given data values in the class and perform normalisation lookups when inserting into the database?

The thing is that I need to write custom code for the inserts anyway, e.g. if an extension doesn't exist, create it, etc. Including this logic in the mapping/parsing process would bloat that generic mechanism too much.