java left logo
java middle logo
java right logo
 

Home arrow Book Reviews arrow Effective Java Programming Language Guide
 
 
Main Menu
Home
Java Tutorials
Book Reviews
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Java Network
Java Forums
Java Blog




Most Visited Tips
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Book Reviews
Top Rated Tips
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Book Reviews


Statistics
Registered Users: 4092
Java SE Tips: 614
Java ME Tips: 202
Java EE Tips: 183
Other API Tips: 779
Java Applications: 298
Java Libraries: 209
Java Games: 16
Book Reviews:
 
 
 
Effective Java Programming Language Guide E-mail
User Rating: / 50
PoorBest 
 Book Information

Image

Authors: Joshua Bloch
Paperback: 252 pages
Publisher: Addison-Wesley Professional; 1st edition (June 5, 2001)
Language: English
ISBN: 0201310058
Product Dimensions: 9.2 x 7.3 x 0.8 inches
ImageAmazon.com Link


 Book Review

Effective Java Language Programming Guide comes from Joshua Bloch, currently working as a Principal Engineer at Google. Having worked at Sun Microsystems as a Distinguished Engineer, his contribution to the Java Community has been remarkable. In this book, he gives the readers, fifty-seven working solutions to several techniques used by expert Java programmers.

Purpose

The author has written this book in order to help the Java programmers to write better code. The book is serious in its content with no-nuisance collection of tips and the author just presents the material in a straight-forward format like any other book in the “Effective Series”. The techniques presented in this book for intermediate or advanced Java developers, covers the finer details about libraries like java.lang, java.util and to some extent java.io libraries. The book is definitely a ‘must have’ in an expert programmers kit, but an intermediate programmer might find the content hard to digest, unless he thoroughly practices the techniques presented.

Organization

There are 10 chapters in the book, first of which is an introduction and it is the only chapter with ‘easy’ content. The 57 items span over the next 9 chapters, each of which covers the topics from general programming tips to serialization techniques. Just make a note that these chapters do not teach you basics like ‘how to create objects in Java’ or ‘how to use static methods in Java’. They guide you on the best practices for the respective concepts.

The second chapter is about creating and destroying objects, effectively. The third chapter covers the finer details regarding the methods that are common to all the Java objects (like toString()). The fourth chapter is about Classes and Interfaces. The fifth chapter contains techniques which can be used to implement the C-language features like structures, unions, etc. in Java. The sixth chapter presents several aspects about Methods and their design in Java. The seventh chapter, apart from discussing the nuts and bolts of the Java language also discusses about reflection, native methods, optimization and naming conventions. Use of data types and several libraries is also presented in this chapter.

The eighth chapter is on the usage of Exceptions in Java and presents 9 items on the effective use of Exceptions to improve the quality of the program. The ninth chapter is on threads, and is one of the best chapters in the book. Threads are very important concepts that are often neglected. This is not the case with this chapter and it helps the readers to write clear and correct multithreaded Java programs, but again it is no beginners guide to Threading. The last chapter, 10th one, has 4 items on Serialization techniques in Java using the object serialization API. The book ends with References to other good material which supplement the knowledge one gets from this book.

Difference

The tone of the author is serious in the sense that he stresses on the finer aspects of the Java programming Language without missing the basic details. As one can notice the book takes care of each and every important aspect of the Java Programming Language, but with a difference. It doesn’t talk just about usage, but it talks about “effective usage” and one can really notice considerable difference in the quality of the code they deliver, once they start using the techniques presented.

Finally

The book is really worth to be the best seller and this 180 page book gives you what many volumes of other books cannot: Effective techniques of Java Programming.


 Table of Contents

Foreword

Preface

Acknowledgments

Chapter 1: Introduction

Chapter 2: Creating and Destroying Objects

  • Item 1: Consider providing static factory methods instead of constructors
  • Item 2: Enforce the singleton property with a private constructor
  • Item 3: Enforce non-instantiability with a private constructor
  • Item 4: Avoid creating duplicate objects
  • Item 5: Eliminate obsolete object references
  • Item 6: Avoid finalizers

Chapter 3: Methods Common to All Objects

  • Item 7: Obey the general contract when overriding equals
  • Item 8: Always override hashCode when you override equals.
  • Item 9: Always override toString
  • Item 10: Override clone judiciously
  • Item 11: Consider implementing Comparable

Chapter 4: Classes and Interfaces

  • Item 12: Minimize the accessibility of classes and members
  • Item 13: Favor immutability
  • Item 14: Favor composition over inheritance
  • Item 15: Design and document for inheritance or else prohibit it.
  • Item 16: Prefer interfaces to abstract classes
  • Item 17: Use interfaces only to define types
  • Item 18: Favor static member classes over nonstatic

Chapter 5: Substitutes for C Constructs

  • Item 19: Replace structures with classes
  • Item 20: Replace unions with class hierarchies
  • Item 21: Replace enum constructs with classes
  • Item 22: Replace function pointers with classes and interfaces

Chapter 6: Methods

  • Item 23: Check parameters for validity
  • Item 24: Make defensive copies when needed
  • Item 25: Design method signatures carefully
  • Item 26: Use overloading judiciously
  • Item 27: Return zero-length arrays, not nulls
  • Item 28: Write doc comments for all exposed API elements

Chapter 7: General Programming

  • Item 29: Minimize the scope of local variables
  • Item 30: Know and use the libraries
  • Item 31: Avoid float and double if exact answers are required
  • Item 32: Avoid strings where other types are more appropriate
  • Item 33: Beware the performance of string concatenation
  • Item 34: Refer to objects by their interfaces
  • Item 35: Prefer interfaces to reflection
  • Item 36: Use native methods judiciously
  • Item 37: Optimize judiciously
  • Item 38: Adhere to generally accepted naming conventions

Chapter 8: Exceptions

  • Item 39: Use exceptions only for exceptional conditions
  • Item 40: Use checked exceptions for recoverable conditions and run-time exceptions for programming errors
  • Item 41: Avoid unnecessary use of checked exceptions
  • Item 42: Favor the use of standard exceptions
  • Item 43: Throw exceptions appropriate to the abstraction
  • Item 44: Document all exceptions thrown by each method
  • Item 45: Include failure-capture information in detail messages
  • Item 46: Strive for failure atomicity
  • Item 47: Don't ignore exceptions

Chapter 9: Threads

  • Item 48: Synchronize access to shared mutable data
  • Item 49: Avoid excessive synchronization
  • Item 50: Never invoke wait outside a loop
  • Item 51: Don't depend on the thread scheduler
  • Item 52: Document thread safety
  • Item 53: Avoid thread groups

Chapter 10: Serialization

  • Item 54: Implement Serializable judiciously
  • Item 55: Consider using a custom serialized form
  • Item 56: Write readObject methods defensively
  • Item 57: Provide a readResolve method when necessary

References

 Overview of Chapters

Foreword

Preface

Acknowledgments

Chapter 1: Introduction

Chapter 2: Creating and Destroying Objects

  • Item 1: Consider providing static factory methods instead of constructors
  • Item 2: Enforce the singleton property with a private constructor
  • Item 3: Enforce non-instantiability with a private constructor
  • Item 4: Avoid creating duplicate objects
  • Item 5: Eliminate obsolete object references
  • Item 6: Avoid finalizers

Chapter 3: Methods Common to All Objects

  • Item 7: Obey the general contract when overriding equals
  • Item 8: Always override hashCode when you override equals.
  • Item 9: Always override toString
  • Item 10: Override clone judiciously
  • Item 11: Consider implementing Comparable

Chapter 4: Classes and Interfaces

  • Item 12: Minimize the accessibility of classes and members
  • Item 13: Favor immutability
  • Item 14: Favor composition over inheritance
  • Item 15: Design and document for inheritance or else prohibit it.
  • Item 16: Prefer interfaces to abstract classes
  • Item 17: Use interfaces only to define types
  • Item 18: Favor static member classes over nonstatic

Chapter 5: Substitutes for C Constructs

  • Item 19: Replace structures with classes
  • Item 20: Replace unions with class hierarchies
  • Item 21: Replace enum constructs with classes
  • Item 22: Replace function pointers with classes and interfaces

Chapter 6: Methods

  • Item 23: Check parameters for validity
  • Item 24: Make defensive copies when needed
  • Item 25: Design method signatures carefully
  • Item 26: Use overloading judiciously
  • Item 27: Return zero-length arrays, not nulls
  • Item 28: Write doc comments for all exposed API elements

Chapter 7: General Programming

  • Item 29: Minimize the scope of local variables
  • Item 30: Know and use the libraries
  • Item 31: Avoid float and double if exact answers are required
  • Item 32: Avoid strings where other types are more appropriate
  • Item 33: Beware the performance of string concatenation
  • Item 34: Refer to objects by their interfaces
  • Item 35: Prefer interfaces to reflection
  • Item 36: Use native methods judiciously
  • Item 37: Optimize judiciously
  • Item 38: Adhere to generally accepted naming conventions

Chapter 8: Exceptions

  • Item 39: Use exceptions only for exceptional conditions
  • Item 40: Use checked exceptions for recoverable conditions and run-time exceptions for programming errors
  • Item 41: Avoid unnecessary use of checked exceptions
  • Item 42: Favor the use of standard exceptions
  • Item 43: Throw exceptions appropriate to the abstraction
  • Item 44: Document all exceptions thrown by each method
  • Item 45: Include failure-capture information in detail messages
  • Item 46: Strive for failure atomicity
  • Item 47: Don't ignore exceptions

Chapter 9: Threads

  • Item 48: Synchronize access to shared mutable data
  • Item 49: Avoid excessive synchronization
  • Item 50: Never invoke wait outside a loop
  • Item 51: Don't depend on the thread scheduler
  • Item 52: Document thread safety
  • Item 53: Avoid thread groups

Chapter 10: Serialization

  • Item 54: Implement Serializable judiciously
  • Item 55: Consider using a custom serialized form
  • Item 56: Write readObject methods defensively
  • Item 57: Provide a readResolve method when necessary

References

Reviewer: Krish Bhargav


 Related Tips

 
< Prev   Next >

Page 1 of 0 ( 0 comments )

You can share your information about this topic using the form below!

Please do not post your questions with this form! Thanks.


Name (required)


E-Mail (required)

Your email will not be displayed on the site - only to our administrator
Homepage(optional)



Comment Enable HTML code : Yes No



 
       
         
     
 
 
 
   
 
 
java bottom left
java bottom middle
java bottom right
RSS 0.91 FeedRSS 1.0 FeedRSS 2.0 FeedATOM FeedOPML Feed

Home - About Us - Privacy Policy
Copyright 2005 - 2008 www.java-tips.org
Java is a trademark of Sun Microsystems, Inc.