Skip to content

Instantly share code, notes, and snippets.

@hahcho
Created April 14, 2016 08:52
Show Gist options
  • Save hahcho/cf900e4f8d7a6a276a539093d0adcc08 to your computer and use it in GitHub Desktop.
Save hahcho/cf900e4f8d7a6a276a539093d0adcc08 to your computer and use it in GitHub Desktop.
public class AuthenticationFactory {
public static Object result; # Change Object with appropriete type returned from AuthenticationManager
public static void init() {
# code for authentication and so on
self.result = AuthenticationManager.method()
}
public static Object getResult() {
return self.result;
}
}
# Example
# App starts -> AuthenticationFactory.init()
# Random place in App -> AuthenticationFactory.getResult().getUserName()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment