0

As a newcomer to Spring Boot, I have encountered the Spring Data REST framework, which offers convenient endpoints for CRUD operations. In my specific scenario, I need to execute custom business logic before saving a user. To achieve this, I have implemented a "registerUser" method in the UserService class. However, I'm unsure about the best approach for saving the user or performing other CRUD operations. Should I utilize the provided Spring Data REST endpoints through a POST request or should I utilize the "save" method of the JpaRepo interface? I am confused which approach i should take

  • 1
    why don't you try both and see for yourself? If you were to learn how to play chess would you also be asking online for THE opening sequence so you don't have to study any other one? I am not trying to be rude I am just trying to illustrate that such questions are not necessarily the best way of going about things – J Asgarov Jun 27 '23 at 20:32
  • i would still ask for the best opening that will make my future decisions easier to make – Okba Samir Jun 27 '23 at 20:41
  • we dont know what your future decisions are so how can we tell? this feels more like an opinionated question. We dont know what is best as best is a matter of subject. Try both, see what fits your need the best. good luck – Toerktumlare Jun 27 '23 at 22:43

0 Answers0