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





沒有留言:

張貼留言

亞健康狀態

因著不同事務要處理,最近的晚上已經實行不到九時半入睡的習慣;結果身體一直處於亞健康狀態,早上超級眼瞓(!!!!!),幾乎睜不開眼T.T 這種掙扎中的狀態真痛苦…… 結果星期中真的不行了,放下一切要處理的事務,吃完飯八時半就去睡了,而終於……終於!第二天早上找回了靈魂,工作不用再因...