https://kotlinlang.org logo
Title
b

Bruno_

04/05/2019, 11:37 AM
in spring, should there always be a layer between controllers and repositories? what do you think?
x

x80486

04/05/2019, 11:57 AM
It's a common practice to do that so you can isolate behaviors...but it's not strictly needed
👍 2
s

Sergey Bondari

04/05/2019, 5:42 PM
depends on complexity of that layer between
b

Bruno_

04/07/2019, 12:56 PM
@Sergey Bondari almost none, all it's doing is to call the repository
for now I've kind of merged the repository and controller into one class, exmaple class looks like this
@RestController
public interface FieldOfStudyRepository extends JpaRepository<FieldOfStudy, Long>
{
    @Override
    @GetMapping("/fields")
    List<FieldOfStudy> findAll();
}