课程: Programming Foundations: Design Patterns
今天就学习课程吧!
今天就开通帐号,24,100 门业界名师课程任您挑!
Challenge: The Decorator pattern
(energetic electronic music) - [Instructor] Let's say you want to start up a pizza store, offering both thick and thin crust pizzas. You'd like to offer a variety of toppings for the pizza that can be combined in any way the customer wants, and you'd like to be able to easily add and remove toppings from the menu over time as you determine what your customers like. You'll need to be able to get a description of the pizza to hand to the chef and a total cost of the pizza to charge the customer for their order. Your challenge is to design a system for the pizza store using the Decorator pattern. Have fun, and feel free to get a snack while you're working on the challenge just in case you're hungry.
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。
内容
-
-
-
-
-
-
-
(已锁定)
Creating chaos with inheritance4 分钟 12 秒
-
(已锁定)
Understanding the open-closed principle2 分钟 49 秒
-
(已锁定)
Extending behavior with composition2 分钟 29 秒
-
(已锁定)
Understanding the decorator pattern2 分钟 23 秒
-
(已锁定)
Using the Decorator pattern5 分钟 6 秒
-
(已锁定)
Challenge: The Decorator pattern40 秒
-
(已锁定)
Solution: The Decorator pattern1 分钟 22 秒
-
(已锁定)
-
-
-