Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying TypeScript 5 Design Patterns and Best Practices
  • Table Of Contents Toc
  • Feedback & Rating feedback
TypeScript 5 Design Patterns and Best Practices

TypeScript 5 Design Patterns and Best Practices - Second Edition

By : Theofanis Despoudis
5 (1)
close
close
TypeScript 5 Design Patterns and Best Practices

TypeScript 5 Design Patterns and Best Practices

5 (1)
By: Theofanis Despoudis

Overview of this book

Design patterns are the foundation of many world-class software applications, from commercial solutions to open-source projects. This guide equips you with the skills to architect robust, scalable, and maintainable TypeScript 5 applications. Whether you're looking to master modern TypeScript or apply proven software architecture patterns effectively, this book is your go-to resource. Written by Theofanis Despoudis, a recognized TypeScript expert, this second edition is fully updated with TypeScript 5’s latest features, including improved type inference, union enums, and decorators. These updates will help you write cleaner, more maintainable code that adapts to future changes. You’ll dive into classic Gang of Four design patterns through both traditional and modern real-world implementations, gaining hands-on experience with practical applications. You’ll also gain a clear understanding of the power of functional and reactive programming patterns specifically designed for idiomatic TypeScript development. By the end of this book, you’ll be able to identify and apply the right design pattern for any scenario and craft well-structured, maintainable, and testable code.
Table of Contents (17 chapters)
close
close
Lock Free Chapter
1
Part 1:Introduction to TypeScript 5
4
Part 2: TypeScript Core Design Patterns
9
Part 3: Advanced TypeScript Concepts and Best Practices

Class overuse

Object-Oriented Programming (OOP) principles and design patterns encourage modeling real-world entities using classes. While the benefits of OOP are well recognized, it often leads to an overabundance of classes. This can create complications in your code structure.

To explain what we mean, when you try emulating a system using classical OOP techniques such as inheritance and encapsulation, you inevitably have to carry over the whole hierarchy. In the next section, we’ll examine an analogy to emphasize this issue at hand.

The jungle problem

When you attempt to emulate a system using classical OOP techniques such as inheritance and encapsulation, you often end up carrying over entire class hierarchies. This is exemplified by the banana, monkey, jungle problem. For instance, if you want to use a Banana object, you might need to import a Jungle object that contains a Monkey instance, which exposes the getBanana() method:

new Jungle().getAnimalByType(&quot...
Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
TypeScript 5 Design Patterns and Best Practices
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon