OCP Solution Part 1
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