今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Implementing commands
- [Instructor] In the last lesson we introduced the command pattern and we saw how we can incorporate that pattern into an already existing node app that implemented a read line interface. In this lesson, we're going to implement the conductor that we're importing, as well as each command class that we're importing online, too. So I'm in the exercise files, under chapter four lesson four, within the start folder. And I'm going to go ahead and create a new file called commands.js. And I'm going to go ahead and put all of my command classes within this file. So we're going to need to create a class for the exit command and we're also going to need to create one for create command. And then I'm just going to make sure that I export both of these. Great, so now we have both classes and we're ready to export them. Let's go ahead and write the code for our exit command. So I'm going to write a getter to get the name of this…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。
内容
-
-
-
-
-
-
(已锁定)
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 秒
-
(已锁定)
-