+) 커플링 / 디커플링 (시스템, 프로그램)
객체 → 텍스트(ex. csv, json), 바이너리
“자바 객체 → json (가장 많이 쓰이는 예시)”
텍스트, 바이너리 → 객체
“json → 자바 객체”
리퀘스트 바디: tomcat → messageConverter → Controller → service
리스폰스 바디: Service → Controller → MessageConverter → Tomcat
자바 객체에다가 값을 세팅해줘야 하니 요청 방향에 setter 배치
응답 방향에 getter 배치
ResponseEntity.status(HttpStatus.CREATED).body(savedAccommodation) 로 객체를 response body로 확인하고 싶으면 getter로 필드값을 받아와야 한다post 요청을 보낼 때, setter가 없으면 getter로 일을 함
→ 다른 메서드들은 request body가 없으니 냅두고 setter를 막 쓰지 말라는 의미로 그러지 않았을까…?