O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Mastering JavaScript Design Patterns: A Practical Introduction to Building Better Applications

Video Description

A practical introduction to writing better and more maintainable code using JavaScript design patterns

About This Video

  • A practical, application-oriented guide to working with JavaScript design patterns

  • Build a music player application and tackle real-world challenges that appear as the application grows in complexity

  • Enhance the application's functionality and performance through writing modular, strongly organized code

  • Understand how design patterns can improve the testability and maintainability of application code, and embed healthy programming practices

  • In Detail

    As the language of the web, JavaScript is used prolifically by developers building new applications every day. However, some developers still lack the knowledge about how to write things in a simpler, clearer and more maintainable way. Design patterns are proven solutions to common development problems, and can boost code quality and application maintainability, as well as improve developer efficiency.

    Mastering JavaScript Design Patterns demonstrates how to apply design patterns in real life situations, whether that's for new, or already existing projects. It will help you to make your applications more flexible, perform better, and easier to maintain.

    We’ll begin by building a simple music player application, and then we’ll build and add more and more functionality to our music player application. We’ll also cover different ways to modularize the application.

    In the next two sections we’ll build a server and will load data from it. We’ll cover different techniques for caching, fallbacks, optimizing memory consumption and deferred actions.

    In the last section we’ll cover code maintainability improvement techniques by using less known, yet powerful JavaScript techniques.

    Table of Contents

    1. Chapter 1 : Introduction
      1. The Course Overview 00:03:01
      2. Software Design Patterns and Antipatterns 00:02:45
      3. JavaScript Patterns Specifics 00:02:52
    2. Chapter 2 : Starting the Project
      1. Bootstrapping the Project 00:05:30
      2. Adding the Play Functionality 00:03:57
      3. Encapsulating Information 00:02:43
      4. Abstracting Manipulation with DOM Events and Elements 00:04:26
      5. Creating an Adapter to Set Intervals Using Seconds 00:01:25
      6. Using Different Ways to Match Conditions 00:02:29
    3. Chapter 3 : Modularizing the Application
      1. Modularizing the Application Using Namespaces 00:04:33
      2. Modularizing the Application Using AMD and Require.js 00:04:10
      3. Communication Between Modules 00:05:00
      4. ES6 Modules 00:04:52
    4. Chpater 4 : Organizing the Application Through Separation of Concerns
      1. Decoupling the Tracks Queue from the Tracks Player 00:04:22
      2. Treating Each Track as a Separate Component 00:07:20
      3. Adding the PubSub Functionality to Tracks 00:02:24
      4. Enabling Track Play and Highlighting the Active Track 00:04:21
      5. Decoupling the Track Model from the View 00:03:06
      6. Formatting Track Time: Two-way Data Binding 00:04:20
    5. Chapter 5 : Enhancing the Tracks Functionality and Adding Nested Tracks
      1. Adding a Few Types of Tracks 00:03:09
      2. Implementing Track Removal 00:03:15
      3. Iterating Over Tracks Using a Generator 00:02:45
      4. Iterating Over Tracks Using an Iterator 00:02:51
      5. Adding Nested Tracks and Displaying Them 00:02:45
      6. Fixing the Queue to Work with Nested Tracks 00:04:39
    6. Chapter 6 : Building the Server and Loading Data from It
      1. Creating the Server Using Node.js 00:02:17
      2. Returning the Tracks Queue from the Server 00:03:58
      3. Loading Tracks from the Server 00:02:32
      4. Replacing Callbacks with Promises 00:01:41
      5. Binding a Function to a Custom Context 00:01:34
    7. Chapter 7 : Loading Tracks' Additional Data
      1. Loading Tracks' Additional Data from the Server 00:04:27
      2. Caching Data Loaded from the Server 00:01:53
      3. Checking for Track Data with a Fallback 00:03:08
      4. Storing Common Tracks Data in Shared Objects 00:02:43
    8. Chapter 8 : Improving Code Maintainability
      1. Adding Different Skins for the Player Header 00:04:17
      2. Improving Testability by Inversion of Control 00:01:57
      3. Forcing Function Argument Types 00:03:02
      4. Fixing Models to Support Any String as Attribute Name 00:03:38