
우리가 공부하는 MyBatis = ORM(Object Relational Mapping) Framework
Object : 자바
Relational : DB
Mapping : 연결
자바의 객체와 테이블을 연결
스프링을 쓰는 가장 큰이유
DI <의존성 주입>
index - DTO(domain) sqlplus ctrl.c+v - mybatis-config.xml - resources/AddressMapper.(SQL) -
java/AddressMapper(Interface) - Service - Controller - VIEW 순으로 만들기
컬럼이름과 다른건 VO객체로 정의한다.
예를들면 서비스객체가 하나라면(Impl) ,
java/Mapper
resource/Mapper
이 두가지만 건드리면 된다.
서비스 / 컨트롤러는 수정안해도 된다.
(독립적이된다. 레이어드가 끊어져서 분업 할 수 있다.)
AddressService service = new AddressServiceImpl();
AddressService service = //new AddressService1Impl();
AddressService service = //new AddressService2Impl();
추천 Mapper(가독성을위해서 주로 이 이름을 쓴다) == DAO
나중에 외부 넘길 때 ! 뷰보다는 내부적인구조 ( 패키지구성, 파일 배치 ) 스샷찍어서 취업 할 때 보여주는게좋다