如何在spring框架中启用循环引用? [英] How to enable circular reference in spring framework?
本文介绍了如何在spring框架中启用循环引用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的应用程序中有时候问候所有
逻辑强制我使用循环引用
我想知道如何在春天启用此配置?
greetings all sometime in my app the logic forces me to use circular reference and i want to know how to enable this configuration in spring ?
推荐答案
查看这篇文章 。
我会从第一个选项那里得到建议。循环依赖不是一个好兆头,应该避免。例如,您可以创建第3个辅助类。
I would advice from the first option there. Circular dependencies are not a good sign and should be avoided. You can create a 3rd, helper class, for example.
其他两个选项是解决方法,稍后将难以理解和调试。
The other two options are workarounds and will be harder to understand and debug later on.
这篇关于如何在spring框架中启用循环引用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文