How to exactly work the Spring Inheritance-based Proxies configuration?

被刻印的时光 ゝ 提交于 2019-12-05 13:54:18

Yes, what you've described is basically how Spring handles @Configuration classes

All @Configuration classes are subclassed at startup-time with CGLIB. In the subclass, the child method checks the container first for any cached (scoped) beans before it calls the parent method and creates a new instance.

If the problem in the certification question is to only have one instance of new JdbcAccountRepository(), then, yes, it is best to use the accountRepository() @Bean method within the @Configuration class.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!