r/learnjava • • May 07 '20

Good Object Oriented Code

Hi

Can anyone share a link of a github repo where I can read good object oriented code. Not looking for java library code (as they are huge and difficult to dissect) but rather a smaller project/app with some domain. I tried searching but didn't find anything good. Found some basic projects.

Or can anyone suggest me a book or course where you learn it by doing. Trying to get better at OOD and implementation. I have read a lot of theory but want to look at real world examples.

TIA

49 Upvotes

40 comments sorted by

45

u/gerardta May 07 '20

I can make a video series on this if you'd find that helpful.

14

u/AliveShine May 07 '20

Yes please. That would be incredibly helpful.

16

u/gerardta May 07 '20

I'll get to work on it!

3

u/Reborn-leech May 08 '20

Thank you so much !

3

u/_aimynona_ May 08 '20

I'd also be interested! Thank you 😊

5

u/calmonad May 08 '20

Do you have something in mind for this Gerard? Personally I think I would like to watch something that is less of a tutorial and more like a code review of open-source projects. Something with design discussion and identification of patterns being used.

1

u/gerardta May 08 '20

I was thinking more tutorial but I can also take a look at some open source code and go through it.

1

u/sternone_2 May 08 '20

Thanks, would love to see something more advanced

2

u/gerardta May 08 '20

Awesome, I'll start off with some fundamentals of OOD. Maybe design a mildly complex game or something. Then at the end I'll do some code reviews of some smaller scale libraries or something similar.

1

u/gerardta Jun 14 '20

I wanted to circle back on this! The first video on this is dropping tomorrow!

5

u/iamsooldithurts May 08 '20

Clean Code by Robert Martin.

1

u/AliveShine May 08 '20

Thanks. I'll check the book out. Are there real world examples in book? What I mean is an app being developed and not just specific code snippets.

3

u/calmonad May 08 '20

I think Uncle Bob often referenced a project he worked on called FitNesse. https://github.com/unclebob/fitnesse

1

u/AliveShine May 08 '20

Thanks. I'll check this out.

1

u/AliveShine May 08 '20

Thanks. I'll check this out.

1

u/actuallyrarer May 08 '20

If you understand the S.O.L.I.D principles, read clean Code and read Design Patterns, youll be a quality software engineer better than most haha.

I think the best code i have seen is frustratingly simple. Like "how did you write that so simply" kind of simple. Its really an art form and im jealous of anyone who can do it well.

Srsly check out design patterns though.

1

u/AliveShine May 08 '20

I agree. Understanding SOLID principles, Design Patterns and using them effectively is what best engineers out there do. And it is not very easy. And you're right that some people do write code which is very simple and effective. I am just trying to understand how/what are their mental models. It really is an art.

1

u/TheNarfanator May 08 '20

Those utils, man. They're a game changer for me.

1

u/swearobics May 08 '20

Hey, I was googling this recently and also came across the clean coder, another book by the same guy which came out later. Have you read that too? Is there an order you'd read them in?

1

u/iamsooldithurts May 08 '20

I haven’t read that one. I got the most recent edition of Clean Code I could find. My buddy has my copy but I think it was just a few years old or so.

5

u/rochakgupta May 08 '20

You can checkout the following open source projects which have very good OOP in Java - Elasticsearch, Google Guava, Spring Projects, Apache Projects - Like Kafka

2

u/AliveShine May 08 '20

Thanks man. But all these tools/libraries solve technical problems. What I was really looking for is more around business domain.

2

u/rochakgupta May 08 '20

Should that matter if the project is relatively well built and used?

2

u/AliveShine May 08 '20

The problem is all these projects are huge and I feel overwhelmed when I look at the code. I want to start small and then jump on these projects.

1

u/TheNarfanator May 08 '20

I think that's what OP's requesting for too, at some level.

Well maybe I'm projecting myself on him.

3

u/gerardta Jun 14 '20

Here's the first part! https://youtu.be/xaJxBsxqkyM

1

u/AliveShine Jun 15 '20

Great work, mate. Well done.

2

u/a7x21tayler May 08 '20

Hyperskill offers a bunch of projects for java and it teaches you the required skills for each stage of the project. It’s the best ā€œlearn by doingā€ site I’ve found. The projects are sorted by beginner, intermediate, and nightmare. If I was to go back to when I was learning java, I’d definitely choose this website.

1

u/AliveShine May 08 '20

Hyperskill looks good. Thanks

1

u/a7x21tayler May 09 '20

Glad I was able to help!

2

u/4K3b1g May 08 '20

Thanks for this!

1

u/ha_ku_na May 08 '20

Hey, one of the core differences I find between open source software and commercial software development is that you own and deal with data in the latter while the former ones are just tools whose state doesn't change with time(hence no dealing with database or users like in a business POV). So, a lot of what we might actually want to learn from OOP, like- applying design patterns to make software that can evolve as business evolves, or how design patterns fit in with frameworks like spring- can't be learnt by following open source software. Let me know if you agree/disagree and why!

3

u/AliveShine May 08 '20

I agree with you totally. Tools and libraries serve a very specific purpose. They might be object oriented in nature but what I was looking for is a business problem and how to make it good in OO way. Since commercial apps are generally closed source it is very difficult to find sources to refer. I looked around at a lot of places but couldn't find a good example.

1

u/Sai_Upadhyayula May 08 '20

As you said you are also interested in course, you can have a look at Pluralsight's courses "Making your code more Object Oriented" and "Master Object Oriented Programming" by Zoran Horvat. You need to have a subscription to access these courses.

The examples are concise and revolve around business use case like Bank Transactions. I liked the course and learnt a lot.

1

u/AliveShine May 08 '20

Thanks. I'll check that out.

1

u/[deleted] May 08 '20

read grady booch ooad

1

u/AliveShine May 08 '20

mate i really want to read some code around a problem.

2

u/sowmyasri129 May 08 '20

The Clean Code Robert C. Martin

1

u/stschoberg May 08 '20

Take a look at some popular open source projects. Look for Java or other enterprise OO languages.

3

u/emailscrewed May 08 '20

Any specific names would be helpful