mercredi 27 septembre 2017

Why do we need service layer?

I'm currently learning Spring Boot and I've seen how people create a controller, inject the service class and in the service class inject the repository.

Why do we need the service class as a middleman and why can't we just inject the repository into controller?

Here's the tutorial that confused me: https://www.youtube.com/watch?v=lpcOSXWPXTk&list=PLqq-6Pq4lTTbx8p2oCgcAQGQyqN8XeA1x

Aucun commentaire:

Enregistrer un commentaire