- controller层作用:
- dao层作用:
- service层作用
MVC
新建controller层,service层,dao层,service层,dao层均有impl
在servlet中
即可调用 对象直接实现方法
controller->service->dao->数据库
controller层作用:拿到前台传过来的数据,封装交给service处理完了,拿到数据交给界面
private IStudentService studentService = new StudentServiceImpl(); 声明接口,new一个实现类service(要调service)
通过service对象调selectAll
纯粹的增删改查
service层作用:业务逻辑(给每个人加一个java字符)
更新selectbyid 更新界面传回一个id,根据id找到更新的学生,调service,再调dao



