今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Implementing the storage class
- [Instructor] In the last lesson, we added code to the store to use a storage class that implements the chain of responsibility design pattern. In this lesson, we'll code the storage class so that we can search for inventory items in multiple locations. I'm inside of the exercise files for chapter four, chapter four lesson two, and I'm inside of the start folder. Within this folder I'm going to go ahead and add a new file called storage.js. And in our storage file I'm going to go ahead and create a new class, storage, and we'll go ahead and give it a constructor. And this class will take in the name of the storage location and also the inventory for that location. And then finally we also are taking in a delivery time. And I am going to default the delivery time to zero and the inventory to an empty array in case those values are not sent. Those this.name is going to equal our name, this.inventory is going to equal our…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。
内容
-
-
-
-
-
-
(已锁定)
Chain of responsibility4 分钟 42 秒
-
(已锁定)
Implementing the storage class6 分钟 22 秒
-
(已锁定)
The Command pattern4 分钟 47 秒
-
(已锁定)
Implementing commands4 分钟 59 秒
-
(已锁定)
Improving the conductor6 分钟 38 秒
-
(已锁定)
The Iterator pattern4 分钟 5 秒
-
(已锁定)
Implementing iterators4 分钟 59 秒
-
(已锁定)
The Observer pattern4 分钟 19 秒
-
(已锁定)
Implementing observers2 分钟 48 秒
-
(已锁定)
The Strategy pattern4 分钟 25 秒
-
(已锁定)
Implementing strategies9 分钟 36 秒
-
(已锁定)
-