r/SpringBoot • • Sep 29 '24

Package structure

Post image

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

43 comments sorted by

View all comments

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

1

u/HappyPurchase72 Sep 30 '24

Ok, I'll keep that in mind, thanks.