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

Summary


We discussed the three structural patterns in this chapter: the decorator pattern, the proxy pattern, and the bridge pattern. From a high-level perspective, all of them help you extend classes without using inheritance, but using a dynamic composition of its class hierarchy.

Extending our original class has some impact on our original object except for the proxy pattern where it remains completely unchanged. The decorator pattern that needs to be designed needs to have the original class already developed because every concrete decorator needs to implement an interface based on the original object structure. The bridge pattern is more closely coupled, and there is an understanding that the original object must incorporate considerable references to the rest of the system.

We also discussed all the patterns that rely on rerouting operations. We learned that the rerouting is always done from the new code back to the original.

It is important to note that in real-time applications, where...