O'Reilly logo
live online training icon Live Online training

Design Patterns with TypeScript

Enhance your TypeScript development by cleaning up your code and getting the most out of the language

Mark Halpin

Take your TypeScript knowledge to the next level with Design Patterns! Design patterns are standard ways to approach a problem programmatically. In other words, design patterns offer you a tried and true solution to common programming problems. If you have ever wanted to learn design patterns, now is the time! Learn commonly implemented design patterns (some of which you might be using without knowing it) to create clean, concise, and easy to maintain code.

In this training, you will learn what design patterns are, why you want to utilize them, and how to use them. You will discover three categories of design patterns (Behavioral, Creational, and Structural) and which patterns make up each group. After this training, you will have more confidence in your abilities knowing you can write cleaner, more readable, and maintainable code.

What you'll learn-and how you can apply it

By the end of this live, hands-on, online course, you’ll understand:

  • What design patterns are and how to use them
  • When to pick specific design patterns
  • How to use TypeScript to its fullest potential

And you’ll be able to:

  • Understand how design patterns impact the code you are writing and why they are used
  • Create code that is clean and easier to maintain
  • Implement design patterns in your application

This training course is for you because...

  • You’re a TypeScript developer who wants to take their skills to a higher level.
  • You want a deep dive into object oriented principles in software development.
  • You have never implemented design patterns and want to start improving your code.

Prerequisites

  • Intermediate knowledge of TypeScript

Recommended preparation:

Recommended follow-up:

About your instructor

  • Mark Halpin is a technologist who has worked with various companies developing DevOps, FinTech, SaaS, and analytics software using tools, such as Java, Spring, Angular, Oracle, and Postgres. Mark is currently working at SAS as a full-stack software engineer, developing applications using Javascript, NodeJS and Python. When he is not in front of a computer, Mark enjoys spending time with family.

Schedule

The timeframes are only estimates and may vary according to how the class is progressing

Understanding Design Patterns (30 minutes)

  • Presentation: What Are Design Patterns? (5 minutes)
  • Discussion: Why Do We Need Design Patterns? (10 minutes)
  • Presentation: Selecting and Using Design Patterns (10 minutes)
  • Q&A (5 minutes)

Behavioral Patterns (55 minutes)

  • Presentation: Review 3 of the behavioral design patterns (Observer, State, Iterator). (10 minutes)
  • Discussion: How to choose a behavioral design pattern. (10 minutes)
  • Exercise: How to implement the observer pattern for change detection and object updates. (10 minutes)
  • Exercise: How to implement the state pattern for maintaining context across multiple objects. (10 minutes)
  • Exercise: How to implement the iterator pattern for traversing lists. (10 minutes)
  • Q&A (5 minutes)
  • Break (5 minutes)

Creational Patterns (55 minutes)

  • Presentation: Review 3 of the creational design patterns (Factory, Prototype, Singleton) and explain when to choose them, and how to implement them. (10 minutes)
  • Discussion: How to choose a creational design pattern. (10 minutes)
  • Exercise: How to implement the factory design pattern, used for defining interfaces that create objects. (10 minutes)
  • Exercise: How to implement the prototype design pattern for separating a system from its products. (10 minutes)
  • Exercise: How to implement the singleton design pattern to ensure that classes only have a single, global instance. (10 minutes)
  • Q&A (5 minutes)
  • Break (5 minutes)

Structural Patterns (1 hour)

  • Presentation: Review 3 of the structural design patterns (Adapter, Facade, Decorator) and explain when to choose them, and how to implement them. (10 minutes)
  • Discussion: How to choose a structural design pattern. (10 minutes)
  • Exercise: How to implement the adapter design pattern to allow various classes to work together regardless of their interfaces. (10 minutes)
  • Exercise: How to implement the facade design pattern to provide a simple interface to complex subsystems. (10 minutes)
  • Exercise: How to implement the decorator design pattern to attach additional functionality to a function dynamically. (10 minutes)
  • Q&A (10 minutes)