title: Design pattern for grouping fields and structuring data in a flat file
body: <p>I am using the FileHelpers C# library to read a file into an array of custom objects that will be processed. For instance, a partial file definition:</p>
  
  <pre><code>[FixedLengthRecord]
  public class Row
  {
      [FieldFixedLength(9)]
      [FieldTrim(TrimMode.Right)]
      public string Ssn;
  
      [FieldFixedLength(15)]
      [FieldTrim(TrimMode.Right)]
      public string LastName;
  
      ...
  }
  </code></pre>
  
  <p>I'm trying to abide by OOP principles while doing this and I've noticed that some fields have a natural grouping (e.g. <code>SSN</code> and <code>ClientID</code>, <code>EmployerID</code> and <code>EmployerName</code>, etc.), so I tried to break them up into separate classes (e.g. <code>Client</code> and <code>Employer</code>). But this seems problematic because some of the fields need to be shared across objects (e.g. the <code>ClientID</code> needs to know the associated <code>EmployerID</code>). </p>
  
  <p>To further complicate things, I would like to add fields with the <code>[FieldNotInFile]</code> attribute to the class definition(s) because during processing, my application will query for database records that match a specific row field and populate the row's respective <code>[FieldNotInFile]</code>s (e.g. get client's <code>FName</code> from database based on <code>SSN</code> since it's not in the file).</p>
  
  <p>How would you structure this? I kind of just want to keep the whole file row as one class, but it's approaching 75 fields, which seems ridiculous. Thoughts?</p>