Facade
Facade purpose is to hide complex libraries API and provide simple class or set of classes that are meant to be used by users of a library.
Example - Document reader
We are going to use Facade pattern to provide API for complex readers that can read various document types, like MS Word or Text files.
These are the readers that should be hidden from users.
We create a facade class called DocumentReader
to provide easy API for library users. We usually put facade classes into library root, so it is the first thing a library user sees.
Here is how users of our library would use the facade.
Last updated
Was this helpful?