Sunday, June 25, 2017

5 Books to Learn Object Oriented Programming and Design Patterns - Best of lot

Knowledge of Object oriented design principle and the various design pattern is a must for any Java developer. As I said earlier on 10 OOPS and SOLID design principles, coding without knowing these principles are like trying to learn a language without knowing alphabets. By the way, there are several books written on Object-oriented design principles, design patterns, and best practices, but only a few of them provides what they claim. There are two things here, design principles and design patterns, one is basic and other is best practice built on that basis. One should first learn Object-oriented principles and then learn design patterns to see how those principles are used to solve day to day problems. 

Keeping this in mind, I have collected following a list of 5 books to learn Object-oriented basics and design patterns in Java

These books are ordered from beginners to advanced perspective. J2EE or Java EE design patterns are little different than core Java design patterns but equally important for a Java developer, core J2EE patterns books is a good choice to learn that.

Top 5 books on Java Design Patterns

Here is my list of good books to learn object-oriented and Java design patterns. Design patterns are tried and tested as a way to solve a problem in a context. 

These patterns are discovered while solving similar problems multiple times over the year and they address some of the most common tasks in object-oriented application development e.g. creating an object, structuring code,  dynamic behavior based on context and object etc. 

Following five books are the great resource to learn Java design patterns, which is equally applicable to any other object-oriented programming language. If you know any other book on design patterns, which is worth reading, then please share with us.

This was the first book, I read on head first series and design pattern as well, prior to that, I have no idea when to use abstract class or interface or Why composition is better than Inheritance. I usually code each feature and requirement as they come and end of doing more changes, more testing and introducing more bugs in the first few years of software development. 

Thanks to my appetite for learning and reading, I discovered Head First design pattern and after reading its first chapter, I was thrilled. Now I can say that was basics but it's easier to get to know about advance stuff than basics, and there, this books scores. 

It's a must-read a book on Object-oriented design patterns for any Java developer, including experienced and senior developers. I would even suggest starting learning design pattern from this book. It not only explains concepts in a clear way, but also gives lots of diagrams, exercise, quizzes, and real-life examples to make you think and learn.

I am a big fan of head first books, be it Head First Java, Head First Object-Oriented Analysis or Design or this book. Head first design patterns is a great example of active learning and anyone who wants' to know about Object-oriented basics like Inheritance, Encapsulation, Polymorphism, and Abstraction must read this book. 

The three chapters on the Decorator design pattern and Observer design pattern is also a great piece of work. In short, this is the best book on Java design pattern till date.

Best book to learn Java design pattern

This book is THE classic Gang of Four (GOF) design pattern book, which became source and motivation for many object-oriented design pattern books written and published so far. Any list of must-read books on design patterns in Java is incomplete, without including this book. 

After almost 20 years, this book is still relevant in Object-oriented and Java design patterns.  This book has a case study chapter on designing Document Editor and then explains various design patterns e.g. Creational patterns, Structural, and Behavioral patterns. 

IMHO, this is one of the best books in design pattern and a must-read for any Java developer, along with Java Concurrency in Practice and Effective Java. You can buy this book from Amazon, it’s available as both hardcover, paperback edition and as multimedia CD.

Top Object Oriented Design Pattern book

Design Patterns Explained: A New Perspective on Object-Oriented Design 
Like multi-threading and concurrency, design patterns are also not easy to understand. What is the most difficult part is understanding enough to identify real-world scenarios, where you can apply these object-oriented design patterns. 

That's why sometimes it's better to use multiple books to learn design patterns in Java, it's worth doing it. The main reason for that is the different style of writing and explaining stuff. Some programmer finds a particular author more readable than others, I guess the only exception is Joshua Bloch which really connects to most of Java developer. 

Design Patterns Explained: A New Perspective on Object-Oriented Design is that alternate way of learning Object oriented design pattern. Though it also explains the same set of OOPS principles, UML and design patterns like decorator pattern, factory pattern or observer design pattern, the way it explains may be easier to understand for many beginners. Examples given this design pattern books are also good and nontrivial.

Good Java Design pattern books

Software Architecture Design Patterns in Java
This is another good book on Object-oriented and Java design patterns, it not only covers basic Object-oriented principles like Class, Object, Inheritance, Polymorphism, Abstraction, and Encapsulation but also covers details which are quite practical but not obvious e.g. private methods, getter and setters, Immutable objects, interface, and monitor. 

This book also provides extensive and comprehensive coverage of a whole lot of design patterns e.g. Creational patterns, Collection patterns, Structural patterns, Behavioral patterns, and Concurrency patterns. It's coverage on Factory design pattern and Singleton pattern is really interesting to read. 

Another thing, which I like in this book is practice questions and UML diagrams, which not only helps to understand the topic well but also ensures that you practice application part, which is most important to learn any design pattern. 

Finally, they have a case study of designing software solution for a web hosting company, which gives you a real chance of identifying and applying design patterns in a real-world scenario. 

In short, Software Architecture Design Patterns in Java has almost everything you need to know about Java design patterns.    

Good book to learn Design Patterns in Java

Core J2EE Patterns: Best Practices and Design Strategies
The J2EE platform is the most popular way of using Java programming language, and since it mainly focuses on web and enterprise solution, it has its own set of problems and requirements. Core J2EE patterns explain some of the most useful design patterns from J2EE world e.g. Intercepting Filters, Front Controller, Model View Controller or MVC pattern, Data AccessObject or DAO pattern, View Helper or View Resolver pattern, Service Locator patterns etc. 

This book divides the design pattern based upon their functional area e.g. Presentation tier design patterns, business tier design pattern etc. This is a must read the book for any Java J2EE developer, who is responsible for coding web application and enterprise application. 

Though modern day framework like Spring, ensures you follow these J2EE design pattern at the framework level e.g. MVC is enforced by Spring MVC, similarly, it also uses Front Controller in a form of DispatcherServlet and ViewResolver

Spring framework, also let you use Dependency Injection and IOC at the container level. Having said that, whether you use Spring MVC, Struts or any other web framework, knowledge of these J2EE patterns will help you to understand legacy code as well as to create a solution which is easier to maintain.
Good book to learn J2EE Design Patterns

This book is recommended by our readers. As he said "the book you need to read for Java EE patterns is "Real World Java EE Patterns" by Adam Bien. He'll explain to you why you shouldn't be writing your own DAO layer anymore.

That is a legacy pattern from J2EE that was only needed to cope with the poor J2EE architecture and should be avoided in Java EE". I have read a couple of chapters of this book and I must say he was right, this is the most up-to-date book on the topic of Java EE Patterns and one of the must-read the book for Java EE developers.

Best book for Java EE developers

Apart from these 5 books, you can also look on Effective Java 2nd Edition by Joshua Bloch and Head First object-oriented analysis and design for getting some good idea about object-oriented design principles and how it has used in Java. Effective Java is the must-read for any Java programmer, as it explained a lot of practical design advice used in Java library itself.

Further Learning
Design Pattern Library
From 0 to 1: Design Patterns - 24 That Matter - In Java
Java Design Patterns - The Complete Masterclass

If you find my recommendation worth reading and looking for some excellent book to master programming and Java-related technology, you will find the following list amazing as well:
  • 9 Books Every Java Developer Should Read (see here)
  • Top 5 Books to Learn Spring Framework and Spring MVC (checklist)
  • 6 Books to Master Programming and Coding skill (see here)
  • Best book to Learn JUnit testing and Test Driven Development (read here)
  • 2 Books to Prepare Oracle Java Certification (see here)
  • 5 Java Performance Books - Must read, Best of Lot (read here)
  • 3 Books to Learn Java 8, Must read (see here)
  • Top 5 Hibernate Books for Java Developers (read here)
  • Which Programming Book to Buy if Given 100$ to Spend? (My list)
  • 5 FREE Books to Learn Scala Programming (see here)
  • Top 5 jQuery Books for Beginner Web Developer (check here)
  • 4 Books to Prepare Google Job Interview (see here)
  • 10 FREE Java Programming Books for Beginners to Download as PDF, Read Online (read here)

Thanks for reading this article so far. If you like the object-oriented design pattern books useful then please share with your friends and colleagues. If you have any issues or feedback then please drop a note.


Luke said...

Hi Javin, Any book, which covers concurrency design pattern like Producer Consumer with single producer, multiple producer, Work Steal pattern etc?

Anonymous said...

No need of all these books also...
just go with Gang of Four (GOF) design pattern book,

Unknown said...

You reveal your ignorance when you include the outdated J2EE patterns book. J2EE was a bad architecture. Do you really want to defend the EJB 2 specification as architecturally sound?

The book you need to read for Java EE patterns is "Real World Java EE Patterns" by Adam Bien. He'll explain to you why you shouldn't be writing your own DAO layer any more. That is a legacy pattern from J2EE that was only needed to cope with the poor J2EE architecture and should be avoided in Java EE.

Post a Comment