Effective Java : Serialization

Serialization Objective: This section explains the dangers of serialization and how to minimize them. Object serialization is Java’s useful framework for encoding objects as byte streams (serializing) and reconstructing objects from their encodings (deserializing). Once objects have been serialized, they can be sent from one virtual machine to another or stored on disk for later deserialization. Key topics:…

Effective Java : Concurrency

Concurrency Objective: Threads enable multiple tasks to proceed concurrently. Concurrent programming is more difficult than single-threaded one because more things can go wrong, and it is hard to reproduce failures. But concurrency is a must in modern programming to utilize multicore processors! This section provides advice to help you write clear, correct, well-documented concurrent programs. Key…

Lambdas and Streams : Effective java

Lambdas and Streams Objective: In Java 8, functional interfaces, lambdas, method references, along with streams API were added to help software engineers create function objects and process sequences of data elements more easily. This section explains best practices of how to utilize those facilities. Key topics: Lambdas and Anonymous Classes Lambdas and Method References Lambdas and Functional Interfaces Streams Streams…

Effective java : Exceptions

Exceptions Objective: This section provides guidelines for how to use exceptions effectively. When they are used properly, they can improve a program’s readability, reliability, and maintainability; but when they are used poorly, they can have the opposite effect. Key topics: Exceptions for Exceptional Conditions Only Checked Exceptions and Unchecked Exceptions Standard Exceptions Exception Translation Exception…

Effective java : Methods and Generics

Objective: This section discusses aspects of method designs: how to treat parameters and return values, how to design method signatures, and how to document methods. This section also tells you how to maximize the benefits and minimize the complications of generics. Key topics: Parameter Validity Defensive Copies Overloading Varargs Empty and Null Returns Optional Returns…

Effective java : Classes

Classes Objective: This section contains guidelines to help you make the best use of powerful elements of Java to design and implement usable, robust, and flexible classes and interfaces. Key topics: Accessibility of Classes and Members Accessor Methods and Public Fields Mutability Composition and Inheritance Inheritance Documentation Interfaces and Abstract Classes Interface Design and Posterity…

Effective Java : Creating and destroying objects

Creating and Destroying Objects Objective: This section concerns when and how to create objects, when and how to avoid creating them, how to destroy them in a timely manner, and how to manage any cleanup actions that must be done before their destruction. Key topics: Static Factory Methods and Constructors Builders and Constructors Singleton Noninstantiability…

Effective Java : General programming

General Programming Objective: This section is devoted to the nuts and bolts of Java. Key topics: Scope of Local Variables For-Each Loops and Traditional For Loops Use of Libraries Float, Double, and Exact Calculations Primitive Types and Boxed Primitives Use of Strings and Other Types String Builder and String Concatenation Interface and Class References Optimization…

Dependency injection

What is dependency injection? Instead of initiating the object we are dependent on, we take help of a dependency framework which will push the ready made object to the dependent class during runtime. In the above picture we are not initializing hotDrink with new hotDrink(), instead we are getting it as a constructor parameter. Why is…