in spring, should there always be a layer between ...
# announcements
b
in spring, should there always be a layer between controllers and repositories? what do you think?
x
It's a common practice to do that so you can isolate behaviors...but it's not strictly needed
👍 2
s
depends on complexity of that layer between
b
@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
Copy code
@RestController
public interface FieldOfStudyRepository extends JpaRepository<FieldOfStudy, Long>
{
    @Override
    @GetMapping("/fields")
    List<FieldOfStudy> findAll();
}