forked from sunday-develop/toby-spring
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
이 전의 코드는 userDao 에 직접 DI를 적용하는 방법으로도 변경할 수 있다. 1. 이전의 코드 : 스프링의 DI 이용 방법 장점: 의존관계가 설정파일에 명확하게 드러나고, 싱글톤으로 관리가 가능하다. 단점: DI 원칙에 부합하지 않는 구체적인 클래스의 관계가 설정에 직접 노출된다. 2. 현재 코드 : 수동 DI 적용 장점: userDao와 JdbcContext의 관계가 외부에 드러나지 않는다. 해당 전략을 감출 수 있다. 단점: 싱글톤으로 만들 수 없고, DI 작업을 위한 부가적인 코드가 필요하다. 두 방법 중 어느 것이 더 낫다고 말할 수 없다.
- Loading branch information
1 parent
d04ad2c
commit e188d79
Showing
3 changed files
with
3 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters