From the course: Node.js: Design Patterns
Unlock the full course today
Join today to access over 24,100 courses taught by industry experts.
The Command pattern - Node.js Tutorial
From the course: Node.js: Design Patterns
The Command pattern
- [Instructor] With the command pattern, commands are objects that contain all of the data necessary to execute a specific action on the client. Think about boxes of furniture that need to be assembled. Each box contains all of the parts necessary along with the instructions on how to assemble that piece of furniture. A professional installer can open a box, follow the instructions and use the materials to assemble the furniture. The installer doesn't need to know how to build each piece of furniture. It doesn't matter to them because the instructions of how to build the furniture come with the box. The installer can open a box, follow the instructions and assemble the furniture; and then they can move on to the next box. In this analogy I like to think of each furniture package as a command. They are all different, they contain different parts and different instructions. The installer can execute a command. They can…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Chain of responsibility4m 42s
-
(Locked)
Implementing the storage class6m 22s
-
(Locked)
The Command pattern4m 47s
-
(Locked)
Implementing commands4m 59s
-
(Locked)
Improving the conductor6m 38s
-
(Locked)
The Iterator pattern4m 5s
-
(Locked)
Implementing iterators4m 59s
-
(Locked)
The Observer pattern4m 19s
-
(Locked)
Implementing observers2m 48s
-
(Locked)
The Strategy pattern4m 25s
-
(Locked)
Implementing strategies9m 36s
-
(Locked)
-