Created
November 19, 2010 16:32
-
-
Save plagelao/706728 to your computer and use it in GitHub Desktop.
Intentando que el Token sea más explícito
This file contains hidden or 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 Banco { | |
private final OperacionesBancarias operacionesBancarias; | |
private final InteresadoEnAccesoACuenta suscriptor; | |
public Banco(OperacionesBancarias operacionesBancarias, | |
InteresadoEnAccesoACuenta suscriptor) { | |
this.operacionesBancarias = operacionesBancarias; | |
this.suscriptor = suscriptor; | |
} | |
public void obtenerCuenta(Credenciales credenciales) { | |
Token token = operacionesBancarias.autenticarUsuario(usuario, pin); | |
if (token.valido()) { | |
suscriptor.cuentaObtenida(Cuenta.crear(token)); | |
} else if (token.credencialesInvalidas()) { | |
suscriptor.cuentaAnulada() | |
} else if (token.credencialesIncorrectas()) { | |
suscriptor.credencialesIncorrectas(); | |
} else { | |
suscriptor.bancoInaccesible(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment