Preface

This book will help you understand when and how to implement the 23 patterns, as described by the gang of four (GoF), with the new language provided by Apple: Swift.

The main idea behind this book is to make it a reference book for implementing a specific pattern. This is the reason why I have divided this book into three categories: creational, structural, and behavioral patterns. For each category, you will find a chapter with a common structure: roles, a UML class diagram, participants, collaboration, illustration, and implementation with Swift.

This structure is an easy way to find the answers that you may ask yourself. In this book, I will first introduce you to the five creational patterns, followed by seven structural patterns, and then conclude with the eleven behavioral patterns, as defined by the GoF.

What this book covers

Chapter 1, Creational Patterns, introduces you to the five patterns of a creational pattern category: the prototype, factory method, singleton, abstract factory, and builder patterns.

Chapter 2, Structural Patterns – Decorator, Proxy, and Bridge, introduces you to structural patterns and helps you explore the decorator, proxy, and bridge patterns.

Chapter 3, Structural Patterns – Composite and Flyweight, teaches you how to deal with the structure of multiple objects using the composite and flyweight patterns.

Chapter 4, Structural Patterns – Adapter and Facade, teaches you how to join the two types that were not designed to work with each other together, thanks to the adapter pattern. Then, you'll learn how the facade pattern can help you simplify the interface of a set of complex systems.

Chapter 5, Behavioral Patterns – Strategy, State, and Template Method, introduces you to the behavioral patterns. In this chapter, we will discuss the strategy, state, and template method patterns.

Chapter 6, Behavioral Patterns – Chain of Responsibility and Command, introduces you to two other behavioral patterns that are concerned with passing requests to an appropriate object that will then execute the action.

Chapter 7, Behavioral Patterns – Iterator, Mediator, and Observer, provides a way to implement communication between objects while keeping their independence and anonymity.

Chapter 8, Behavioral Patterns – Visitor, Interpreter, and Memento, concludes with the discovery and implementation of the 23 patterns, as defined by the GoF.

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

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