title: Spring Batch Late Binding - Step Scope or Job Scope?
body: <p>I'm working on a project using Spring Batch. In this project, I use Spring Batch late binding in which I injected a parameter (a string that will be used as a condition for SQL reader query) using <strong>JobParameters</strong>. Currently, I'm using the <code>@StepScope</code> for that late binding and everything works perfectly fine.</p>
  
  <p>What I'm asking here is when to use <code>@StepScope</code> and when to use <code>@JobScope</code>. I've read the Spring Batch reference and I've googled about StepScope and JobScope. All I'm getting is that :</p>
  
  <p>a. StepScope : Spring Batch will use the spring container to instantiate a new instance of that component for each step execution.</p>
  
  <p>b. JobScope : There will be only one instance per executing job.</p>
  
  <p>I just can't determine the consideration of when to use StepScope or JobScope. Can someone explain a little deeper?</p>