Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
JavaScript Design Patterns

You're reading from  JavaScript Design Patterns

Product type Book
Published in Mar 2024
Publisher Packt
ISBN-13 9781804612279
Pages 308 pages
Edition 1st Edition
Languages
Author (1):
Hugo Di Francesco Hugo Di Francesco
Profile icon Hugo Di Francesco

Table of Contents (16) Chapters

Preface Part 1:Design Patterns
Chapter 1: Working with Creational Design Patterns Chapter 2: Implementing Structural Design Patterns Chapter 3: Leveraging Behavioral Design Patterns Part 2:Architecture and UI Patterns
Chapter 4: Exploring Reactive View Library Patterns Chapter 5: Rendering Strategies and Page Hydration Chapter 6: Micro Frontends, Zones, and Islands Architectures Part 3:Performance and Security Patterns
Chapter 7: Asynchronous Programming Performance Patterns Chapter 8: Event-Driven Programming Patterns Chapter 9: Maximizing Performance – Lazy Loading and Code Splitting Chapter 10: Asset Loading Strategies and Executing Code off the Main Thread Index Other Books You May Enjoy

What are creational design patterns?

Creational design patterns handle object creation. They allow a consumer to create object instances without knowing the details of how to instantiate the object. Since, in object-oriented languages, instantiation of objects is limited to a class’s constructor, allowing object instances to be created without calling the constructor is useful to reduce noise and tight coupling between the consumer and the class being instantiated.

In JavaScript, there’s ambiguity when we discuss “object creation,” since JavaScript’s multi-paradigm nature means we can create objects without a class or a constructor. For example, in JavaScript this is an object creation using an object literal – const config = { forceUpdate: true }. In fact, modern idiomatic JavaScript tends to lean more toward procedural and function paradigms than object orientation. This means that creational design patterns may have to be adapted to be fully useful in JavaScript.

In summary, creational design patterns are useful in object-oriented JavaScript, since they hide instantiation details from consumers, which keeps coupling low, thereby allowing better module separation.

In the next section, we’ll encounter our first creational design pattern – the prototype design pattern.

You have been reading a chapter from
JavaScript Design Patterns
Published in: Mar 2024 Publisher: Packt ISBN-13: 9781804612279
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}