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

4

u/Aggravating_Crazy_65 Jun 29 '24

I think he is the best https://github.com/springframeworkguru he teach on udemy and have different courses about spring boot.

And, most important thing, never forget to read the docs :) https://spring.io/guides
You can find a lot of examples and start learn very in deep about REST api, DB interactions, Batch processing, Async with Reactor and TESTING!

1

u/WaferIndependent7601 Jun 29 '24

Controllers in controller package. Not so good

-3

u/Aggravating_Crazy_65 Jun 29 '24

what? usually controllers class are inside a controller package

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)