-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a1ecb16
commit cb0b6b0
Showing
3 changed files
with
131 additions
and
0 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
01-lecture/quemepongo/src/main/java/quemepongo/Modista.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package quemepongo; | ||
|
||
/** | ||
* Factory de Atuendos. | ||
* | ||
* @version 1.0 | ||
* @since 04.27.2021 | ||
*/ | ||
public abstract class Modista { | ||
|
||
/** | ||
* Fabrica un uniforme | ||
* | ||
* @return un nuevo uniforme | ||
* @since 1.0 | ||
*/ | ||
public Uniforme fabricarUniforme() { | ||
return new Uniforme(this.fabricarPrendaSuperior(), this.fabricarPrendaInferior(), this.fabricarCalzado()); | ||
} | ||
|
||
/** | ||
* Fabrica la parte superior | ||
* | ||
* @return una prenda de categoria Prenda Superior. | ||
* @since 1.0 | ||
*/ | ||
protected abstract Prenda fabricarPrendaSuperior(); | ||
|
||
/** | ||
* Fabrica la parte inferior | ||
* | ||
* @return una prenda de categoria Prenda Inferior. | ||
* @since 1.0 | ||
*/ | ||
protected abstract Prenda fabricarPrendaInferior(); | ||
|
||
/** | ||
* Fabrica un calsado. | ||
* | ||
* @return una prenda de categoria Calzado. | ||
* @since 1.0 | ||
*/ | ||
protected abstract Prenda fabricarCalzado(); | ||
} |
43 changes: 43 additions & 0 deletions
43
01-lecture/quemepongo/src/main/java/quemepongo/ModistaJhonson.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package quemepongo; | ||
|
||
/** | ||
* Factory de Uniformes del Instituto Jhonson. | ||
* | ||
* @version 1.0 | ||
* @since 04.28.2021 | ||
*/ | ||
public class ModistaJhonson extends Modista { | ||
|
||
@Override | ||
protected Prenda fabricarPrendaSuperior() { | ||
|
||
Borrador bosquejo = new Borrador(); | ||
bosquejo.especificarTipo(TipoPrenda.CAMISA); | ||
bosquejo.especificarMaterial(TipoMaterial.ALGODON); | ||
bosquejo.especificarColorPrimario(new Color("#blanco")); | ||
|
||
return bosquejo.guardarPrenda(); | ||
} | ||
|
||
@Override | ||
protected Prenda fabricarPrendaInferior() { | ||
|
||
Borrador bosquejo = new Borrador(); | ||
bosquejo.especificarTipo(TipoPrenda.PANTALON); | ||
bosquejo.especificarMaterial(TipoMaterial.ACETATO); | ||
bosquejo.especificarColorPrimario(new Color("#negro")); | ||
|
||
return bosquejo.guardarPrenda(); | ||
} | ||
|
||
@Override | ||
protected Prenda fabricarCalzado() { | ||
|
||
Borrador bosquejo = new Borrador(); | ||
bosquejo.especificarTipo(TipoPrenda.ZAPATOS); | ||
bosquejo.especificarMaterial(TipoMaterial.CUERO); | ||
bosquejo.especificarColorPrimario(new Color("#negro")); | ||
|
||
return bosquejo.guardarPrenda(); | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
01-lecture/quemepongo/src/main/java/quemepongo/ModistaSanJuan.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package quemepongo; | ||
|
||
/** | ||
* Factory de Uniformes del Colegio San Juan. | ||
* | ||
* @version 1.0 | ||
* @since 04.28.2021 | ||
*/ | ||
public class ModistaSanJuan extends Modista { | ||
|
||
@Override | ||
protected Prenda fabricarPrendaSuperior() { | ||
|
||
Borrador bosquejo = new Borrador(); | ||
bosquejo.especificarTipo(TipoPrenda.CHOMBA); | ||
bosquejo.especificarMaterial(TipoMaterial.ALGODON); | ||
bosquejo.especificarColorPrimario(new Color("#verde")); | ||
|
||
return bosquejo.guardarPrenda(); | ||
} | ||
|
||
@Override | ||
protected Prenda fabricarPrendaInferior() { | ||
|
||
Borrador bosquejo = new Borrador(); | ||
bosquejo.especificarTipo(TipoPrenda.PANTALON); | ||
bosquejo.especificarMaterial(TipoMaterial.ACETATO); | ||
bosquejo.especificarColorPrimario(new Color("#gris")); | ||
|
||
return bosquejo.guardarPrenda(); | ||
} | ||
|
||
@Override | ||
protected Prenda fabricarCalzado() { | ||
|
||
Borrador bosquejo = new Borrador(); | ||
bosquejo.especificarTipo(TipoPrenda.ZAPATILLAS); | ||
bosquejo.especificarMaterial(TipoMaterial.CUERO); | ||
bosquejo.especificarColorPrimario(new Color("#blanco")); | ||
|
||
return bosquejo.guardarPrenda(); | ||
} | ||
|
||
} |