Facade 없이 Service가 다른 도메인의 여러 Service를 직접 의존하면 도메인 간 결합이 강해지고 Service가 비대해진다. Facade가 오케스트레이션을 전담하면 Service는 같은 도메인의 Repository 하나만 의존하는 순수한 비즈니스 로직 단위로 유지되고, Facade만 확인하더라도 비즈니스 로직의 흐름을 한눈에 파악할 수 있다. 아키텍처 Controller → Facade → Service → Repository 각 레이어의 역할 API 요청을 받는 레이어 Request를 매개변수로 전달하며 같은 도메인의 Facade 메서드를 호출한다. 다른 도메인의 Facade는 의존하지 않는다. Request에서 @Valid를 통한 입력 유효성을 검증한다. Swagger를 통해 문서화한다. Facade로부터 완성된 Response Dto, List<>, Page<>, void 등을 반환받아서 그대로 응답한다.
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Get in touch with return
Contact return, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack