Software developers need to solve various problems. Many times, these problems are the same or similar to the ones they've already encountered in other projects.
Wouldn't it be great to apply the solution you've found instead of reinventing the wheel over and over again?
That's precisely the reason why software design patterns exist. A design pattern is a standardized way to address a recurring problem. Relying on a proven strategy will not only save you time, but you can rest assured that it's indeed the right choice.
Design patterns are the result of a long evolution process. It all started with a book published in 1994 - yes, it's that old! - called "Design Patterns - Elements of Reusable Object-Oriented Software." That's a quite tedious title, so we usually refer to it as "the book by the gang of four." The gang consists of four renowned software engineers: Erich Gamma, Ralph Johnson, Richard Helm, and John Vlissides. They identified the most significant common issues that occurred in multiple projects and developed best practices to solve them.
The best part: these solutions are (programming) language-agnostic. You can use the design patterns with any object-oriented programming language.
Many modern programming languages and frameworks have integrated the GoF patterns. You don't have to write additional code to support say the Iterator or the Observer.
Swift is no exception: it provides many advanced language features and constructs such as type extensions, lazy initialization, and predefined protocols that let us adopt and integrate the design patterns into our projects easily.
This book covers all these topics and teaches best practices you can apply in your upcoming projects.
We'll talk about the benefits of understanding and applying the design patterns, the value they provide, and also about their limitations.
Then, we delve into the creational design patterns:
- the Singleton,
- the Prototype,
- the Factory Method,
- the Builder,
- and the Abstract Factory design pattern
We're going to take a closer look at the structural design patterns. We discuss:
- the Adapter,
- the Decorator,
- the Façade,
- the Flyweight,
- and the Proxy pattern
In the final part of this book, we discuss the behavioral design patterns:
- the Chain of Responsibility,
- the Iterator,
- the Observer,
- and we finish with the State design pattern
For each design pattern, we discuss the following:
- When to use the specific design pattern?
- How can it be implemented using Swift 5?
- What are the challenges and pitfalls of using the given pattern?
Throughout the book, I provide coding examples that can be applied in real-world situations.
Károly Nyisztor is a veteran software engineer and instructor.
He has worked with large companies such as Apple, Siemens, and SAP. Károly has designed and built several enterprise frameworks, and he holds twelve patents related to inventions in the field of mobile computing.
After 18 years, he left the corporate world to start his own business.
Since 2016, he's fully committed to teaching. As an instructor, he aims to share his 20+ years of software development expertise. Károly teaches:
- Software Architecture,
- Object-Oriented Programming and Design
- Swift and iOS Programming,
- and other, programming-related topics
You can find Károly Nyisztor's courses and books on all major platforms including Amazon, Lynda, LinkedIn Learning, Pluralsight, Udemy, and iTunes.