Introduction
Explore the benefits of design patterns
()
What you should know
()
1. Design Patterns: Values and Limitations
What’s a software design pattern?
()
Applications of design patterns
()
Limitations
()
Creational, structural, and behavioral patterns
()
2. The Singleton Pattern
Purpose, pros, and cons
()
Read-only singletons
()
Concurrency issues
()
Making the singleton thread-safe
()
Readers-writer lock
()
3. The Prototype Pattern
Purpose: Cloning
()
Copying value types
()
Pitfalls of cloning reference types
()
Cloning reference types
()
4. The Factory Method Pattern
Polymorphic instantiation
()
Implementing the Factory Method
()
5. The Adapter Pattern
Working with incompatible interfaces
()
Classical Adapter
()
Adapter using type extensions
()
6. The Decorator Pattern
Enhancing a type without modifying it
()
The object Decorator
()
Decorator via Swift extensions
()
7. The Facade Pattern
Purpose: Simplify usage
()
Consolidating complex functionality
()
8. The Flyweight Pattern
Sharing of common data
()
Spaceships
()
9. The Proxy Pattern
The surrogate
()
Delayed initialization
()
10. The Chain of Responsibility Pattern
Request propagation
()
Request processor
()
11. The Iterator Pattern
Sequential access
()
Custom queue implementation
()
Adding for-in loop support to the queue
()
12. The Observer Pattern
Broadcasting
()
Notifying observers
()
13. The State Pattern
Aim: Reduce complex conditional logic
()
Coffee machine with nested conditionals
()
Refactoring: Identifying the states
()
Refactoring: Implementing the states
()
Ex_Files_Design_Patterns_Swift.zip
(1.0 MB)