intermediateFacade Pattern

How does a typical Spring Boot @Service class often act as a Facade, even without anyone naming it that way?

A service class in a layered Spring application commonly sits between a controller and several lower-level collaborators -- a repository for persistence, a validator for business rules, maybe an event publisher for notifying other parts of the system. The controller calls one method, like placeOrder(), and that single method internally coordinates all of those collaborators in the correct sequence, then returns one combined result. The controller never constructs the repository or the publisher itself and never needs to know how many steps placing an order actually involves. That's precisely the shape of a Facade: one simple, high-level entry point hiding a multi-step coordination sequence across several classes, even though the class is labeled @Service rather than explicitly called a facade.

Ready to master this question?

Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.

Sign in to generate a response

Next Step

Continue to What is the difference between an abstract class and an interface in Java, and when would you choose one over the other?← Back to all Low-Level Design & Design Patterns questions