r/SpringBoot • u/HappyPurchase72 • Sep 29 '24
Package structure
What do you think about this package structure? What packages or layers would you add or remove if you work with microservices architecture?
43
Upvotes
r/SpringBoot • u/HappyPurchase72 • Sep 29 '24
What do you think about this package structure? What packages or layers would you add or remove if you work with microservices architecture?
8
u/scoutzzgod Sep 30 '24 edited Sep 30 '24
One rule of thumb for me is to create a separate directory if there are more than one file related to the same “topic”. Like you have a SecurityConfig and and AppConfig. In my view, there’s no need to keep it in separate directories, just keep it in the same until you had 2 or 3 files related to security configuration, because currently, the name of the file itself already does this separation u aiming for
Edit 1: Read about the YAGNI principle