Tài liệu Learning JavaScript Design Patterns doc

199 1.3K 2
Tài liệu Learning JavaScript Design Patterns doc

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

[...]... Object-Oriented design patterns frequently used around the world today We will be covering these patterns in more detail in the section ‘Categories of Design Patterns In this book, we will take a look at a number of popular JavaScript design patterns and explore why certain patterns may be more suitable for your projects than others Remember that patterns can be applied not just to vanilla JavaScript (i.e... classes | 19 CHAPTER 9 JavaScript Design Patterns We are now going to explore JavaScript implementations of a number of both classical and modern design patterns This section of the book will cover an introduction to these patterns, whilst the next section will focus on looking at some select patterns in greater detail A common question developers regularly ask is what the 'ideal' set of patterns they should... in pattern design: When writing a pattern, you do not need to be the original discoverer of the solutions being documented nor do you have to worry about your design overlapping with minor pieces of other patterns. If your design is strong enough to have broad useful applicability, it has a chance of being recognized as a proper pattern • Know the differences between patterns and design: A design pattern... 5: Writing Design Patterns CHAPTER 6 Anti -Patterns If we consider that a pattern represents a best-practice, an anti-pattern represents a lesson that has been learned The term anti -patterns was coined in 1995 by Andrew Koenig in the November C++ Report that year, inspired by the GoF's book Design Patterns In Koenig’s report, there are two notions of anti -patterns that are presented Anti -Patterns: •... view of other design constraints, and the consequences and trade-offs of its use Since we must eventually implement our designs, a design pattern also provides sample code to illustrate an implementation Although design patterns describe object-oriented designs, they are based on practical solutions that have been implemented in mainstream object-oriented programming languages ” Design patterns can... Always research thoroughly before working on new patterns however, as you may find it more beneficial to use or build on top of existing proven patterns than starting afresh 10 | Chapter 4: The Structure Of A Design Pattern CHAPTER 5 Writing Design Patterns Although this book is aimed at those new to design patterns, a fundamental understanding of how a design pattern is written can offer you a number... intermediate developers, a basic understanding of JavaScript fundamentals is assumed Should you wish to learn more about the language, I am happy to recommend the following titles: • • • • • JavaScript: The Definitive Guide by David Flanagan Eloquent JavaScript by Marijn Haverbeke JavaScript Patterns by Stoyan Stefanov Writing Maintainable JavaScript by Nicholas Zakas JavaScript: The Good Parts by Douglas Crockford... into those that do Patterns that fall under this category include: Decorator, Facade, Flyweight, Adapter and Proxy Behavioral Design Patterns Behavioral patterns focus on improving or streamlining the communication between disparate objects in a system Some behavioral patterns include: Iterator, Mediator, Observer and Visitor 16 | Chapter 7: Categories Of Design Pattern CHAPTER 8 Design Pattern Categorization... about into the first documentation about design patterns, which was to be a guide for novice developers looking to improve their coding skills It's important to note that the concepts behind design patterns have actually been around in the programming industry since its inception, albeit in a less formalized form One of the first and arguably most iconic formal works published on design patterns in software... size of your codebase can be decreased • Patterns add to a developers vocabulary, which makes communication faster • Patterns that are frequently used can be improved over time by harnessing the collective experiences other developers using those patterns contribute back to the design pattern community In some cases this leads to the creation of entirely new design patterns whilst in others it can lead . h1" alt="" Learning JavaScript Design Patterns Addy Osmani Beijing • Cambridge • Farnham • Köln • Sebastopol • Tokyo Learning JavaScript Design Patterns by. . . . . . . . . . . 15 Creational Design Patterns 15 Structural Design Patterns 16 Behavioral Design Patterns 16 8. Design Pattern Categorization . . .

Ngày đăng: 12/02/2014, 12:20

Từ khóa liên quan

Mục lục

  • Cover

  • Table of Contents

  • Preface

    • Target Audience

    • Acknowledgments

    • Credits

    • Reading

    • Chapter 1. Introduction

    • Chapter 2. What is a Pattern?

      • We already use patterns everyday

      • Chapter 3. 'Pattern'-ity Testing, Proto-Patterns & The Rule Of Three

      • Chapter 4. The Structure Of A Design Pattern

      • Chapter 5. Writing Design Patterns

      • Chapter 6. Anti-Patterns

      • Chapter 7. Categories Of Design Pattern

        • Creational Design Patterns

        • Structural Design Patterns

        • Behavioral Design Patterns

        • Chapter 8. Design Pattern Categorization

          • A brief note on classes

          • Chapter 9. JavaScript Design Patterns

            • The Creational Pattern

            • The Constructor Pattern

              • Basic Constructors

              • Constructors With Prototypes

              • The Singleton Pattern

Tài liệu cùng người dùng

Tài liệu liên quan