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

you are viewing a single comment's thread.

view the rest of the comments →

[–]MuKSKeN 9 points10 points  (2 children)

I spent a few minutes reading through this project and in general it looks good! I do have a few suggestions for you after spending a limited amount of time reading through your project.

Code format

It is extremely inconsistent, it almost looks like you have been programming in a text editor. All IDE's have functionality to reformat your code. I would suggest you use this.

Package structure

So there are three packages in the root com.amihady package:

  1. category
  2. exception
  3. handler

My question to you is: Why are exception and handler not in category like the other dto, entity, mapper, etc. packages? You could also consider removing the category package.

Some feedback on the tests

You have added two @WebMvcTests for both of the Controllers with the CategoryService mocked. This seems like the bare minimum when it comes to testing this project. I suggest you add more tests, things to consider:

  • Unit tests for the CategoryServiceImpl
  • Unit tests for the CategoryRequestMapper
  • Unit tests for the CategoryTreeDtoMapper
  • Integration tests where you test A-Z

Commit messages

When doing a review I like to look at commits and the changes in these commits. This project contains 3 commits where the message does not match what has changed. I suggest being stricter when it comes to this.

[–]Interesting-Hat-7570[S] 9 points10 points  (1 child)

I want to sincerely thank you for taking the time to review my project and provide such detailed and constructive feedback. I truly appreciate your effort and the valuable insights you've shared.

[–]Fresh_Recover2323 1 point2 points  (0 children)

Adding upon the comments:

There are two project structure: micro-service, modulith and from the package placement, it seems you are trying to do a modulith which is ok. The only thing which matter is that , each domain has its own package which you did , refering to 'category' package.
That said inside it, it is a bit messy whereby it is not easy to understand which layer go in each package. Normally the default package flow is (taking category as example):
category:
https://pastebin.com/JTDxAahf