??????????????Spring????????????????????????????????б????Java???????????????????£?????????о???????Spring?????????????????????????
???????????????????????????棬??????????????????????????Java??????????????????????????????
??????仰??????????????????????????????????????÷?????????????????????л????“If you call me?? i will call back”??
??????????????????????????????????????????????
????class A?????InA ——????1
????class A?а??????class B??????b ——????2
????class B??????????InA?????test(InA a) ——????3
????A?????a????B??????????????test(a) ——?????????you call me
???????b??????test?????е???InA????? ——?????????i call you back
?????????????????????????????????????????????????????
??????PS?????????????????磬????????????????????????磬????о???????????????????????????????????????????

 

//??????InA
public interface BoomWTC{
//???????????
public benLaDengDecide();
// ??к????ó
public void boom();
}
//????class A
public class At$911 implements BoomWTC{//?????????1??
private boolean decide;
private TerroristAttack ta;//?????????2??
public At$911(){
Date now=new Date();
SimpleDateFormat myFmt1=new SimpleDateFormat("yy/MM/dd HH:mm");
this.dicede= myFmt.format(dt).equals("01/09/11 09:44");
this.ta=new TerroristAttack();
}
//???????????
public boolean benLaDengDecide(){
return decide;
}
// ??к????ó
public void boom(){
ta.attack(new At$911);//class A????class B??????????????????????you call me??
}
}
//????class B
public class TerroristAttack{
public TerroristAttack(){
}
public attack(BoomWTC bmw){——???????????3??
if(bmw.benLaDengDecide()){//class B??????л??class A????????????i call you back??
//let's go.........
}
}
}

????????????????????????ɡ?