Servlate Operation Template
Bean - Yahaan par jo bhi input ko store karne aur baad mein upyog karne ki zaroorat hoti hai, unhein "bean" hona chahiye, jaise LoginBean, TodoBean, UserBean.
DAO - Iske baad DAO frame mein aata hai. Yahan par implementation ya operation ka kaam hota hai, jaise backend process, input ka process. Humare paas yeh hain:
UserDAO: Yahan par bean ka upyog kiya gaya hai data ko bhejne aur prapt karne ke liye, jo register wale page se aata hai.
TodoImplementation: Yahan par SQL query hai jiska upyog method mein hoga, yahan par method ka upyog karne ke liye TodoDAO interface ka istemaal kiya gaya hai.
LoginDAO: Yahan par login bean ka upyog karke data ko idhar-udhar kiya gaya hai. Yahaan par validate method ka upyog kiya gaya hai aur saath hi utils ka bhi upyog hai.
TodoDAO: Ye ek interface hai jisme kuch methods hote hain, jinse operation hote hain. Inko saari methods ko TodoImplementation class mein implement kiya gaya hai.
Fir aati hai web ki cheeze jaise:
User controller - Isme input leta hai webpage se aur inko ek object mein daalta hai. Fir usko validation ke liye bhejta hai login dao mein.
Todo controller - Isme action ka use karenge jaise operation perform karne ka kaam web se input lekar.
Login controller - Yahaan use karenge input login page ka.