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

Chapter 2. Structural Patterns – Decorator, Proxy, and Bridge

After reviewing the five creational patterns in the previous chapter, we will now talk about another category of patterns: the structural patterns. There are seven patterns to talk about; these patterns ease the design by identifying a simple way to realize relationships between entities.

We will see how these patterns help you to encapsulate the composition of objects through the use of an interface, allowing you to conveniently abstract your system as the creational pattern does to encapsulate the creation of objects. Structural patterns highlight the use of interfaces.

You will see how the composition is designed; we will not interfere with the object itself but with the one that will transfer the structuration. This second object is strongly related to the first one. Indeed, the first object presents the interface to the client and manages its relationship with the second object, which, manages the composition and doesn't have...