Facade

When a package has multiple interfaces, it can get difficult for clients to use it. Though the individual interfaces may be exciting for a power user, most clients will get confused with the complicated details they don't care about.

The facade design pattern solves this, with advertising an alternative/simplified interface to other parts of the code. This is shown by this figure:

In Golang, a facade can be implemented using an interface and struct, which offers a simplified interaction model over the rest of the interfaces.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset