Programming JavaScript Applications : Robust Web Architecture with Node, HTML5, and Modern JS Libraries
معرفی کتاب «Programming JavaScript Applications : Robust Web Architecture with Node, HTML5, and Modern JS Libraries» نوشتهٔ Elliott, Eric، منتشرشده توسط نشر O'Reilly Media; O'Reilly در سال 2014. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است. «Programming JavaScript Applications : Robust Web Architecture with Node, HTML5, and Modern JS Libraries» در دستهٔ بدون دستهبندی قرار دارد.
Take advantage of JavaScript's power to build robust web-scale or enterprise applications that are easy to extend and maintain. By applying the design patterns outlined in this practical book, experienced JavaScript developers will learn how to write flexible and resilient code that's easier--yes, easier--to work with as your code base grows. JavaScript may be the most essential web programming language, but in the real world, JavaScript applications often break when you make changes. With this book, author Eric Elliott shows you how to add client- and server-side features to a large JavaScript application without negatively affecting the rest of your code. Examine the anatomy of a large-scale JavaScript application Build modern web apps with the capabilities of desktop applications Learn best practices for code organization, modularity, and reuse Separate your application into different layers of responsibility Build efficient, self-describing hypermedia APIs with Node.js Test, integrate, and deploy software updates in rapid cycles Control resource access with user authentication and authorization Expand your application's reach through internationalization Copyright 4 Table of Contents 5 Preface 9 Introduction 9 Who This Book Is For 10 Who This Book Is Not For 10 Unit Testing 11 Conventions Used in This Book 11 Safari庐 Books Online 12 How to Contact Us 12 Thanks 13 Chapter聽1.聽The JavaScript Revolution 15 Advantages of JavaScript 16 Performance 16 Objects 16 Syntax 17 First-Class Functions 17 Events 17 Reusability 18 The Net Result 18 Anatomy of a Typical Modern JavaScript App 18 Infrastructure 18 JSON: Data Storage and Communication 19 NoSQL Data Stores 20 RESTful JSON Web Services 20 Chapter聽2.聽Functions 23 Minimize Side Effects 24 Function Definition 26 Named Function Expressions 28 Lambdas 30 Immediately Invoked Function Expressions 32 Method Context 34 Function Scope 36 Hoisting 36 Closures 39 Method Design 41 Named Parameters 42 Function Polymorphism 43 Generics and Collection Polymorphism 46 Method Chaining and Fluent APIs 49 Functional Programming 50 Stateless Functions (aka Pure Functions) 52 Partial Application and Currying 54 Asynchronous Operations 55 Callbacks 55 Promises and Deferreds 56 Conclusion 58 Chapter聽3.聽Objects 61 Classical Inheritance Is Obsolete 62 Fluent-Style JavaScript 65 Prototypes 67 Delegate Prototypes 67 Prototype Cloning 70 The Flyweight Pattern 71 Object Creation 73 Factories 75 Prototypal Inheritance with Stamps 78 Conclusion 83 Chapter聽4.聽Modules 85 Principles of Modularity 86 Interfaces 87 The Module Pattern 91 Asynchronous Module Definition 93 Plug-Ins 95 Node-Style Modules 96 npm 98 ES6 Modules 100 Building Client-Side Code with CommonJS, npm, Grunt, and Browserify 101 Defining the App 101 Feature Implementation 104 Bundling and Deployment 107 Conclusion 112 Chapter聽5.聽Separation of Concerns 113 Client-Side Concerns 114 Module Management 115 Events 120 Model View Controller/MV* 128 Presentation and DOM Manipulation 131 Server-Side Concerns 139 Getting Started with Node and Express 139 Conclusion 148 Chapter聽6.聽Access Control 151 Authentication 151 Passwords 151 Credential 155 Multifactor Authentication 157 Federated and Delegated Authentication 159 Authorization 161 Authorizing Applications 162 OAuth 2.0 163 Conclusion 164 Chapter聽7.聽Logging 165 Debugging 165 Server Operations 167 Security 167 Auditing 168 Business Analytics 168 Viral Factor 169 Logging Checklist 169 Logging Requests 170 Logging Errors 174 Sample Log Output 176 Logging Service Alerts 179 Logging Goals 180 Profiling and Instrumentation 180 Logging Client-Side Events 181 Deciphering Data 182 Conclusion 183 Chapter聽8.聽Building RESTful APIs 185 Usable 186 Focus 186 Consistency 188 Self-Describing: Hypermedia 196 Affordances 196 HATEOAS 197 HTML as an API Media Type 199 Jade 199 Jiron 201 Responsive APIs 203 Optimizing for Speed 205 Conclusion 206 Chapter聽9.聽Feature Toggle 207 Organizing Features 207 Scale of a Feature 207 Feature Groups 208 Lifespan of a Feature 209 Development 209 Staging 209 Production Testing 209 Feature Rollout 209 Default Activation 210 Full Integration 210 Implementation 210 Conclusion 214 Chapter聽10.聽Internationalization 217 Conclusion 219 Appendix聽A.聽JavaScript Style Guide 221 Example Tests 221 QUnit Primer 222 Code Quality 223 Best Practices Quick Reference 224 Indentation: Be Consistent 224 Use Semicolons 225 Bracket Placement: Right Side 226 Avoid Name Collisions 226 Always Use var 227 Use One var Statement per Function 227 Avoid Constant Abuse 228 Use Functional Iterators When Possible 230 Be Careful with if Statements 232 Avoid Side Effects 235 Don鈥檛 Use switch 237 Don鈥檛 Use eval() 240 Index 243 About the Author 253 Take advantage of JavaScript’s power to build robust web-scale or enterprise applications that are easy to extend and maintain. By applying the design patterns outlined in this practical book, experienced JavaScript developers will learn how to write flexible and resilient code that’s easier—yes, easier—to work with as your code base grows.JavaScript may be the most essential web programming language, but in the real world, JavaScript applications often break when you make changes. With this book, author Eric Elliott shows you how to add client- and server-side features to a large JavaScript application without negatively affecting the rest of your code.Examine the anatomy of a large-scale JavaScript applicationBuild modern web apps with the capabilities of desktop applicationsLearn best practices for code organization, modularity, and reuseSeparate your application into different layers of responsibilityBuild efficient, self-describing hypermedia APIs with Node.jsTest, integrate, and deploy software updates in rapid cyclesControl resource access with user authentication and authorizationExpand your application’s reach through internationalization
دانلود کتاب Programming JavaScript Applications : Robust Web Architecture with Node, HTML5, and Modern JS Libraries