From the course: Node.js: Design Patterns
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
The Adapter pattern - Node.js Tutorial
From the course: Node.js: Design Patterns
The Adapter pattern
- [Instructor] We're going to take a look at the adapter by looking at a real world analogy, a skateboard. A skateboard is a wooden board with wheels. There's a grippy surface that you stand on, but you're not attached to it. If you're good at skateboarding, you might know how to do an ollie or a kick-flip. These are tricks where you jump in the air with your board and hope to land on it. Let's say you wanted to transfer your skateboarding skills to a different surface, other than concrete. Let's say you wanted to skateboard on snow. You're probably thinking you'll need a snowboard. But are they really the same? You can't kick-flip a snowboard, because you're always attached to it. There's no grippy surface that you stand on. Recently a new snow sport has popped up called snow skating. A snow skateboard is a wooden board with a grippy surface that you stand on, but instead of wheels, its trucks are mounted on skis. If you already know how to skate, you can immediately apply those…
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)
The Adapter pattern2m 20s
-
(Locked)
Implementing an adapter6m 24s
-
(Locked)
The Proxy pattern2m 11s
-
(Locked)
Implementing a proxy5m 48s
-
(Locked)
The Composite pattern3m 12s
-
(Locked)
Implementing composites5m 59s
-
(Locked)
The Decorator pattern4m 3s
-
(Locked)
Implementing decorators4m 24s
-
(Locked)
-
-