반응형 Lazy1 Lazy 로 쿼리를 날리고 싶다면? 문제 aService 로직을 실행하고, 실행 환경이 release 환경이라면 bService 로직을 추가로 실행하는 코드가 있다. public void run(Model model) { model.addAttribute("play1", aService.play()); boolean isRelease = DeployUtils.isRelease(); if (isRelease) { model.addAttribute("play2", bService.play()); } } 문제는 이 코드가 대략 10 군데 정도의 Controller 에서 사용되고 있어 중복처럼 보였다. 중복을 제거하기 위해 BaseController 를 만들고, 해당 코드를 설계했다. BaseController public void add(Mod.. 2023. 9. 12. 이전 1 다음