Last active
June 17, 2020 21:35
-
-
Save luissilvazup/c604d01e75fe6fd5bb503fc9bc1f03a3 to your computer and use it in GitHub Desktop.
DIP Solution Part 1
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 D_DependencyInversionSolution { | |
@AllArgsConstructor | |
private static class AuthenticateLogin { | |
private final Authentication authentication; | |
public boolean login(User user){ | |
return authentication.login(user); | |
} | |
} | |
private interface Authentication { | |
boolean login(User user); | |
} | |
private static class AuthenticationLinkedin implements Authentication { | |
public boolean login(User user) { | |
//autêntica o login com o Oauth Linkedin. | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment