循环依赖
2020-11-03 22:14:20 0 举报
循环依赖解决方案
作者其他创作
大纲/内容
N
wait B init over
addSingleFactoryCache B(half init)
Cache has B?
A
populate Ref A
提前暴露自己A;首先实例他人B;
return A
init A{B b = B@456}
Cache has A?
addSingleFactoryCache A(half init)注:half init 已开辟内存A@123,未做赋值操作
init B{A a = A@123}
Y
populate Ref B
0 条评论
下一页