As a web developer, you’ll already know that JavaScript is a powerful language, allowing you to add an impressive array of dynamic functionality to otherwise static web sites. But there is more power waiting to be unlocked—JavaScript is capable of full object–oriented capabilities, and by applying OOP principles, best practices, and design patterns to your code, you can make it more powerful, more efficient, and easier to work with alone or as part of a team.
With Pro JavaScript Design Patterns, you’ll start with the basics of object–oriented programming in JavaScript applicable to design patterns, including making JavaScript more expressive, inheritance, encapsulation, information hiding, and more. With that covered, you can kick–start your JavaScript development in the second part of the book, where you’ll find detail on how to implement and take advantage of several design patterns in JavaScript, including composites, decorators, façades, adapters, and many more.
Each chapter is packed with real–world examples of how the design patterns are best used and expert advice on writing better code, as well as what to watch out for. Along the way you’ll discover how to create your own libraries and APIs for even more efficient coding.
- Master the basics of object–oriented programming in JavaScript, as they apply to design patterns.
- Apply design patterns to your kick–start your JavaScript development.
- Work through several real–world examples.
What you’ll learn
- How to apply object–oriented programming techniques in JavaScript
- How to take advantage of inheritance, interfaces, and encapsulation and information hiding to kick–start your JavaScript development
- How to implement several design patterns in your JavaScript projects, including factory, façade, bridge, composite, adapter, decorator, flyweight, proxy, command, observer, and chain of responsibility
- How to make your code easier to manage in a team environment, as well as on your own
- How to create your own libraries and APIs
Who this book is for
This book will be an invaluable learning tool for any experienced JavaScript developer.
Table of Contents
- Expressive JavaScript
- Interfaces
- Encapsulation and Information Hiding
- Inheritance
- The Singleton Pattern
- Chaining
- The Factory Pattern
- The Bridge Pattern
- The Composite Pattern
- The Facade Pattern
- The Adapter Pattern
- The Decorator Pattern
- The Flyweight Pattern
- The Proxy Pattern
- The Observer Pattern
- The Command Pattern
- The Chain of Responsibility Pattern
Dustin Diaz is a User Interface Engineer who enjoys writing JavaScript, CSS, and HTML as well as making interactive and usable interfaces to create passionate users. After working a series of jobs with titles like Freelance Programmer, IT Consultant and Web Developer on the east coast, Ross Harmes now works as a Front End Engineer for Yahoo! Small Business in Sunnyvale, California. He is the owner of the open source project Birch, an easily installable photoblog. He and Tristan have been making websites together since 1994 (those first few were shockingly ugly and have thankfully disappeared into the ether), and will continue to do so until they pry the keyboards out of their cold, dead hands. On the weekends, Ross can be seen biking around the Bay Area hills and streets.