Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Go Design Patterns

You're reading from   Go Design Patterns Best practices in software development and CSP

Arrow left icon
Product type Paperback
Published in Feb 2017
Publisher Packt
ISBN-13 9781786466204
Length 402 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Mario Castro Contreras Mario Castro Contreras
Author Profile Icon Mario Castro Contreras
Mario Castro Contreras
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. Ready... Steady... Go! FREE CHAPTER 2. Creational Patterns - Singleton, Builder, Factory, Prototype, and Abstract Factory Design Patterns 3. Structural Patterns - Composite, Adapter, and Bridge Design Patterns 4. Structural Patterns - Proxy, Facade, Decorator, and Flyweight Design Patterns 5. Behavioral Patterns - Strategy, Chain of Responsibility, and Command Design Patterns 6. Behavioral Patterns - Template, Memento, and Interpreter Design Patterns 7. Behavioral Patterns - Visitor, State, Mediator, and Observer Design Patterns 8. Introduction to Gos Concurrency 9. Concurrency Patterns - Barrier, Future, and Pipeline Design Patterns 10. Concurrency Patterns - Workers Pool and Publish/Subscriber Design Patterns

Facade design pattern


The next pattern we'll see in this chapter is the Facade pattern. When we discussed the Proxy pattern, you got to know that it was a way to wrap an type to hide some of its features of complexity from the user. Imagine that we group many proxies in a single point such as a file or a library. This could be a Facade pattern.

Description

A facade, in architectural terms, is the front wall that hides the rooms and corridors of a building. It protects its inhabitants from cold and rain, and provides them privacy. It orders and divides the dwellings.

The Facade design pattern does the same, but in our code. It shields the code from unwanted access, orders some calls, and hides the complexity scope from the user.

Objectives

You use Facade when you want to hide the complexity of some tasks, especially when most of them share utilities (such as authentication in an API). A library is a form of facade, where someone has to provide some methods for a developer to do certain things...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime