In my project, I am using mvc pattern. I do no know which class operate database operations. That’s I am doing database operations in Model class, but I do not know this is correct. I have confused. Controller class maybe can be correct place insertion, deletion, update oparations. However, I do not know exactly where I have to do database operations. Also I want to search a value in database. Is model class convenient for these operations ? Thanks,
Share
You should learn more about MVC architecture. As stated on Wikipedia
No. You should do logic in Model. Controller are only used to call that functionalities.
You should do it in Model.