Head First Design Patterns is the title of a good book that can be used to learn design patterns. It’s not a reference book designed for those who already know their design patterns. If you’re new to design patterns, this book is a good choice. If you are an experienced OO designer and you are looking for a reference book, try Design Patterns: Elements of Reusable Object-Oriented Software. There is actually a second edition of this book coming out shortly.
What are design patterns? If you are familiar with some of the features of object-oriented programming and are ready to tackle design patterns, you might have a look at the book called Head First Design Patterns published by O’Reilly and written by Eric Freeman, Elisabeth Robson, Bert Bates, and Kathy Sierra. It was released in October 2004. The code examples in the book are written for Java 8. If you are a C# programmer like me then you’ll do just fine with this book because C# is very similar to Java. In fact, you might say that C# inherits from Java, or that C# is Java.
Here are the Table of Contents of the book Head First Design Patterns.
- Welcome to Design Patterns: an introduction (Strategy Pattern)
- Keeping your Objects in the know: the Observer Pattern
- Decorating Objects: the Decorator Pattern
- Baking with OO goodness: the Factory Pattern
- One of a Kind Objects: the Singleton Pattern
- Encapsulating Invocation: the Command Pattern
- Being Adaptive: the Adapter and Facade Patterns
- Encapsulating Algorithms: the Template Method Pattern
- Well-managed Collections: the Iterator and Composite Patterns
- The State of Things: the State Pattern
- Controlling Object Access: the Proxy Pattern
- Patterns of Patterns: Compound Patterns
- Patterns in the Real World: Better Living with Patterns
- Appendix: Leftover Patterns
YouTube Videos
YouTube videos by Christopher Okhravi. In these videos Christopher follows the examples in the Head First book.
- Strategy Pattern – Design Patterns (ep 1)
- Observer Pattern – Design Patterns (ep 2)
- Decorator Pattern – Design Patterns (ep 3)
- Factory Method Pattern – Design Patterns (ep 4)
- Abstract Factory Pattern – Design Patterns (ep 5)
- Singleton Pattern – Design Patterns (ep 6)
- Command Pattern – Design Patterns (ep 7)
- Adapter Pattern – Design Patterns (ep 8)
- Facade Pattern – Design Patterns (ep 9)
- Proxy Pattern – Design Patterns (ep 10)
- Bridge Pattern – Design Patterns (ep 11)
- Structural Patterns (comparison) – Design Patterns (ep 12)
- Template Method Pattern – Design Patterns (ep 13)
- Composite Pattern – Design Patterns (ep 14)
- Difference Between Composite and Decorator Pattern – Design Patterns (ep 15)
- Iterator Pattern – Design Patterns (ep 16)
- State Pattern – Design Patterns (ep 17)
- Null Object Pattern – Design Patterns (ep 18)
Derek Banas also has a series of very popular videos on Design Patterns. The turorials were done back in 2012 but are still relevent today. Derek’s focus is more on the definition of the pattern and on the Java code itself.
- Design Patterns Video Tutorial
- Design Patterns Video Tutorial 2
- Strategy Design Pattern
- Observer Design Pattern
- Factory Design Pattern
- Abstract Factory Design Pattern
- Singleton Design Pattern Tutorial
- Builder Design Pattern
- Prototype Design Pattern Tutorial
- Java Reflection API Tutorial (not a design pattern)
- Decorator Design Pattern
- Command Design Pattern
- Adapter Design Pattern
- Facade Design Pattern
- Bridge Design Pattern
- Template Method Design Pattern
- Iterator Design Pattern
- Composite Design Pattern
- Flyweight Design Pattern
- State Design Pattern
- Proxy Design Pattern Tutorial
- Chain of Responsibility Design Pattern
- Interpreter Design Pattern
- Mediator Design Pattern
- Memento Design Pattern
- Visitor Design Pattern
There are a lot of videos in these lists but don’t be intimidated. Watch them slowly and carefully, one-by-one as you wish. For the Derek Banas videos I suggest watching videos one and two as they are intended to be a review of basic object oriented programming. If they are too simple for you just move on to the specific design patters. You could at the top and work you way down. The strategy Design Pattern is a good place to start because it is not too difficult. The Adapter and Facade patterns are also not too difficult to understand.