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
Coche deportivo = Coche.DameDeportivo(); |
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
class Client | |
{ | |
private AbstractFactory _abstractFactory { get; set; } | |
public Client(AbstractFactory abstractFactory) | |
{ | |
_abstractFactory = abstractFactory; | |
} | |
} |
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
class CocheWrapper | |
{ | |
private Coche _coche; | |
public void GirarIzquierda() | |
{ | |
MyLog.write("Girar izquierda"); | |
_coche.GirarIzquierda(); | |
} | |
} |
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
objectA.getObjectB().getObjectC().doSomething(); |
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
class Persona | |
{ | |
public Persona SetNombre(string nombre) | |
{ | |
this.Nombre = nombre; | |
return this; // retorna el propio objeto | |
} | |
public Persona SetEdad(int edad) | |
{ |
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
persona | |
.SetNombre("Jon") | |
.SetEdad(24) | |
.SetApellido("Snow") | |
.CheckIn(); |
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
StringBuilder sb = new StringBuilder(); | |
sb.Append(GetSaludo()) | |
.AppendLine() | |
.Append("Esto es el mensaje") | |
.AppendLine() | |
.Append(GetDespedida()) | |
.Append(GetFirma()); |
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
FabricarCoche() | |
.Pintar("Rojo") | |
.ConMotor(2000) | |
.ConPuertas(5) | |
.GpsIntegrado(); |
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 static IWebHost BuildWebHost(string[] args) => | |
WebHost.CreateDefaultBuilder(args) | |
.UseStartup<Startup>() | |
.UseContentRoot("\\contentRoot") | |
.UseAzureAppServices() | |
.Build(); |
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
sb.Append(GetSaludo()) | |
.AppendLine() | |
sb.AppendLine() | |
.Append(GetSaludo()); |