토비 스프링 학습 1장(DAO 책임 분리 와 IoC 제어 역전)
·
Java & Spring/Spring
□ 책임 분리1. 초기 DAO 구조(관심사 분리, 책임 분리가 전혀 안된 상태) public class UserDao { public void add(User user) throws SQLException { Connection c = DriverManager.getConnection("jdbc:mysql://localhost/tobyspring", "id", "password"); // add 로직 } public User get(String id) throws SQLException { Connection c = DriverManager.getConnection("jdbc:mysql://localhost/tobyspring", "id", "pass..