In this video, learn how to extend the pizza store example with a new franchise, and implement the factory pattern design.
- [Instructor] To create a pizza, we first need … to instantiate the kind of store we want. … Imagine you're choosing between walking into … a New York-style pizza store, … or a Chicago-style pizza store. … Once we're in the store, we can order a pizza. … Remember, this method is implemented … by the abstract class, PizzaStore. … No matter which pizza store we're in … when we make an order, … we're guaranteed to get the same, … brilliant pizza-making algorithm … to produce quality pizzas. … The first step in the orderPizza algorithm … is to create the pizza. … The createPizza method is implemented … by the individual stores. … So, in a New York pizza store, … we'll get the method implemented by that store. … We pass the type of pizza along … to the createPizza method. … This method creates the right kind … of pizza based on the type. … And once it's returned to … the orderPizza method in the store, … the orderPizza method can prepare … the pizza for the customer. … Let's get a better sense …
- 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
Skill Level Intermediate
1. Design Patterns
2. The Strategy Pattern
3. The Adapter Pattern
4. The Observer Pattern
Using the Observer pattern2m 23s
5. The Decorator Pattern
6. The Iterator Pattern
7. The Factory Patterns
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.