Learn about key object-oriented design patterns (including the Observer, Decorator, and Factory patterns) that make your development process faster and easier.
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
Taught by
Elisabeth Robson and Eric Freeman