Erick Wendel

10 must-know design patterns for JS Devs

Is your JavaScript messy and hard to test? Learn how classic design patterns can transform your code into a clean, layered architecture.

10 must-know design patterns for JS Devs
#1about 5 minutes

Introduction to JavaScript design patterns

The talk addresses common issues in JavaScript development like single-file apps and global state by applying established design patterns.

#2about 3 minutes

Organizing code with a service, view, and controller

Refactor a single-file application into separate service, view, and controller layers using the single responsibility principle and a factory for instantiation.

#3about 3 minutes

Using the abstract factory for multi-platform support

The abstract factory pattern enables sharing a common codebase across different platforms like web and command-line by abstracting platform-specific implementations.

#4about 2 minutes

Building complex objects with builder and fluent interface

The builder pattern simplifies the construction of complex objects by breaking it into steps, while the fluent interface pattern allows for chainable method calls.

#5about 2 minutes

Creating robust tests with the test data builder pattern

The test data builder pattern helps create maintainable tests by centralizing the creation of mock data and entities for various test scenarios.

#6about 2 minutes

Implementing the observer pattern for event-driven code

The observer pattern allows multiple objects to subscribe and react to events, decoupling the publisher from its subscribers for tasks like logging and analytics.

#7about 4 minutes

Injecting logic dynamically with the decorator pattern

Implement the decorator pattern in vanilla JavaScript to add functionality like performance measurement to existing functions without altering their core logic.

#8about 4 minutes

Processing large datasets with the iterator pattern and streams

Use the iterator protocol with streams and the `yield` keyword to process data on demand, preventing UI blocking and improving performance with large datasets.

#9about 3 minutes

Audience Q&A on patterns, typescript, and frameworks

The speaker answers audience questions about private class fields, using patterns with frameworks like React Native, and the rationale for teaching vanilla JavaScript over TypeScript.

Related jobs
Jobs that call for the skills explored in this talk.

test

Milly
Vienna, Austria

Intermediate

test

Milly
Vienna, Austria

Intermediate

Featured Partners

Related Articles

View all articles
AP
Anto Pranjić
11 Tips to Make The Most Out of Your First World Congress 
The world’s most awesome event for developers is taking place in less than a month! It’s been far too long since the last time we met in person, but that’s only going to make this year’s WeAreDevelopers World Congress a truly special experience. Conf...
11 Tips to Make The Most Out of Your First World Congress 
CH
Chris Heilmann
Dev Digest 136 - No JS(on) of mine
News and ArticlesDouglas Crockford is our featured video, so let's talk about evolving JavaScript and all things JSON. Judicious JSON explains all the weird things in it, you can learn why it can be incredibly slow, people wonder what even is a JSON ...
Dev Digest 136 - No JS(on) of mine
LM
Luis Minvielle
10 Developer Websites in 2023
As a web developer, you're always investigating how to level up your skills and streamline your workflow. That's why we've gathered a collection of 10 innovative tools that are guaranteed to boost your productivity, enhance your coding abilities, ele...
10 Developer Websites in 2023
EM
Eli McGarvie
8 Great Tech Documentaries For Developers
For decades, developers have been starved of good tech films, we’ve been living on Steve Jobs biopics and Mark Zuckerberg remakes. Last time I checked, no one is interested in Facebook and its FED co-founder. Where are all the cool films that are act...
8 Great Tech Documentaries For Developers

From learning to earning

Jobs that call for the skills explored in this talk.