(但據我所知,它是介體黑白控制器和DAO層。)或者我們可以直接在控制器中採用道依賴,這是不錯的做法! ???如I所示春季mvc需要什麼服務層?什麼樣的邏輯推薦?
@Controller
public class HomeController {
// @Autowired
// private UserServiceImpl userService;
@Autowired
private UserDAOImpl userDAOService;
@RequestMapping(value = "login", method = RequestMethod.GET)
public String login(..){
// String res = userService.someOperation();
String res = userDAOService.someOperation();
............
}
}
你想通過這個http://programmers.stackexchange.com/questions/162399/how-essential-is-it-to-make-a-service-layer – mhasan
也許這個對你有好處。 http://stackoverflow.com/questions/9633498/do-i-really-need-a-service-layer。 –