Programming Foundations: Design Patterns
1h 45mIntermediate2019-05-06
Authors

Elisabeth Robson
Author, Software Developer

Eric Freeman
Author, Computer Scientist
Course details
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.
Learning objectives
What are design patterns?
Encapsulating code that varies with the Strategy pattern
The limitations of inheritance
Using the Adapter pattern
Implementing the Observer pattern
Extending behavior with composition and the Decorator pattern
Encapsulating iteration with the Iterator pattern
Object creation with the Factory Method pattern
Using design principles to guide your object-oriented design
Learning objectives
What are design patterns?
Encapsulating code that varies with the Strategy pattern
The limitations of inheritance
Using the Adapter pattern
Implementing the Observer pattern
Extending behavior with composition and the Decorator pattern
Encapsulating iteration with the Iterator pattern
Object creation with the Factory Method pattern
Using design principles to guide your object-oriented design
Skills covered
Software DesignJavaScriptJavaOraclePythonFoundationsOpen SourceSoftware Development
Concepts
Introduction
- Don't reinvent the wheel
- What you should know
Design Patterns
- Object-oriented design experience
- What are design patterns
- What are design principles
The Strategy Pattern
- 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
The Adapter Pattern
- Understanding the adapter pattern
- The Adapter pattern defined
- Using the Adapter pattern
- Challenge - The Adapter pattern
- Solution - The Adapter pattern
The Observer 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
The Decorator 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
The Iterator 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 Factory Patterns
- The need for factory patterns
- The Factory Method pattern
- Using the Factory Method pattern
- Challenge - The simple Factory pattern
- Solution - The simple Factory pattern
Conclusion
- Applying patterns
- Where to go from here