We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
作者你好,我看了你对BeanPostProcessor和BeanFactoryPostProcessor源码分析。都似乎在做一些与bean相关的操作。我想知道这两者具体有什么不同。
The text was updated successfully, but these errors were encountered:
它们之间的主要区别有:
操作时机 BeanFactoryPostProcessor是在Spring容器加载了bean的定义之后,但在bean实例化之前被调用的而BeanPostProcessor是在Spring容器实例化bean之后,且在bean的初始化方法之前和之后进行调用的。
操作对象 BeanFactoryPostProcessor操作的是bean的定义。它允许你修改bean的定义属性,例如可以改变bean的作用域,属性值等,而BeanPostProcessor操作的是bean的实例。它允许你在实例化后、初始化前后对bean实例进行某些操作。
使用场景 BeanFactoryPostProcessor通常用于修改bean的定义。而BeanPostProcessor通常用于修改新创建的bean实例。
执行顺序 BeanFactoryPostProcessor会按照优先级和顺序进行排序调用,而BeanPostProcessor则会按照它们在容器中的定义顺序进行调用。
Sorry, something went wrong.
No branches or pull requests
作者你好,我看了你对BeanPostProcessor和BeanFactoryPostProcessor源码分析。都似乎在做一些与bean相关的操作。我想知道这两者具体有什么不同。
The text was updated successfully, but these errors were encountered: