Skip to content

Instantly share code, notes, and snippets.

@bitsydarel

bitsydarel/test.java

Created May 15, 2017
Embed
What would you like to do?
public interface IAuthProvider {
public login() {}
public logout() {}
public singup() {}
}
public interface IAuthManager {
IAuthProvider provider;
IAuthManager() {}
IAuthManager(IAuthProvider provider) {
this.provider = provider
}
setAuthProvider(IAuthProvider provider){}
public logIn() { provider.login() }
public logout() { provider.logout() }
public signUp() { provider.signup() }
...
}
public class Presenter {
Presenter(IAuthManager manager) {
this.manager = manager;
}
onAuthSelected(IAuthProvider provider, TYPE.LOGIN typeOfConnection) {
manager.setAuthManager(provider);
if(typeOfConnection == LOGIN) { manager.login() }
....
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.