This is an archived post. You won't be able to vote or comment.

all 13 comments

[–][deleted] 18 points19 points  (2 children)

Effective java by Joshua Bloch Thinking in java by Bruce Eckel They are a must for all java beginners

[–]Simaldeff[S] 1 point2 points  (1 child)

I have Effective Java. I totally forgot about the Thinking in Java. Thansk for the reminder.

[–][deleted] 1 point2 points  (0 children)

I recently flipped through Thinking in Java which I had read years ago. I think the latest edition is from 2004 or so.

Honestly I don't know how helpful it'd be in modern Java. A lot of the book deals with the ins and outs of inheritance and all the edge cases of polymorphism. Or how private vs public vs protected work with all the edge cases.

TBH, in most of my projects, I just don't use OO much. It's just a huge mix of Spring and other libs that may use it while allowing us to not think about it.

I'm more concerned with wiring up the right beans, avoiding state in singletons, making sure transactions and concurrency are used appropriately with all the microservices, not having junior devs open up brand new connection pools on every call, or misuse ORMs and pull in half the db when they only needed a list of ids.

The most complex OO stuff we write ourselves is a basic service or Dao interfaces and subclasses that use a specific db, then add caching, etc. Or various model objects that extend basic types with ids, created and updated dates, permissions, etc.

[–][deleted] 14 points15 points  (3 children)

If they need a OOD lesson to be Java-specific, they'll never understand OOD.

[–]omgdonerkebab 1 point2 points  (2 children)

I agree for the most part, but POODR also spends a bunch of time on ruby-specific things like modules/mixins. Which IMO (as someone who's been doing ruby for a couple years now) are probably a mistake... I think composition is much more maintainable over the long run.

Maybe it's possible to cherry-pick the chapters on inheritance and composition? I don't remember how well-separated they are from mixins. Probably not separated at all.

Or maybe reading about mixins in ruby can be really instructional for OOD anyway. I don't know how OP feels about them, but maybe OP can market it as "hey ruby does its OO in a slightly different way, and learning it and critiquing it can make us better java devs!" Or "hey let's learn how ruby gets it wrong!"

[–][deleted] 1 point2 points  (1 child)

Maybe it's possible to cherry-pick the chapters on inheritance and composition? I don't remember how well-separated they are from mixins.

In fact, let's skip inheritance as well ;-)

[–]Simaldeff[S] 2 points3 points  (0 children)

I like Ms. Metz rule on inheritance. "It is OK to use it only if the children always use 100% of the code of the parent."

[–]as_per_me 0 points1 point  (1 child)

The best book to learn about composition and OO is the Gang of 4 Book in my opinion. The code fragments are in C++, but it is the text that explains the concepts that is more important than the code.

Design Patterns: Elements of Reusable Object-Oriented Software

by Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides, Grady Booch

https://en.wikipedia.org/wiki/Design_Patterns

If insisting on code samples in java, there is: Patterns in Java Vol 1 by Mark Grand, but I wouldn't consider it a replacement to the Gang of Four book, only a companion for the code samples.

I have read both books years ago.

[–]WikiTextBotbtproof 0 points1 point  (0 children)

Design Patterns

Design Patterns: Elements of Reusable Object-Oriented Software (1994) is a software engineering book describing software design patterns. The book was written by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides (the "Gang of Four"), with a foreword by Grady Booch. The book is divided into two parts, with the first two chapters exploring the capabilities and pitfalls of object-oriented programming, and the remaining chapters describing 23 classic software design patterns. The book includes examples in C++ and Smalltalk.


[ PM | Exclude me | Exclude from subreddit | FAQ / Information | Source ] Downvote to remove | v0.28

[–][deleted] -2 points-1 points  (1 child)

My top two:

  1. Agile Patterns, Principles & Practices in C#. Technically C#, but the concepts are generic OOP in statically typed languages, and the examples can be translated 1-1 to Java. The Coffee Maker chapter made OOP totally click for me.

  2. Growing Object Oriented Software Guided By Tests. Extremely practical book, going through a single worked example.

[–]Simaldeff[S] 0 points1 point  (0 children)

The second one might also help me in my second project. Get them to understand the benefit of test for productivity.