Last active
January 8, 2020 13:57
-
-
Save trimoq/94bdce91076ebbc73b2577411219ceed to your computer and use it in GitHub Desktop.
UserService taking care of its dependencies
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UserService{ | |
private UserRepository userRepository; | |
public UserService(){ | |
this.userRepository = PostgresUserRepository.getInstance(); | |
} | |
public void addUser(String name){ | |
// do some business logic here | |
userRepository.addUser(name); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment