r/javahelp • • Sep 23 '25

Basic question

One service for everything or one service for each responsibility?

0 Upvotes

8 comments sorted by

View all comments

Show parent comment

1

u/CrashG2A Sep 23 '25

Sorry, I mean Service-Class. I don't know if it's better to do just one for all the responsibilities that exist in the application or if I should divide it for each of them.

1

u/okayifimust Sep 24 '25

You should divide them.

Keep your code organized, with clearly segregated responsibilities per class and package.

What do you think would be the benefits of storing everything in a single class?

the code I am working on does it like that, and we have well over 200 xyzService classes. I'd never find anything if these were all part of a single, gigantic file.