Learning JavaScript Design Patterns

A JavaScript and Jquery Developer's Guide
 
 
O'Reilly (Verlag)
  • 1. Auflage
  • |
  • erschienen am 8. Juli 2012
  • |
  • 254 Seiten
 
E-Book | ePUB mit Adobe-DRM | Systemvoraussetzungen
978-1-4493-3487-1 (ISBN)
 
With Learning JavaScript Design Patterns, youll learn how to write beautiful, structured, and maintainable JavaScript by applying classical and modern design patterns to the language. If you want to keep your code efficient, more manageable, and up-to-date with the latest best practices, this book is for you.Explore many popular design patterns, including Modules, Observers, Facades, and Mediators. Learn how modern architectural patternssuch as MVC, MVP, and MVVMare useful from the perspective of a modern web application developer. This book also walks experienced JavaScript developers through modern module formats, how to namespace code effectively, and other essential topics.Learn the structure of design patterns and how they are writtenUnderstand different pattern categories, including creational, structural, and behavioralWalk through more than 20 classical and modern design patterns in JavaScriptUse several options for writing modular codeincluding the Module pattern, Asyncronous Module Definition (AMD), and CommonJSDiscover design patterns implemented in the jQuery libraryLearn popular design patterns for writing maintainable jQuery plug-ins&quote;This book should be in every JavaScript developers hands. Its the go-to book on JavaScript patterns that will be read and referenced many times in the future.&quote;Andre Hansson, Lead Front-End Developer, presis!
  • Englisch
  • Sebastopol
  • |
  • USA
  • Windows
978-1-4493-3487-1 (9781449334871)

weitere Ausgaben werden ermittelt
  • Intro
  • Table of Contents
  • Preface
  • Target Audience
  • Credits
  • Reading
  • Conventions Used in This Book
  • Using Code Examples
  • Safari® Books Online
  • How to Contact Us
  • Acknowledgments
  • Chapter 1. Introduction
  • Chapter 2. What Is a Pattern?
  • We Already Use Patterns Every Day
  • Chapter 3. "Pattern"-ity Testing, Proto-Patterns, and 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 Patterns
  • 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 Constructor Pattern
  • Object Creation
  • Basic Constructors
  • Constructors with Prototypes
  • The Module Pattern
  • Object Literals
  • The Module Pattern
  • Privacy
  • History
  • Examples
  • Module Pattern Variations
  • Import mixins
  • Exports
  • Toolkit and framework-specific module pattern implementations
  • Dojo
  • ExtJS
  • YUI
  • jQuery
  • Advantages
  • Disadvantages
  • The Revealing Module Pattern
  • Advantages
  • Disadvantages
  • The Singleton Pattern
  • The Observer Pattern
  • Differences Between the Observer and Publish/Subscribe Pattern
  • Advantages
  • Disadvantages
  • Publish/Subscribe Implementations
  • A Publish/Subscribe implementation
  • Using our implementation
  • User-interface notifications
  • Decoupling applications using Ben Alman's Pub/Sub implementation
  • Decoupling an Ajax-based jQuery application
  • The Mediator Pattern
  • Basic Implementation
  • Advanced Implementation
  • Example
  • Advantages and Disadvantages
  • Mediator Versus Observer
  • Mediator Versus Facade
  • The Prototype Pattern
  • The Command Pattern
  • The Facade Pattern
  • Notes on Abstraction
  • The Factory Pattern
  • When to Use the Factory Pattern
  • When Not to Use the Factory Pattern
  • Abstract Factories
  • The Mixin Pattern
  • Subclassing
  • Mixins
  • Advantages and Disadvantages
  • The Decorator Pattern
  • Pseudoclassical Decorators
  • Interfaces
  • Abstract Decorators
  • Decorators with jQuery
  • Advantages and Disadvantages
  • Flyweight
  • Using Flyweights
  • Flyweights and Sharing Data
  • Implementing Classical Flyweights
  • Duck punching "implements"
  • Converting Code to Use the Flyweight Pattern
  • A Basic Factory
  • Managing the Extrinsic States
  • The Flyweight Pattern and the DOM
  • Chapter 10. JavaScript MV* Patterns
  • MVC
  • Smalltalk-80 MVC
  • MVC for JavaScript Developers
  • Models
  • Views
  • Templating
  • Controllers
  • Controllers in Another Library (Spine.js) Versus Backbone.js
  • Spine.js
  • Backbone.js
  • What Does MVC Give Us?
  • Smalltalk-80 MVC in JavaScript
  • Delving Deeper
  • Summary
  • MVP
  • Models, Views, and Presenters
  • MVP or MVC?
  • MVC, MVP, and Backbone.js
  • MVVM
  • History
  • Model
  • View
  • ViewModel
  • Recap: The View and the ViewModel
  • Recap: The ViewModel and the Model
  • Pros and Cons
  • Advantages
  • Disadvantages
  • MVVM with Looser Data Bindings
  • MVC Versus MVP Versus MVVM
  • Backbone.js Versus KnockoutJS
  • Chapter 11. Modern Modular JavaScript Design Patterns
  • A Note on Script Loaders
  • AMD
  • Getting Started with Modules
  • AMD Modules with Dojo
  • AMD Module Design Patterns (Dojo)
  • AMD Modules with jQuery
  • Registering jQuery as an Async-compatible module
  • Why AMD is a better choice for writing modular JavaScript
  • Related reading
  • Script loaders and frameworks that support AMD
  • AMD Conclusions
  • CommonJS
  • Getting Started
  • Consuming Multiple Dependencies
  • Loaders and Frameworks that Support CommonJS
  • Is CommonJS Suitable for the Browser?
  • Related Reading
  • AMD and CommonJS: Competing, but Equally Valid Standards
  • UMD: AMD and CommonJS-Compatible Modules for Plug-ins
  • Basic AMD hybrid format
  • Using CommonJS, AMD, or browser globals to create a module
  • jQuery plug-ins that function in all environments
  • Further reading
  • ES Harmony
  • Modules with Imports and Exports
  • Modules Loaded from Remote Sources
  • Module Loader API
  • CommonJS-like Modules for the Server
  • Classes with Constructors, Getters, and Setters
  • ES Harmony Conclusions
  • Related Reading
  • Conclusions
  • Chapter 12. Design Patterns in jQuery
  • The Composite Pattern
  • The Adapter Pattern
  • The Facade Pattern
  • The Observer Pattern
  • The Iterator Pattern
  • Lazy Initialization
  • The Proxy Pattern
  • The Builder Pattern
  • Chapter 13. jQuery Plug-in Design Patterns
  • Patterns
  • A Lightweight Start Pattern
  • Further Reading
  • Complete Widget Factory Pattern
  • Further Reading
  • Nested Namespacing Plug-in Pattern
  • Further Reading
  • Custom Events Plug-in Pattern (with the Widget Factory)
  • Further Reading
  • Prototypal Inheritance with the DOM-to-Object Bridge Pattern
  • Further Reading
  • jQuery UI Widget Factory Bridge Pattern
  • Further Reading
  • jQuery Mobile Widgets with the Widget Factory
  • RequireJS and the jQuery UI Widget Factory
  • Usage
  • Further Reading
  • Globally and Per-Call Overridable Options (Best Options Pattern)
  • Further Reading
  • A Highly Configurable and Mutable Plug-in Pattern
  • Further Reading
  • What Makes a Good Plug-in Beyond Patterns?
  • Quality
  • Code Style
  • Compatibility
  • Reliability
  • Performance
  • Documentation
  • Likelihood of maintenance
  • Conclusions
  • Namespacing Patterns
  • Namespacing Fundamentals
  • Single Global Variables
  • Prefix Namespacing
  • Object Literal Notation
  • Nested Namespacing
  • Immediately Invoked Function Expressions (IIFE)s
  • Namespace Injection
  • Advanced Namespacing Patterns
  • Automating Nested Namespacing
  • Dependency Declaration Pattern
  • Deep Object Extension
  • Recommendation
  • Chapter 14. Conclusions
  • Appendix. References
  • Index

Dateiformat: ePUB
Kopierschutz: Adobe-DRM (Digital Rights Management)

Systemvoraussetzungen:

Computer (Windows; MacOS X; Linux): Installieren Sie bereits vor dem Download die kostenlose Software Adobe Digital Editions (siehe E-Book Hilfe).

Tablet/Smartphone (Android; iOS): Installieren Sie bereits vor dem Download die kostenlose App Adobe Digital Editions oder die App PocketBook (siehe E-Book Hilfe).

E-Book-Reader: Bookeen, Kobo, Pocketbook, Sony, Tolino u.v.a.m. (nicht Kindle)

Das Dateiformat ePUB ist sehr gut für Romane und Sachbücher geeignet - also für "fließenden" Text ohne komplexes Layout. Bei E-Readern oder Smartphones passt sich der Zeilen- und Seitenumbruch automatisch den kleinen Displays an. Mit Adobe-DRM wird hier ein "harter" Kopierschutz verwendet. Wenn die notwendigen Voraussetzungen nicht vorliegen, können Sie das E-Book leider nicht öffnen. Daher müssen Sie bereits vor dem Download Ihre Lese-Hardware vorbereiten.

Bitte beachten Sie bei der Verwendung der Lese-Software Adobe Digital Editions: wir empfehlen Ihnen unbedingt nach Installation der Lese-Software diese mit Ihrer persönlichen Adobe-ID zu autorisieren!

Weitere Informationen finden Sie in unserer E-Book Hilfe.


Als Download verfügbar

59,99 €
inkl. 7% MwSt.
E-Book Einzellizenz
ePUB mit Adobe-DRM
siehe Systemvoraussetzungen
E-Book bestellen