一刷 2000 本(2002/09)  

《Effective Java》
中文版 (繁體版)

侯捷 譯

effective-java-b5.jpg (71683 bytes)

封面封底全圖

本書範例 EffectiveJavaCode.zip
(2003/07/30 下載自 http://java.sun.com/docs/books/effective

英文版勘誤

中文版勘誤


□中譯書名(暫名):Effective Java 中文版
□適合對象:中高階 Java 程式員。
□製作特色:與原文本頁頁對譯,含 index,網片輸出,平裝
□內容特色:57 條 Java編程準則與注意事項
                        2001 Software Development Magazine Jolt Award

開放檔案如下:

檔名 內容 大小 bytes
effective-java-chap1234and10-20030820.pdf

不需密碼即可開啟。
檔案含簡略書籤(目錄連結)

扉頁、譯序、目錄、原序、前言、致謝、1,2,3,4,10章 1,413,469

不需密碼即可開啟。檔案不含書籤(目錄連結)

如欲下載,請將滑鼠移至上述 hyperlink,按右鍵,再選【另存目標...】即可。




侯捷譯序同 Practical Java 譯序


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.

Table Of Contents

CHAPTER = Foreword. Preface.
Acknowledgements.
1. Introduction.
2. Creating and Destroying Objects.
Consider Providing Static Factory Methods Instead of Constructors.
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.
Obey the General Contract when Overriding Equals.
Always Override HashCode When You Override Equals.
Always Override toString. Override Clone Judiciously.
Consider Implementing Comparable.

4. Classes and Interfaces.
Minimize the Accessibility of Classes and Members.
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 Structures with Classes.
Replace Unions with Class Hierarchies.
Replace Enums with Classes.
Replace Function Pointers with Classes and Interfaces.

6. Methods.
Check Parameters for Validity.
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.
Minimize the Scope of Local Variables.
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 Exceptions Only for Exceptional Conditions.
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.
Synchronize Access to Shared Mutable Data.
Avoid Excessive Synchronization.
Never Invoke Wait Outside a Loop.
Don't Depend on the Thread Scheduler.
Document Thread-Safety.
Avoid Thread Groups.

10. Serialization.
Implement Serializable Judiciously.
Consider Using a Custom Serialized Form.
Write ReadObject Methods Defensively.
Provide a ReadResolve Method when Necessary.

References.
Index