title: How could I achieve abstraction in all different batch phases?
body: <p>I want to achieve abstraction on all the records I read and process in spring batch.</p>
  
  <p>I have a batch file that contains the following </p>
  
  <pre><code>HR* -&gt; HRType
  RD* -&gt; RDType
  FR* -&gt; FRType
  </code></pre>
  
  <p>each on of these types have many children classes Let's see I have parent class called <code>Header</code> and children classes <code>Header1</code>, <code>Header2</code> and <code>Header3</code>. the same for Record and Footer.</p>
  
  <p>How can I make a good level of abstraction for <code>FlatFileItemReader</code>, <code>ItemProcessor</code> and <code>FlatFileItemWriter</code> to deal with a different batch file types. Note that I will process consistent files meaning that I will have a file that only contains <code>Header1</code>, <code>Record1</code> and <code>Footer1</code>.</p>