r/javahelp • • Jun 17 '24

Java

Hello everyone, I'm new to Java. I would like to improve my analysis and design skills. I've recently started creating my own projects. Recently, I wrote a Battleship game. https://github.com/LetMeDiie/Battleship. I would like to know from you how poorly structured my architecture is. I've added comments to all classes and included a README folder, although it was supposed to describe the application architecture, but I didn't quite finish it.

0 Upvotes

8 comments sorted by

View all comments

3

u/Poseidon_22 Jun 17 '24

From what I’ve read, I have not seen any bad practices or questionable choices. It was easy to read through the files & get an idea of how each part works. Project files are nicely structured and each class has its own separate purpose.

I think the place of the most complexity is Game class, which is to be expected. Here input is directly retrieved and parsed. Generally this is discouraged (see ‘Controller’ in GRASP principle). For a small project it’s not an issue of course. If you would expand your project, I’m very sure Game will become very complex to delegate input correctly.

But again, adding another layer for input would not be necessary here. For a beginner it looks very good, but I don’t think you are a beginner in OOP (:

2

u/Interesting-Hat-7570 Jun 18 '24

Oh my goodness, how nice to hear that.

This is my third project.

The first 2 turned out very bad.

But I posted every project and asked experienced people for advice. Most likely, yes, this is not only my merit.