Created
October 15, 2015 17:57
-
-
Save jrichardsz/860ef4a711094b365aff to your computer and use it in GitHub Desktop.
System that supports dynamic behavior.
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
Desarrollar la clase Producto para que soporte procesos o reglas dinamicas: | |
class Producto { | |
method1() | |
method2() | |
method3() | |
submit() { | |
//before generic submit() | |
if(CustomBehavior.execute()){//read scripts from disk, database, etc | |
continue; | |
}else { | |
throw error; // or something | |
} | |
genericSubmit() | |
} | |
} | |
Llega un requerimiento en el que se debe enviar la info del | |
producto a un sistema interno o externo. | |
No se modifica el core, solo se crea un script: sendata.grrovy | |
class SendDataToAnotherSystem{ | |
readProductData() | |
sendProductData() | |
} | |
La clase Producto detecta un script y lo ejecuta | |
antes de su metodo submit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment