I have a service that consists of multiple layers: persistence layer
, business layer
, and access layer
.
Central entity of my service is the User, which is represented by different classes through those layers:
UserDTO
: DTO's that are being sent from the service.UserBO
: Objects that the service works with internally.UserTable
: Objects that are stored to the Database.
Now I'm adding Spring Security
to this architecture, where the user object needs to implement Spring's UserDetails
to have the security features like login / access to secured endpoints etc.
The question is: which of one my objects through layers should be implementing the UserDetails
? Is it always the database object (in my case - UserTable
), or could it be UserBo
and UserDTO
too?
Aucun commentaire:
Enregistrer un commentaire