-
Learn about key object-oriented design patterns (including the Observer, Decorator, and Factory patterns) that make your development process faster and easier.
Design patterns are reusable solutions that solve the challenges software developers face over and over again. Rather than reinventing the wheel, learn how to make use of these proven and tested patterns that will make your software more flexible and resilient to change. This course introduces you to design patterns and takes you through several of the most used object-oriented patterns. Elisabeth Robson and Eric Freeman, coauthors of Head First Design Patterns, join forces to provide an overview of each pattern and examples of the pattern in action. Featured design patterns include the Strategy, Adapter, Observer, and Decorator patterns. Elisabeth and Eric lend these concepts a real-world context by providing code demos in Java, with the occasional example in Python and JavaScript.
Overview
Syllabus
-
Introduction
- Don't reinvent the wheel
- What you should know
- Object-oriented design experience
- What are design patterns?
- What are design principles?
- Revisiting inheritance
- Limitations of inheritance
- Trying interfaces
- Get inspiration from design principles
- Programming to an interface
- Applying the principles
- Exploring the strategy pattern
- Why HAS-A is better than IS-A
- Challenge: The Strategy pattern
- Solution: The Strategy pattern
- Understanding the adapter pattern
- The Adapter pattern defined
- Using the Adapter pattern
- Challenge: The Adapter pattern
- Solution: The Adapter pattern
- Understanding the Observer pattern
- The Observer pattern defined
- Using the Observer pattern
- The Observer pattern and loose coupling
- Challenge: The Observer pattern
- Solution: The Observer pattern
- Creating chaos with inheritance
- Understanding the open-closed principle
- Extending behavior with composition
- Understanding the decorator pattern
- Using the Decorator pattern
- Challenge: The Decorator pattern
- Solution: The Decorator pattern
- Encapsulating iteration
- Understanding the Iterator pattern
- Using the Iterator pattern
- Using built-in iterators
- The single responsibility principle
- The iterator pattern as language feature
- Challenge: The Iterator pattern
- Solution: The Iterator pattern
- The need for factory patterns
- The Factory Method pattern
- Using the Factory Method pattern
- Challenge: The simple Factory pattern
- Solution: The simple Factory pattern
- Applying patterns
- Where to go from here