What is the difference between @Scope (BeanDefinition.SCOPE_PROTOTYPE) and @Scope (“prototype”)?

Jonathan Ferreira :

Does the annotation @Scope(BeanDefinition.SCOPE_PROTOTYPE) have any advantages or differences compared to the annotation @Scope("prototype")?

Santossh Kumhar :

They do the same thing meaning you can interchange them and shows no difference in behavior.

Does the annotation @Scope(BeanDefinition.SCOPE_PROTOTYPE) have any advantages?

Advantage I can think of are when you use the pre-defined constants is you have an advantage of avoiding typos and saving your time instead of declaring string literals.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=18465&siteId=1