Pro JavaScript design patterns : [the essentials of object-oriented JavaScript programming
معرفی کتاب «Pro JavaScript design patterns : [the essentials of object-oriented JavaScript programming» نوشتهٔ Ross Harmes, Dustin Diaz، منتشرشده توسط نشر Apress ; Distributed to the Book trade worldwide by Springer-Verlag New York در سال 2008. این کتاب در 5 صفحه، فرمت pdf، زبان انگلیسی ارائه شده است. «Pro JavaScript design patterns : [the essentials of object-oriented JavaScript programming» در دستهٔ بدون دستهبندی قرار دارد.
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 ## Who this book is for This book will be an invaluable learning tool for any experienced JavaScript developer. ## Table of Contents Contents......Page 6 About the Authors......Page 13 About the Technical Reviewer......Page 14 Acknowledgments......Page 15 Introduction......Page 16 PART 1: Object-Oriented JavaScript......Page 22 The Flexibility of JavaScript......Page 23 Functions As First-Class Objects......Page 26 The Mutability of Objects......Page 28 Design Patterns in JavaScript......Page 29 Summary......Page 30 What Is an Interface?......Page 31 How Other Object-Oriented Languages Handle Interfaces......Page 32 Emulating an Interface in JavaScript......Page 34 The Interface Implementation for This Book......Page 38 The Interface Class......Page 39 Summary......Page 43 The Information Hiding Principle......Page 44 Basic Patterns......Page 45 More Advanced Patterns......Page 54 Drawbacks to Using Encapsulation......Page 58 Summary......Page 59 Why Do You Need Inheritance?......Page 60 Classical Inheritance......Page 61 Prototypal Inheritance......Page 64 Inheritance and Encapsulation......Page 68 Mixin Classes......Page 69 Example: Edit-in-Place......Page 71 When Should Inheritance Be Used?......Page 81 Summary......Page 82 The Basic Structure of the Singleton......Page 83 Namespacing......Page 84 A Singleton As a Wrapper for Page-Specific Code......Page 86 A Singleton with Private Members......Page 88 Lazy Instantiation......Page 93 Branching......Page 96 Example: Creating XHR Objects with Branching......Page 97 Benefits of the Singleton Pattern......Page 99 Summary......Page 100 CHAPTER 6: Chaining......Page 101 The Structure of a Chain......Page 102 Building a Chainable JavaScript Library......Page 104 Using Callbacks to Retrieve Data from Chained Methods......Page 107 Summary......Page 108 PART 2: Design Patterns......Page 109 The Simple Factory......Page 110 The Factory Pattern......Page 113 Example: XHR Factory......Page 116 Example: RSS Reader......Page 121 Benefits of the Factory Pattern......Page 124 Summary......Page 125 Example: Event Listeners......Page 126 Other Examples of Bridges......Page 127 Example: Building an XHR Connection Queue......Page 128 When Should the Bridge Pattern Be Used?......Page 139 Summary......Page 140 CHAPTER 9: The Composite Pattern......Page 141 Using the Composite Pattern......Page 142 Example: Form Validation......Page 143 Example: Image Gallery......Page 152 Drawbacks of the Composite Pattern......Page 155 Summary......Page 156 Some Facade Functions You Probably Already Know About......Page 157 JavaScript Libraries As Facades......Page 158 Facades As Convenient Methods......Page 159 Example: Setting Styles on HTML Elements......Page 160 Example: Creating an Event Utility......Page 162 General Steps for Implementing the Facade Pattern......Page 163 Summary......Page 164 Characteristics of an Adapter......Page 165 Example: Adapting One Library to Another......Page 166 Example: Adapting an Email API......Page 168 Summary......Page 174 The Structure of the Decorator......Page 175 In What Ways Can a Decorator Modify Its Component?......Page 180 The Role of the Factory......Page 185 Function Decorators......Page 188 Example: Method Profiler......Page 189 Drawbacks of the Decorator Pattern......Page 192 Summary......Page 193 Example: Car Registrations......Page 194 Example: Web Calendar......Page 198 Example: Tooltip Objects......Page 201 Storing Instances for Later Reuse......Page 205 When Should the Flyweight Pattern Be Used?......Page 207 Benefits of the Flyweight Pattern......Page 208 Summary......Page 209 The Structure of the Proxy......Page 211 Example: Page Statistics......Page 215 General Pattern for Wrapping a Web Service......Page 219 Example: Directory Lookup......Page 220 General Pattern for Creating a Virtual Proxy......Page 224 Drawbacks of the Proxy Pattern......Page 227 Summary......Page 228 Example: Newspaper Delivery......Page 229 Building an Observer API......Page 232 Observers in Real Life......Page 234 Example: Animation......Page 235 Event Listeners Are Also Observers......Page 236 Summary......Page 237 The Structure of the Command......Page 238 Types of Command Objects......Page 241 Example: Menu Items......Page 243 Example: Undo and Logging......Page 248 When to Use the Command Pattern......Page 255 Drawbacks of the Command Pattern......Page 256 Summary......Page 257 The Structure of the Chain of Responsibility......Page 258 Passing on Requests......Page 264 Implementing a Chain of Responsibility in an Existing Hierarchy......Page 267 When Should the Chain of Responsibility Pattern Be Used?......Page 268 Example: Image Gallery Revisited......Page 269 Benefits of the Chain of Responsibility Pattern......Page 274 Summary......Page 275 C......Page 276 D......Page 277 F......Page 278 L......Page 279 P......Page 280 S......Page 281 X......Page 282 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 unlockedJavaScript is capable of full objectoriented capabilities, and by applyingobject-oriented 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 objectoriented programming in JavaScript applicable to design patterns, including making JavaScript more expressive, inheritance, encapsulation, information hiding, and more. With that covered, you can kickstart 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, facades, adapters, and many more. Each chapter is packed with realworld 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 objectoriented programming in JavaScript, as they apply to design patterns Apply design patterns to your kickstart your JavaScript development Work through several realworld examples What you'll learn How to apply objectoriented programming techniques in JavaScript How to take advantage of inheritance, interfaces, and encapsulation and information hiding to kickstart your JavaScript development How to implement several design patterns in your JavaScript projects, including factory, facade, 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 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 object-oriented 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 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. Pt. 1. Object-oriented Javascript -- Ch. 1. Expressive Javascript -- Ch. 2. Interfaces -- Ch. 3. Encapsulation And Information Hiding -- Ch. 4. Inheritance -- Ch. 5. The Singleton Pattern -- Ch. 6. Chaining -- Pt. 2. Design Patterns -- Ch. 7. The Factory Pattern -- Ch. 8. The Bridge Pattern -- Ch. 9. The Composite Pattern -- Ch. 10. The Facade Pattern -- Ch. 11. The Adapter Pattern -- Ch. 12. The Decorator Pattern -- Ch. 13. The Flyweight Pattern -- Ch. 14. The Proxy Pattern -- Ch. 15. The Observer Pattern -- Ch. 16. The Command Pattern -- Ch. 17. The Chain Of Responsibility Pattern. Ross Harmes And Dustin Diaz. Includes Index. 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. The book then details how to implement and take advantage of several design patterns in JavaScript. 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. JavaScript is a hugely popular language for adding dynamic functionality to web pages, and it is possible to use design patterns within JavaScript to further improve your code - they can improve efficiency, cut down on repetition, and provide useful frameworks to build code on top of. This book (the only one available covering JavaScript design patterns thoroughly) gives web developers all they know to start using design patterns in their JavaScripting, including several real world examples for them to learn from.
دانلود کتاب Pro JavaScript design patterns : [the essentials of object-oriented JavaScript programming