Effective Java Programming Language Guide
暫譯: 有效的 Java 程式語言指南
Joshua Bloch
- 出版商: Addison Wesley
- 出版日期: 2001-06-15
- 售價: $2,220
- 貴賓價: 9.5 折 $2,109
- 語言: 英文
- 頁數: 272
- 裝訂: Paperback
- ISBN: 0201310058
- ISBN-13: 9780201310054
-
相關分類:
Java 程式語言
已過版
買這商品的人也買了...
-
$2,176Refactoring: Improving the Design of Existing Code (Hardcover)
-
$2,660$2,527 -
$650$514 -
$980$774 -
$970Introduction to Algorithms, 2/e
-
$1,150$1,127 -
$950$855 -
$1,740$1,653 -
$880$695 -
$1,274Computer Architecture: A Quantitative Approach, 3/e(精裝本)
-
$760$600 -
$590$466 -
$690$538 -
$720$569 -
$820$804 -
$750$638 -
$560$476 -
$450$356 -
$480$379 -
$750$593 -
$780$616 -
$490$382 -
$650$507 -
$650$507 -
$720$569
商品描述
Description
Effective Java is an explicit (and acknowledged) homage to Scott Meyer's Effective C++. Josh Bloch shares the programming practices of the most expert Java programmers with the rest of the programming community. Distilling the habits of experienced programmers into 50 short stand-alone essays, Bloch has laid out the most essential and effective Java rules, providing comprehensive descriptions of techniques. The essays address practical problems that all Java programmers encounter, presents specific ways to improve programs and designs, and also shows how to avoid traps in Java programming. An enormously useful book, each essay contains top notch code examples and insightful "war stories" that help capture the students' attention.
CS0628:
Java--Intermediate Programming
Table Of Contents
CHAPTER = Foreword. Preface.Acknowledgements.
1. Introduction.
2. Creating and Destroying Objects.
Enforce the Singleton Property with a Private Constructor.
Enforce Noninstantiability with a Private Constructor.
Avoid Creating Duplicate Objects.
Eliminate Obsolete Object References.
Avoid Finalizers.
3. Methods Common to All Objects.
Always Override HashCode When You Override Equals.
Always Override toString. Override Clone Judiciously.
Consider Implementing Comparable.
4. Classes and Interfaces.
Favor Immutability. Favor Composition Over Inheritance.
Design and Document for Inheritance or Else Prohibit It.
Prefer Interfaces to Abstract Classes. Use Interfaces Only to Define Types.
Favor Static Member Classes Over Non-Static.
5. Substitutes for C Constructs.
Replace Unions with Class Hierarchies.
Replace Enums with Classes.
Replace Function Pointers with Classes and Interfaces.
6. Methods.
Make Defensive Copies when Needed.
Design Method Signatures Carefully.
Use Overloading Judiciously.
Return Zero-Length Arrays, Not Nulls.
Write Doc Comments for All Exposed API Elements.
7. General Programming.
Know and Use the Libraries.
Avoid Float and Double if Exact Answers are Required.
Avoid Strings where Other Types are More Appropriate.
Beware the Performance of String Concatenation.
Refer to Objects by their Interfaces.
Prefer Interfaces to Reflection.
Use Native Methods Judiciously.
Optimize Judiciously.
Adhere to Generally Accepted Naming Conventions.
8. Exceptions.
Use Checked Exceptions for Recoverable Conditions.
Runtime Exceptions for Programming Errors.
Avoid Unnecessary Use of Checked Exceptions.
Favor the Use of Standard Exceptions.
Throw Exceptions Appropriate to the Abstraction.
Document All Exceptions Thrown by Each Method.
Include Failure-Capture Information in Detail Messages.
Strive for Failure Atomicity.
Don't Ignore Exceptions.
9. Threads.
Avoid Excessive Synchronization.
Never Invoke Wait Outside a Loop.
Don't Depend on the Thread Scheduler.
Document Thread-Safety.
Avoid Thread Groups.
10. Serialization.
Consider Using a Custom Serialized Form.
Write ReadObject Methods Defensively.
Provide a ReadResolve Method when Necessary.
References.
Index. 0201310058T04232001

商品描述(中文翻譯)
《Effective Java》是對Scott Meyer的《Effective C++》的明確(且公認的)致敬。Josh Bloch與其他程式設計社群分享了最專業的Java程式設計師的編程實踐。Bloch將經驗豐富的程式設計師的習慣提煉成50篇短小獨立的文章,列出了最基本且有效的Java規則,並提供了技術的全面描述。這些文章針對所有Java程式設計師所遇到的實際問題,提出了改善程式和設計的具體方法,並展示了如何避免Java編程中的陷阱。這本書極具實用性,每篇文章都包含高品質的程式碼範例和富有洞察力的「戰爭故事」,幫助吸引學生的注意。
CS0628:
Java--中級程式設計
適合的課程
目錄
前言。
致謝。
1. 介紹。
2. 創建和銷毀物件。
考慮提供靜態工廠方法而非建構子。
使用私有建構子強制執行單例屬性。
使用私有建構子強制執行不可實例化。
避免創建重複物件。
消除過時的物件參考。
避免使用終結器。
3. 所有物件的共通方法。
在覆寫equals時遵守一般合約。
當覆寫equals時,始終覆寫hashCode。
始終覆寫toString。謹慎覆寫clone。
考慮實作Comparable。
4. 類別和介面。
最小化類別和成員的可存取性。
偏好不可變性。偏好組合而非繼承。
設計和記錄以便繼承,否則禁止繼承。
偏好介面而非抽象類別。僅使用介面來定義類型。
偏好靜態成員類別而非非靜態。
5. C語言結構的替代品。
用類別替代結構。
用類別層級替代聯合。
用類別替代列舉。
用類別和介面替代函數指標。
6. 方法。
檢查參數的有效性。
在需要時進行防禦性複製。
小心設計方法簽名。
謹慎使用重載。
返回零長度的陣列,而不是null。
為所有公開的API元素撰寫文檔註解。
7. 一般編程。
最小化局部變數的範圍。
知道並使用庫。
如果需要精確答案,避免使用float和double。
在其他類型更合適的情況下避免使用字串。
注意字串串接的性能。
通過其介面引用物件。
偏好介面而非反射。
謹慎使用本地方法。
謹慎優化。
遵循普遍接受的命名慣例。
8. 異常。
僅對例外情況使用異常。
對可恢復的情況使用檢查異常。
對程式錯誤使用運行時異常。
避免不必要地使用檢查異常。
偏好使用標準異常。
拋出與抽象相符的異常。
記錄每個方法拋出的所有異常。
在詳細訊息中包含失敗捕獲資訊。
努力實現失敗原子性。
不要忽略異常。
9. 執行緒。
同步訪問共享可變數據。
避免過度同步。
永遠不要在循環外調用wait。
不要依賴執行緒調度器。
記錄執行緒安全性。
避免執行緒組。
10. 序列化。
謹慎實作Serializable。
考慮使用自定義序列化形式。
防禦性地撰寫readObject方法。
在必要時提供readResolve方法。
參考文獻。
索引。 0201310058T04232001