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

The Adapter pattern - Node.js Tutorial

From the course: Node.js: Design Patterns

Start my 1-month free trial

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…

Contents