Skip to content

Conversation

dev-clement
Copy link
Owner

As the service grows, so many responsibilities go inside it, that makes it inmaintainable on the long run. That's why I decided to make the service an object that will just forward the call of the controller to the specific service.

And thanks to the spring-boot Controller annotation and the construction injection, it makes the code a better candidate for unit test.

As the UserService is doing too much things due to spring-boot
architecture, I decided to split the repsonsibilities for the
UserService being only used for pass informations to several component
being passed to the service's controller. This way we make the
UserService responsible for only passing the informations to several
layer

+ CREATE EmailSpecification used to verify if the email isn't unique
  along the datastore
+ CREATED EmailValidator used to verify that the email passed as
  parameter is valid
+ UPDATE the UserService to take the both validator into account
+ UPDATE the repository to add method for checking email uniqueness
+ ADD method to change the password onto the UserService
+ CREATE component used for verifying the password
+ CHANGE the UserService by creating a changePassword method that is
  then used by the controller
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant