Design Patterns in Spring Boot projects

Asked

Viewed 1,447 times

1

In the last 12 months I have worked and studied to learn how to create REST Apis with Spring boot, before that I worked with php MVC programming to create web systems and now in this my "migration" for Java using Spring I’m having doubts/difficulty understanding if Spring uses some kind of Pattern design and what would be ?

I usually create classes that follow the following order: Restcontroller -> Service -> Repository and Domain and DTO classes for entities and entity conversion/formatting

This structure I’m using can be considered a design standard ? What would be ?

I think because I’m self-taught I still have this simple doubt about the most desirable people!

  • 1

    I think he means the backend part. He looks like an anemic model.

  • Yeah, it’s the back part. Giving a researched found a design called Facade, which from what I understood serves to unite several objects in one, making a grouping and forming a new object. Is there any more that is widely used in back-end environment ?

1 answer

3


This structure I’m using can be considered a design standard ? What would be ?

Yes. This pattern you’re using is very close to what they call Transaction Script Pattern.

It’s a simple question, but the vast majority of professionals are not aware that this is an existing model and that it even has a name or often does not even know that there are other ways to organize the application.

I believe its popularity is due to the fact that it is simple to understand, apply and be a model that meets most applications well, such as explained by Fowler:

The glory of Transaction Script is its simplicity. Organizing Logic this way is natural for Applications with only a small amount of Logic, and it involves very little overhead either in performance or in understanding.

  • 1

    Thank you so much for the reply, I was well lost on this subject and now I have a north to study on this pattern!

  • @user2831852 good studies. Although I have received some negatives, I personally understand that your doubt is very valid.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.