Created
November 17, 2010 19:04
-
-
Save plagelao/703843 to your computer and use it in GitHub Desktop.
Banco que viola la D de S.O.L.I.D.
This file contains 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 Conector conector; | |
private final GeneradorToken generadorToken; | |
public Banco(Conector conector, GeneradorToken generadorToken) { | |
this.conector = conector; | |
this.generadorToken = generadorToken; | |
} | |
public Cuenta obtenerCuenta(String usuario, Pin pin) { | |
String json = conector.obtenerJsonDeRespuesta("debit_card/challenge?" + | |
"card=" + | |
usuario + | |
"&pin=" + | |
pin.digitos()); | |
return Cuenta.crear(crearToken(json), conectorHttp); | |
} | |
private String crearToken(String json) { | |
return generadorToken.crear(json); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment