1. 业务层接口 UserService
package com.yanek.demo.ssh.service;
import java.util.List;
import com.yanek.demo.ssh.vo.User;
public interface UserService {
public void save(User user);
public List<User> findAll();
}
2. 业务层接口实现类 UserServiceImpl
package com.yanek.demo.ssh.service;
import java.util.List;
import com.yanek.demo.ssh.dao.UserDAO;
import com.yanek.demo.ssh.vo.User;
public class UserServiceImpl implements UserService {
private UserDAO userDAO;// userDao类
public UserDAO getUserDAO() {
return userDAO;
}
public void setUserDAO(UserDAO userDAO) {
this.userDAO = userDAO;
}
public void save(User user) {
userDAO.save(user);
}
public List<User> findAll()
{
return userDAO.findAll();
}
}