Mostrando entradas con la etiqueta patrones de diseño. Mostrar todas las entradas
Mostrando entradas con la etiqueta patrones de diseño. Mostrar todas las entradas
04 marzo 2016
23 junio 2014
#{ DISEÑO: Fluent Interface }
http://www.martinfowler.com/bliki/FluentInterface.html
http://blog.crisp.se/2013/10/09/perlundholm/another-builder-pattern-for-java
http://www.javacodegeeks.com/2013/01/fluent-object-creation.html
http://www.slideshare.net/kindblad/the-fluent-interface-pattern
http://www.ibm.com/developerworks/library/j-eaed14/
http://blogs.msdn.com/b/laurionb/archive/2009/02/16/immutable-objects-in-fluent-interfaces-a-lesson-from-functional-programming.aspx
http://visualstudiomagazine.com/articles/2013/11/01/when-to-build-fluent-interfaces-for-re-use-and-clarity.aspx
07 febrero 2014
#{ TIP: Builder Pattern }
Builder Pattern ejemplo, queda bonito llamar a los constructores así, además se bypassear, los valores por defecto de los métodos (default value parameter) como por ejemplo se puede hacer en otros lenguajes como C++ o ActionScript3 por ejemplo:
void parameterizedMethod(float param1, int param2, bool param3=false);En JAVA se puede "bypassear" con la siguiente técnica:
public class StudentBuilder
{
private String _name;
private int _age = 14; // this has a default
private String _motto = ""; // most students don't have one
public StudentBuilder() { }
public Student buildStudent()
{
return new Student(_name, _age, _motto);
}
public StudentBuilder name(String _name)
{
this._name = _name;
return this;
}
public StudentBuilder age(int _age)
{
this._age = _age;
return this;
}
public StudentBuilder motto(String _motto)
{
this._motto = _motto;
return this;
}
}
Student s1 = new StudentBuilder().name("Eli").buildStudent();
Student s2 = new StudentBuilder()
.name("Spicoli")
.age(16)
.motto("Aloha, Mr Hand")
.buildStudent();
http://stackoverflow.com/questions/222214/managing-constructors-with-many-parameters-in-java-1-4/222295#222295
09 agosto 2013
#{ JAVA: DI vs ServiceLocator }
Interesante lectura, bien explicada sobre inyección de dependencias.
http://steveschols.wordpress.com/2012/05/14/dependency-injection-vs-service-locator/
21 marzo 2011
#{ Patrón Singleton }
http://chuidiang.blogspot.com/2005/12/patrn-singleton.html
http://www.webtaller.com/construccion/lenguajes/java/lecciones/singletons-java-patron-instancia-unica.php
http://luchorondon.blogspot.com/2009/04/patron-singleton-implementacion.html
http://software.guisho.com/singleton-pattern-patrones-de-diseno
http://acercadejava.blogspot.com/2010/10/patron-de-diseno-singleton.html
http://msdn.microsoft.com/es-es/library/bb972272.aspx
http://www.railsymas.com/2009/10/10/patron-de-desarrollo-singleton-java/
http://www.frogueros.com/showthread.php?t=125962
http://www.webtaller.com/construccion/lenguajes/java/lecciones/singletons-java-patron-instancia-unica.php
http://luchorondon.blogspot.com/2009/04/patron-singleton-implementacion.html
http://software.guisho.com/singleton-pattern-patrones-de-diseno
http://acercadejava.blogspot.com/2010/10/patron-de-diseno-singleton.html
http://msdn.microsoft.com/es-es/library/bb972272.aspx
http://www.railsymas.com/2009/10/10/patron-de-desarrollo-singleton-java/
http://www.frogueros.com/showthread.php?t=125962
15 febrero 2011
#{ Patrones de Diseño por Cerebro }
http://dukechile.blogspot.com/2008/06/el-patron-prototype-prototipo.html
http://dukechile.blogspot.com/2008/06/el-patrn-extension-objects.html
http://dukechile.blogspot.com/2008/07/el-patrn-command.html
http://dukechile.blogspot.com/2008/07/el-patrn-observer-observador.html
http://dukechile.blogspot.com/2008/07/el-patrn-memento.html
http://dukechile.blogspot.com/2008/08/el-patrn-cadena-de-responsabilidad.html
http://dukechile.blogspot.com/2008/06/el-patrn-extension-objects.html
http://dukechile.blogspot.com/2008/07/el-patrn-command.html
http://dukechile.blogspot.com/2008/07/el-patrn-observer-observador.html
http://dukechile.blogspot.com/2008/07/el-patrn-memento.html
http://dukechile.blogspot.com/2008/08/el-patrn-cadena-de-responsabilidad.html
Suscribirse a:
Entradas
(Atom)