英文:
Difference between Spring Batch StepScope class and annotation?
问题
以下是翻译好的内容:
- 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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论