JavaScript Object Programming
暫譯: JavaScript 物件導向程式設計

Martin Rinehart

  • 出版商: Apress
  • 出版日期: 2015-12-25
  • 售價: $1,370
  • 貴賓價: 9.5$1,302
  • 語言: 英文
  • 頁數: 132
  • 裝訂: Paperback
  • ISBN: 1484217861
  • ISBN-13: 9781484217863
  • 相關分類: JavaScript
  • 海外代購書籍(需單獨結帳)

商品描述

This brief  book explains the advantages of the object model, inheritance, both classical and prototypical, and shows how these concepts can be implemented in JavaScript. It also shows how object programming (OP) opens a new world of design possibilities that go far beyond inheritance.

This book will help the intermediate JavaScript programmer learn to use both types of inheritance. For classical inheritance, it is accompanied by a substantial online system (a windowing UI library) that shows classical inheritance at its best. The same system shows how OP "capabilities" can eliminate much of the need for inheritance. 

For experienced JavaScript programmers, this book shows why most of the old views of JavaScript's inheritance have not done it justice. JavaScript classes inherit from JavaScript's prototypes, a fact that makes JavaScript's prototypes, when used correctly, functional equivalents to C++ classes (not to prototypes in true prototypical languages, like Self). 

JavaScript's object programming (not inheritance) is what separates it from classical OOP languages like C++ and Java. Most important, basing inheritance on JavaScript's prototypal chain is possible, but is not the best choice for prototypal inheritance or classical inheritance.


What You'll Learn
  • What are objects, JavaScript objects and object programming
  • What is and how to use inheritance and JavaScript inheritance as well as inheritance alternatives
  • How to design for JavaScript
  • What are and how to use OO principles in JavaScript
  • How to use Constructors with JavaScript and more

Audience
This book is for both intermediate and advanced JavaScript and Web development programmers. However, any programmer will understand the concepts and any JavaScript programmer should understand all of the concepts in this book.   The code there is shows examples of the concepts discussed.

商品描述(中文翻譯)

這本簡短的書籍解釋了物件模型、繼承(包括經典繼承和原型繼承)的優勢,並展示了這些概念如何在 JavaScript 中實現。它還展示了物件程式設計(OP)如何開啟一個全新的設計可能性世界,這些可能性遠超過繼承。

這本書將幫助中級 JavaScript 程式設計師學會使用這兩種繼承類型。對於經典繼承,它配有一個實質性的線上系統(窗口 UI 函式庫),展示了經典繼承的最佳實踐。相同的系統展示了 OP 的「能力」如何消除對繼承的許多需求。

對於有經驗的 JavaScript 程式設計師,這本書展示了為什麼大多數舊有的 JavaScript 繼承觀點並未公正地評價它。JavaScript 類別繼承自 JavaScript 的原型,這一事實使得 JavaScript 的原型在正確使用時,成為 C++ 類別的功能等價物(而不是在真正的原型語言中,如 Self 的原型)。

JavaScript 的物件程式設計(而非繼承)使其與經典的 OOP 語言如 C++ 和 Java 区分開來。最重要的是,基於 JavaScript 的原型鏈進行繼承是可能的,但並不是原型繼承或經典繼承的最佳選擇。

你將學到的內容:
- 什麼是物件、JavaScript 物件和物件程式設計
- 什麼是繼承以及如何使用繼承和 JavaScript 繼承,還有繼承的替代方案
- 如何為 JavaScript 設計
- 什麼是物件導向原則以及如何在 JavaScript 中使用
- 如何在 JavaScript 中使用建構函式及更多

讀者對象:
這本書適合中級和高級的 JavaScript 及網頁開發程式設計師。然而,任何程式設計師都能理解這些概念,任何 JavaScript 程式設計師應該能理解本書中的所有概念。書中的程式碼展示了所討論概念的範例。