r/SpringBoot • • Jun 29 '24

Well Structured Projects

Hello, I am looking for some well-structured Spring Boot projects to learn the best practices of the framework. I would really appreciate any recommendation.

25 Upvotes

25 comments sorted by

View all comments

Show parent comments

1

u/WaferIndependent7601 Jun 29 '24

No. Very bad style

1

u/Aggravating_Crazy_65 Jun 29 '24

why? you can have 2 package structure

  • entity package oriented

  • layer package oriented

If you choose the second, you have the following: controller/service/component/entity

if you take the entity oriented: user package and inside the layer classes.

Is just conventions, and inside a project, when you choose one or create your own with your team, everything it's fine.

the package is not the software (which is the real reason for what we are doing)

-1

u/WaferIndependent7601 Jun 29 '24

You can also put everything in one package. But this is also not the best possible solution.

I know that this was done 10 years ago. But we learned from that and should use packages use case wise. It’s so much easier to understand the project. If you stay in the same project all your life it’s ok. If you change projects you don’t want all controllers in one package.

You can also simply move the package to a new service.

1

u/Sheldor5 Jun 29 '24

sounds good, doesn't work in reality ...

1

u/WaferIndependent7601 Jun 29 '24

What exactly does now work? I did this multiple times.

1

u/Sheldor5 Jun 29 '24

so your projects and data structures aren't that big ...

-1

u/WaferIndependent7601 Jun 29 '24

Where did I say that?

Good projects don’t get too big. That’s what a good dev should always have in mind and split the project and teams

→ More replies (0)