2022年3月26日 星期六

IoC Inversion of Control

 


e.g. Spring framework

accessed from org.ctef.los.ctrls

  1. OrderingCtrl.java (src -> control code)
  2. web.inf / conf. / beans
Modeling => DAO (Data Access Object)
View => jsp
Controller => controlled by xml

In OrderingCtrl.java :
@Request Mapping("filename")


your code calls (sth) vs the framework calls (sth you written)

e.g. Database class, don't want to initialize (new) every time

create in framework itself, our code calls the existing created object when required

Dependency Injection

Inject created object as parameter rather than create in class





沒有留言:

張貼留言

[康復路] 試完又試

見了醫生,因為血色素又變低了,醫生想檢查是否「缺鐵」為成因,檢查又檢查…… 感覺有些麻煩……又抽血,又要留樣本…… 令我回想起當日入院的時光,因為一些原因,留樣本只需留一次,免卻留三次的麻煩;現在每天都要留一次,連續三天。每天早上就要跑醫院一趟再上班。 幸好也完成了。 第二次抽血...