Skip to product information
Effective Java 3/E
Effective Java 3/E
Description
Book Introduction
The Complete Guide to Java Platform Best Practices - Java 7, 8, and 9

Java has undergone significant changes since Effective Java 2nd Edition was published shortly after the release of Java 6.
So, this award-winning book has been thoroughly rewritten to take full advantage of the latest features of the Java language and libraries.
As modern Java began to support multiple paradigms, Java developers increasingly needed concrete best practices, and this book provides relevant advice.
This third edition incorporates features added to the Java language and libraries in Java 7, 8, and 9.
In particular, we will take a closer look at functional programming elements newly introduced to Java, which has been focusing on object-oriented programming.
There are also many new items, including chapters dedicated to lambdas and streams.

index
Chapter 1 Introduction

Chapter 2 Object Creation and Destruction
Item 1.
Consider static factory methods instead of constructors.
Item 2.
If your constructor has many parameters, consider a builder.
Item 3.
Ensure singleton status with a private constructor or enumeration type.
Item 4.
If you want to prevent instantiation, use a private constructor.
Item 5.
Use dependency injection instead of explicitly specifying resources.
Item 6.
Avoid creating unnecessary objects
Item 7.
Release references to objects that are no longer in use
Item 8.
Avoid using finalizers and cleaners
Item 9.
Use try-with-resources instead of try-finally

Chapter 3 Common Methods for All Objects
Item 10.
Redefine equals to follow the general convention
Item 11.
If you want to override equals, override hashCode too.
Item 12.
Always override toString
Item 13.
Be careful when redefining clone.
Item 14.
Consider implementing Comparable

Chapter 4 Classes and Interfaces
Item 15.
Minimize access permissions for classes and members.
Item 16.
In public classes, use accessor methods, not public fields.
Item 17.
Minimize the possibility of change
Item 18.
Use composition over inheritance
Item 19.
Design and document with inheritance in mind.
If not, prohibit inheritance.
Item 20.
Prefer interfaces over abstract classes
Item 21.
Design interfaces with the implementer in mind.
Item 22.
Use interfaces only to define types.
Item 23.
Use class hierarchies rather than tagged classes.
Item 24.
Make member classes static whenever possible.
Item 25.
Keep only one top-level class per file.

Chapter 5 Generics
Item 26.
Do not use low type
Item 27.
Remove unchecked warnings
Item 28.
Use lists rather than arrays
Item 29.
If possible, make it a generic type.
Item 30.
If possible, make it a generic method.
Item 31.
Increase API flexibility with bounded wildcards.
Item 32.
Be careful when using generics and variable arguments together.
Item 33.
Consider type-safe heterogeneous containers.

Chapter 6 Enumeration Types and Annotations
Item 34.
Use enumerated types instead of int constants.
Item 35.
Use instance fields instead of ordinal methods.
Item 36.
Use EnumSet instead of bit fields
Item 37.
Use EnumMap instead of ordinal indexing.
Item 38.
If you need an extensible enumeration type, use an interface.
Item 39.
Use annotations over naming patterns.
Item 40.
Use the @Override annotation consistently.
Item 41.
If what you want to define is a type, use a marker interface.

Chapter 7 Lambda and Streams
Item 42.
Use lambdas rather than anonymous classes.
Item 43.
Use method references rather than lambdas
Item 44.
Use standard functional interfaces
Item 45.
Use streams with caution
Item 46.
Use side-effect-free functions in streams.
Item 47.
Collections are better than streams as return types.
Item 48.
Apply stream parallelism with caution.

Chapter 8 Methods
Item 49.
Check if the parameters are valid
Item 50.
Make defensive copies in a timely manner
Item 51.
Design your method signatures carefully.
Item 52.
Use multiple definitions with caution.
Item 53.
Use variable arguments carefully
Item 54.
Return an empty collection or array, not null.
Item 55.
Be careful with optional returns.
Item 56.
Always write documentation comments for public API elements.

Chapter 9 General Programming Principles
Item 57.
Minimize the scope of local variables
Item 58.
Use for-each loops rather than traditional for loops.
Item 59.
Learn and use the library
Item 60.
Avoid floats and doubles if you need exact answers.
Item 61.
Use primitive types rather than boxed primitive types.
Item 62.
Avoid using strings when another type is appropriate.
Item 63.
Be careful, string concatenation is slow.
Item 64.
Reference objects using interfaces
Item 65.
Use interfaces rather than reflection
Item 66.
Use native methods with caution
Item 67.
Optimize carefully
Item 68.
Follow generally accepted naming conventions

Chapter 10 Exceptions
Item 69.
Use exceptions only for truly exceptional situations.
Item 70.
Use checked exceptions for recoverable situations and runtime exceptions for programming errors.
Item 71.
Avoid using unnecessary check exceptions.
Item 72.
Use standard exceptions
Item 73.
Throw exceptions appropriate to the level of abstraction
Item 74.
Document all exceptions thrown by your methods.
Item 75.
Include failure-related information in the exception's detail message.
Item 76.
Make failures as atomic as possible
Item 77.
Don't ignore exceptions

Chapter 11 Concurrency
Item 78.
Synchronize and use shared variable data.
Item 79.
Avoid excessive synchronization
Item 80.
Prefer executors, tasks, and streams over threads.
Item 81.
Prefer concurrency utilities over wait and notify.
Item 82.
Document the thread safety level.
Item 83.
Use lazy initialization with caution.
Item 84.
Don't rely on the thread scheduler to determine your program's behavior.

Chapter 12 Serialization
Item 85.
Find an alternative to Java serialization.
Item 86.
Decide carefully whether to implement Serializable.
Item 87.
Consider custom serialization formats
Item 88.
Write the readObject method defensively.
Item 89.
If you need to control the number of instances, use enumerated types rather than readResolve.
Item 90.
Consider using serialized proxies instead of serialized instances.

Publisher's Review
Effective Java 3/E incorporates features added to the Java language and libraries in Java 7, 8, and 9.
In particular, we will take a closer look at functional programming elements newly introduced to Java, which has been focusing on object-oriented programming.
There are also many new items, including chapters dedicated to lambdas and streams.
This is a revised edition with a thorough reorganization of the entire content to take full advantage of the latest features of the Java language and libraries.


New topics covered
Functional interfaces, lambda expressions, method references, streams
ㆍDefault methods and static methods of interfaces
ㆍType inference including diamond operator in generic types
ㆍ@SafeVarargs annotation
ㆍtry-with-resources statement
ㆍNew library features such as the Optional〈T〉 interface, java.time, and convenience factory methods for collections.
GOODS SPECIFICS
- Date of issue: November 1, 2018
- Page count, weight, size: 520 pages | 989g | 172*225*35mm
- ISBN13: 9788966262281
- ISBN10: 8966262287

You may also like

카테고리