Book Image

Swift 2 Design Patterns

By : Julien Lange
Book Image

Swift 2 Design Patterns

By: Julien Lange

Overview of this book

Table of Contents (15 chapters)
Swift 2 Design Patterns
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

The facade pattern


The facade pattern is a simple pattern used to group the interfaces of a group of objects and a unified interface that is easier to use by a client.

Roles

The facade pattern allows you to provide the operations that might be desirable by a user. The pattern encapsulates the interface of each object that is considered as a low-level interface. To construct the unified interface, we might need to implement some methods that will compose the low-level interfaces:

  • It must be used to provide a simple interface of a complex system. The architecture of the system can be composed of several small classes that allow great modularity, but clients don't need such properties. They only need something simple that meets to their needs.

  • It can be used to divide the system into subsystems. The façade will be an interface that allows the communication between subsystems.

  • It can be also used to encapsulate the implementation of a system toward an external consumer.

Design

The facade pattern is...