Skip to content

Instantly share code, notes, and snippets.

@plagelao
Created November 18, 2010 01:25
Show Gist options
  • Save plagelao/704484 to your computer and use it in GitHub Desktop.
Save plagelao/704484 to your computer and use it in GitHub Desktop.
Banco que no viola la inversión de dependencias
public class Banco {
private final OperacionesBancarias operacionesBancarias;
public Banco(OperacionesBancarias operacionesBancarias) {
this.operacionesBancarias = operacionesBancarias;
}
public Cuenta obtenerCuenta(String usuario, Pin pin) {
Token token = operacionesBancarias.autenticarUsuario(usuario, pin);
return Cuenta.crear(token);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment