Spring Batch StepScope class 和注释之间的区别?

Difference between Spring Batch StepScope class and annotation?

谁能解释一下 Spring 批次的区别是什么:

StepScope注释

StepScope Class

除了一个是注释,另一个是 class。

StepScopeclass有什么用?

我知道 StepScope 注释的用途,但 class 有什么用?

您不应该使用 StepScope class,它是允许 Spring 容器处理使用 Step 作用域(使用 @StepScope 注释)声明的 bean 生命周期的实现。基本上,实现将 return 一个步骤中的相同 bean 和 return 另一个步骤的新实例。