Is there a POODR for Java?
[removed]
13 comments · 67% upvoted · other discussions
[removed]
13 comments · 67% upvoted · other discussions
If they need a OOD lesson to be Java-specific, they'll never understand OOD.
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!"
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.
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
My top two:
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.
Growing Object Oriented Software Guided By Tests. Extremely practical book, going through a single worked example.
Elegant Objects by Yegor Bugayenko.
Effective java by Joshua Bloch Thinking in java by Bruce Eckel They are a must for all java beginners
Simaldeff [OP] 2 points · Jun 2019
I have Effective Java. I totally forgot about the Thinking in Java. Thansk for the reminder.
[deleted] 2 points · Jun 2019
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.