Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COI understand the desire to move @Transactional out of the `Controller` and onto a service layer. However, I believe in lean programming where you don't do extra work that you'll never need. In this case, implementing a REST service API, there's basically nothing for the Controller to do but implement the service and no one will ever call the service any other way. If some day they do, it will be easy to refactor then, but up front I've saved creating a whole layer. And by using AspectJ for @Transactional I don't have to worry about proxies.
      singulars
    2. COlean programming is fine but can take different representation based on the context. In the case of Rest Services, you have to take into consideration that 1. they evolve often (new requirements/demands) 2. you want to have the controllers easily readable for developers and not have them "cluttered" with business rules. it does require slightly more work at the start (creation of the service) but it gives you a real freedom in the long run.
      singulars
    3. COFarid, my vision of "lean" is to avoid "more work at the start" where it does not make future growth more difficult. The Controller logic is basically: read the request, perform the requested action, write the response, with the "requested action" inside a try/catch block. Later, if a separate Service object is desired, you can just cut the inside of the try/catch block from the controller and paste it into a service method. Really no limitation on long-run freedom, but definitely faster to get to a working product.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload