#Socket CLI Chat application (requesting code review)

11 messages · Page 1 of 1 (latest)

balmy idol
#

Hey everyone, I am working on a Chat Application built with sockets. I would love some constructive criticism on any code smells, or improvements I could make or just things that are straight up wrong.

Here is the GitHub repository:
https://github.com/Spring-0/JavaChatNet

Thanks! hidethepain

GitHub

JavaChatNet is a command-line interface (CLI) multi-client chat application built in Java using sockets for real-time communication. - GitHub - Spring-0/JavaChatNet: JavaChatNet is a command-line i...

tardy python
#

Not bad! Overall it looked pretty good for a nice simple project, so I'll just leave 2 comments on what threw me off while reading it.

You have Client which implements Runnable and then a Client.InputHandler which also implements Runnable. I'd personally separate them, but that's a personal taste thing.

The only smell that threw me off is your constants package holds... no.... constants..... In fact the only enum I saw was in an entirely different package chain. Might be good to rename it, and/or move things around.

balmy idol
#

Thanks for the feedback, I have restructured the classes into the appropriate packages.

tardy python
#

Looks fantastic, nice restructure.

split scaffold
#

id personally try to keep that User as immutable as possible

#

that basically counts for everything

#

and in your database stuff, you could use a try with resources cuz you're not closing your prepared statements

pine orchid
#

Does it save the messages?

balmy idol
#

No it does not, but that would be a great addition.

#

Since this is a small scale educational project, should I bother with implementing a NoSQL database for storing the chat messages? Would love to hear someone's feedback or thoughts.

nimble patrol
#

I personally would since it strengthens that knowledge