课程: Programming Foundations: Design Patterns
今天就学习课程吧!
今天就开通帐号,24,100 门业界名师课程任您挑!
Challenge: The Iterator pattern
(energetic music) - [Narrator] It's time for another challenge. For the iterator pattern, we're going to try something a little different. For this challenge, you'll need to do a little research before writing code. Most modern programming languages incorporate the iterator pattern. So it's valuable to learn how the iterator pattern is used in languages that are important to you. So pick one of your favorite programming languages. In that language, identify how the Iterator pattern is used to iterate over collections of objects. You might have to do a little bit of research to figure out which types are iterable, and what statements are used to iterate over those types of objects. After you've done your research, implement a small code example to iterate through an aggregate object like an array or a list in the language of your choice.
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。
内容
-
-
-
-
-
-
-
-
(已锁定)
Encapsulating iteration1 分钟 44 秒
-
(已锁定)
Understanding the Iterator pattern2 分钟 28 秒
-
(已锁定)
Using the Iterator pattern3 分钟 36 秒
-
(已锁定)
Using built-in iterators1 分钟 19 秒
-
(已锁定)
The single responsibility principle1 分钟 20 秒
-
(已锁定)
The iterator pattern as language feature1 分钟 30 秒
-
(已锁定)
Challenge: The Iterator pattern57 秒
-
(已锁定)
Solution: The Iterator pattern36 秒
-
(已锁定)
-
-