Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract computations notification types #620

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

Mathieu-Deharbe
Copy link
Contributor

removes a Circular dependency from #614

Copy link

sonarqubecloud bot commented Oct 8, 2024

@Mathieu-Deharbe Mathieu-Deharbe changed the base branch from main to handle-params-notification October 8, 2024 10:18
@SlimaneAmar
Copy link
Contributor

SlimaneAmar commented Oct 8, 2024

I think it's an anti pattern to have a constants class
https://www.baeldung.com/java-constants-good-practices

@SlimaneAmar SlimaneAmar self-requested a review October 8, 2024 11:07
@Mathieu-Deharbe
Copy link
Contributor Author

I don't think so : the anti-pattern described in your article is "A Large Global Constants Class" which contains everything. Here I have a "type" (ComputationsNotificationTypes) for the constant class. The NotificationService with its dozens of constants was much closer to the anti pattern in my opinion.

Look a the good pattern he describes at the end : "4.2. Constants Class"

If you prefer I can put them into ComputationType. But given that this is an enum and not a class I would have to add a nested class like this :
https://stackoverflow.com/questions/23608885/how-to-define-static-constants-in-a-java-enum

Base automatically changed from handle-params-notification to main October 8, 2024 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants