Facade design pattern
A facade class can be as complicated or simple as you need it to, since all it's really doing is providing abstraction for the user. So, the goal is to make the code that calls methods from the facade class simple, but the facade itself doesn't necessarily need to be simple.
As an example, I've used facade classes to aid in performing MySQL database queries. To do this, I've written methods like findWithID(id) or findWithHeightBetween(min, max) within the facade class that return a list of all the database entries matching the input. Here, the facade class allows the user to call a single method to get data from the database without needing to know anything about the underlying system or memorize a complicated database query.
So,
Facade class code: Doesn't really matter how simple it is
Caller code: Should be simpler as a result of using the facade
Hope this helps

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now