Last active
June 17, 2020 21:14
-
-
Save luissilvazup/8734c0f9ea445c97de0d3400042286d0 to your computer and use it in GitHub Desktop.
OCP 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 O_OpenClosedSolution { | |
private interface Authentication { | |
boolean login(User user); | |
} | |
private static class AuthenticationLinkedin implements Authentication { | |
@Override | |
public boolean login(User user) { | |
//autêntica o login com o Oauth Linkedin. | |
} | |
} | |
private static class AuthenticationFacebook implements Authentication { | |
@Override | |
public boolean login(User user) { | |
//autêntica o login com o Oauth Facebook. | |
} | |
} | |
private static class AuthenticationDatabase implements Authentication { | |
@Override | |
public boolean login(User user) { | |
ConnectionDAO connectionDAO = new ConnectionDAO("root", ""); | |
Connection connection = connectionDAO.createConnection(); | |
//autêntica o login com informações do banco de dados | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment