Popular recipes tagged "design" but not "factory"http://code.activestate.com/recipes/tags/design-factory/2011-08-24T05:29:15-07:00ActiveState Code RecipesConcrete Class Finder (Python) 2011-08-24T05:29:15-07:00Lucio Santihttp://code.activestate.com/recipes/users/4178886/http://code.activestate.com/recipes/577858-concrete-class-finder/ <p style="color: grey"> Python recipe 577858 by <a href="/recipes/users/4178886/">Lucio Santi</a> (<a href="/recipes/tags/case/">case</a>, <a href="/recipes/tags/class/">class</a>, <a href="/recipes/tags/design/">design</a>, <a href="/recipes/tags/finder/">finder</a>, <a href="/recipes/tags/match/">match</a>, <a href="/recipes/tags/oop/">oop</a>, <a href="/recipes/tags/pattern/">pattern</a>, <a href="/recipes/tags/suitable/">suitable</a>, <a href="/recipes/tags/switch/">switch</a>). </p> <p>This recipe implements a design pattern useful for performing an object-oriented case analysis for a particular object (or a collection of objects as well). Essentially, it is an alternative to complex if-then-else or switches. Modelling each case with a particular class, the Concrete Class Finder searches for an appropriate case/class that applies to the given object/s. Once found, this class can be used in an homogeneous way, independently of the object/s previously considered.</p> Maybe pattern (Python) 2010-07-21T11:08:11-07:00Alan Franzonihttp://code.activestate.com/recipes/users/4169882/http://code.activestate.com/recipes/577248-maybe-pattern/ <p style="color: grey"> Python recipe 577248 by <a href="/recipes/users/4169882/">Alan Franzoni</a> (<a href="/recipes/tags/design/">design</a>, <a href="/recipes/tags/maybe/">maybe</a>, <a href="/recipes/tags/pattern/">pattern</a>). Revision 2. </p> <p>An example Maybe pattern implementation for Python.</p>