Spring Batch的StepScope类和注解之间的区别是什么?

huangapple go评论69阅读模式
英文:

Difference between Spring Batch StepScope class and annotation?

问题

以下是翻译好的内容:

  1. StepScope 注解

StepScope

之间的区别是什么?

除了一个是注解,另一个是类之外。

StepScope 类的用途是什么?

我大致知道 StepScope 注解的用途,但是类的用途是什么?

英文:

Can someone explain what is the difference between the Spring Batch's:

StepScope Annotation

and

StepScope Class

Other than the fact one is an annotation another is a class.

What is the use of the StepScope class ?

I have an idea of what the StepScope annotation is used for but what is the use for the class ?

答案1

得分: 1

不要使用 StepScope 类,它是实现,允许Spring容器处理使用Step范围声明的Bean的生命周期(用@StepScope注释)。基本上,该实现将在一个步骤内返回相同的Bean,并在另一个步骤中返回一个新实例。

英文:

You should not use StepScope class, it is the implementation allowing the Spring container to handle lifetime of bean declared with Step scope (annotated with @StepScope). Basically the implementation will return the same bean inside a step and return a new instance for an other step.

huangapple
  • 本文由 发表于 2020年8月10日 05:05:49
  • 转载请务必保留本文链接:https://go.coder-hub.com/63331320.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定