java - How spring framework manage cyclic dependency -
i relatively new using spring framework. have read below advantages of using spring :
...containers provide support instantiation of managed objects, cyclical dependencies, life cycles management, , dependency resolution between managed objects etc....
how spring achieve ?
look @ dependency resolution process section in spring framework reference (search "circular dependencies" note @ sidebar).
basically, need use setter-based injection instead of constructor-based one. otherwise, you'll exception when container creates beans (if you're not using lazy initialization).
Comments
Post a Comment