Reputation: 569
I start working with Spring and have some confusions about its conventions.
Services
and other Reposities?Service
And Repository
class is based on Entity
name i.e: User -> UserRepository
->UserService
?Upvotes: 6
Views: 3093
Reputation: 985
Check also answer:
It explains the Persistence Bussines and Presentation layers
https://stackoverflow.com/a/34084807/2218992
Upvotes: 1
Reputation: 989
No, don't use Repositories in the Controller. Only in the Services. And don't use Entities in your Controller. Create Dto (Data Transfer Objects) Object from the Entities and work with this in your frontend
Yes you can use other services and respositories in your service class
Yes it is. Name the interfache UserService and the implementation UserServiceImpl
Upvotes: 7