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.

Featured Partners

Related Articles

View all articles
DC
Daniel Cranney
Dev Digest 195: End of Likes, JavaScript’s a Zoo, and Messing with Bots!
Inside last week’s Dev Digest 195 . 👎 No more external likes 🤗 Needy programs 📉 The worst selling Microsoft product 🟨 JavaScript engines zoo 🍞 No more toasts! 🤖 Messing with bots 👔 Beware of fake job interviews 🗞️ Join over 150,000 developers alread...
Dev Digest 195: End of Likes, JavaScript’s a Zoo, and Messing with Bots!
BR
Benjamin Ruschin
The HTML Elements That You’re Probably Over-Engineering
As frameworks have become more and more commonplace in the world of web development, so too has the over-engineering of features made possible by our humble old friend, HTML. The mental models that come with using state management in React, Vue and o...
The HTML Elements That You’re Probably Over-Engineering
DC
Daniel Cranney
How to Avoid Over-Engineering
In today’s software development world, the demand for designing applications that are both robust and easy to maintain is more pressing than ever. Many developers encounter the architectural chaos left behind in older codebases, leading to frustratio...
How to Avoid Over-Engineering

From learning to earning

Jobs that call for the skills explored in this talk.

Software Engineer

Software Engineer

tree-IT GmbH
Bad Neustadt an der Saale, Germany

54-80K
Intermediate
Senior
Java
TypeScript
Spring Boot
Angular Developer

Angular Developer

Picnic Technologies B.V.
Amsterdam, Netherlands

Intermediate
Senior
RxJS
Angular
TypeScript
Creative Javascript

Creative Javascript

Thegiglab
Amsterdam, Netherlands

Intermediate
API
CSS
HTML
jQuery
Bootstrap
+1