<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6542063263487500177</id><updated>2026-02-16T04:15:18.027-03:00</updated><category term="Programación"/><category term="Esperando el fin de semana"/><category term="Design Patterns"/><category term="Patrones de diseño"/><category term="Diseño"/><category term="Antipatrones"/><category term="Patrones de diseño de comportamiento"/><category term="Antipatrones de desarrollo de software"/><category term="Objeto"/><category term="Patrones de diseño estructurales"/><category term="SOLID"/><category term="Patrones de diseño de creación"/><category term="MVC"/><category term="Refactoring"/><category term="agile"/><category term="Abstract Factory"/><category term="Factory Method"/><category term="Func"/><category term="Func&lt;T&gt;"/><category term="Generics"/><category term="IoC"/><category term="La sección del invitado"/><category term="Libros recomendados"/><category term="ListBox"/><category term="Mis opiniones"/><category term="Múltibple"/><category term="Null object"/><category term="OCP"/><category term="Principio Abierto Cerrado"/><category term="Principio de inversión de dependencia"/><category term="Selección"/><category term="Strategy"/><category term="metodología"/><category term="scrum"/><category term="Ágile"/><category term="Adapter"/><category term="Ambiguous Viewpoint"/><category term="Antipatrones de arquitectura de software"/><category term="Array"/><category term="Autofac"/><category term="Autogenerated Stovepipe"/><category term="Bridge"/><category term="Buddy class"/><category term="Builder"/><category term="Chain of Responsability"/><category term="Chosen"/><category term="Command"/><category term="Composite"/><category term="Continuous Obsolescence"/><category term="Cut and paste"/><category term="DIP"/><category term="DRY"/><category term="DataAnnotations"/><category term="Dead Code"/><category term="Decorator"/><category term="Dependency inversion"/><category term="Diseño ágil con TDD"/><category term="Don&#39;t repeat Yourself"/><category term="Facade"/><category term="Flyweight"/><category term="Functional Decomposition"/><category term="Golden Hammer"/><category term="Harvest"/><category term="ISP"/><category term="Interpreter"/><category term="Inversion of Control"/><category term="Inversión de control"/><category term="Iterator"/><category term="LSP"/><category term="Lava Flow"/><category term="Mediator"/><category term="Memento"/><category term="Minefield"/><category term="No lo vas a necesitar"/><category term="No te repitas a ti mismo"/><category term="Object Pool"/><category term="Observer"/><category term="Parche"/><category term="Parrot"/><category term="Poltergeist"/><category term="Principio de responsabilidad única"/><category term="Principio de segregación de interfaces"/><category term="Principio de sustitución de Liskov"/><category term="Private Class Data"/><category term="Programacion"/><category term="Prototype"/><category term="Proxy"/><category term="Razor"/><category term="SRP"/><category term="Simple injector"/><category term="Singleton"/><category term="Spaghetti Code"/><category term="State"/><category term="Template method"/><category term="The Blob"/><category term="The God Class"/><category term="The field X must be a date"/><category term="Update Panel"/><category term="Validaciones"/><category term="Visitor"/><category term="Web"/><category term="YAGNI"/><category term="You Ain&#39;t Gonna Need It"/><category term="cookies"/><category term="politica"/><category term="politica de cookies"/><category term="switch"/><category term="view engine"/><category term="Ágil"/><title type='text'>Programación SOLIDa</title><subtitle type='html'>Programa siempre como si la persona que mantiene el código fuera un violento psicópata que sabe en donde vives.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://programacionsolida.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://programacionsolida.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Juan Barrionuevo</name><uri>http://www.blogger.com/profile/07895201334150360791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>104</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6542063263487500177.post-4390042101856170303</id><published>2016-12-15T15:16:00.001-03:00</published><updated>2016-12-15T15:16:52.616-03:00</updated><title type='text'>Horas en la oficina vs ideas y conocimiento aportado (by Javier Garzás)</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://www.assemblymag.com/ext/resources/Issues/September2013/asb1013line4.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://www.assemblymag.com/ext/resources/Issues/September2013/asb1013line4.jpg&quot; height=&quot;182&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
En esta oportunidad, quería compartirles un post que he leido y con el que estoy plenamente de acuerdo:&lt;br /&gt;
&lt;br /&gt;
“Mi padre, Burt Scott, que trabajó para Henry Ford durante muchos años, me contó una historia acerca de aquel encuentro. En la planta de Ford situada en River Rouge tenían problemas técnicos con un nuevo generador de gran tamaño.&lt;br /&gt;
Los ingenieros eléctricos de la factoría eran incapaces de encontrar dónde se hallaba el problema, por lo que Henry Ford solicitó la ayuda de Setinmetz [nota de jgarzas: que fue un grandísimo genio, de esos hoy tan desconocidos]. Cuando el “pequeño gigante” [nota de jgarzas: sufría de enanismo] llegó a la fábrica, se negó a recibir cualquier tipo de ayuda, sólo solicitó una libreta, un lapicero y un camastro.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;Durante dos interminables días, y noches, Steinmetz se dedicó a escuchar el sonido del generador y a realizar incontables cálculos.&lt;br /&gt;
Entonces, pidió una escalera, cinta métrica y una tiza. Subió con esfuerzo a lo alto del generador y midió con sumo cuidado, colocando una precisa marca de tiza en una parte de la enorme máquina.&lt;br /&gt;
Hecho esto, descendió por la escalera y comentó a los escépticos presentes que era necesario desmontar una placa del lateral del generador y eliminar 16 vueltas de la bobina a partir del punto en que había realizado la marca de tiza.&lt;br /&gt;
Los ingenieros introdujeron más tarde las correcciones sugeridas por Steinmetz y el generador comenzó a partir de entonces a funcionar perfectamente.&lt;br /&gt;
Al poco le llegó a Ford una factura por 10.000 dólares firmada por Steinmetz desde General Electric. Ford devolvió la factura, agradeciendo el buen trabajo realizado por Steinmetz, pero solicitando respetuosamente una factura detallada. Steinmetz respondió enviando de nuevo la factura a Ford con el siguiente detalle:&lt;br /&gt;
Marca de tiza en el generador: 1 dólar [trabajo físico, nota de jgarzas].&lt;br /&gt;
Saber dónde hacer la marca: 9.999 dólares [idea y conocimiento, nota de jgarzas]&lt;br /&gt;
Total a pagar: 10.000 dólares”&lt;br /&gt;
—&lt;br /&gt;
La anterior historia se puede encontrar en multitud de fuentes por la Web, desconozco la fuente original (si alguien la conoce que me la pase y la cito como fuente).&lt;br /&gt;
En la era del conocimiento, seguir valorando el trabajo de un profesional en función de las horas que pasa sentado en la oficina, es otra de esas malas prácticas que nos ha tocado, y tocará, vivir durante muchos años, demasiados. Otra herencia envenenada que nos deja la era industrial.&lt;br /&gt;
En los trabajos industriales, en los trabajos de obrero, en las cadenas de montaje, en las construcciones de carreteras, puentes, etc., es hasta cierto punto lógico pensar que a “más horas de trabajo más avance del proyecto”. Pero en los trabajos del conocimiento (como por ejemplo es el desarrollo software) ¿de verdad crees que horas equivale a trabajo?&lt;br /&gt;
Llevo muchos &amp;nbsp;años viendo y sufriendo esta extraña manera de valorar el trabajo basado en el conocimiento, sólo por horas.&lt;br /&gt;
Ya desde mis primeros años, cuando trabajaba para una consultora grande en modo “body shopping”, si había algo que te hacían aprender rápido era que el mejor, el “más comprometido” le decían, era el que salía más tarde.&lt;br /&gt;
Daba igual que estuvieras 12 horas pensando en como organizar la fiesta del próximo fin de semana, lo importante no era tanto tu mente… era tu cuerpo sentado en una silla.&lt;br /&gt;
Posteriormente, incluso he visto muchos lugares que continuaban esa idea instalando sistemas de fichar que contaban las horas desde que entrabas hasta que salías (aunque mucha gente pasase la mitad de esas horas charlando frene a la máquina de café que había dentro de la oficina). Como si por tener a alguien más horas dentro de una oficina fuese a tener más ideas.&lt;br /&gt;
En los trabajos del conocimiento una buena idea que se explica en 5 min. puede ahorrar a una empresa, o aun equipo, meses o años, 5 min. pueden hacer ganar muchos proyectos.&lt;br /&gt;
Y las buenas ideas, la elaboración de muy buenos trabajos intelectuales, no sale sólo con horas… sale del conocimiento y la motivación.&lt;br /&gt;
Es algo que se nos ha inculcado desde nuestra educación, esfuerzo = &amp;nbsp;horas sentado = &amp;nbsp;éxito. Clavar los codos. Que sin esfuerzo no hay éxito es una realidad, que el esfuerzo no garantiza el éxito es otra, que el esfuerzo no es solo estar en la oficina es otra, esfuerzo también es estrujarse el cerebro en el coche, paseando, hasta por las noches.&lt;br /&gt;
Aún hoy yo intento quitarme esas ideas tradicionales industriales de la cabeza, en ocasiones sin éxito. Sé que muchas veces dando un paseo podría generar ideas geniales pero hay alguna neurona por ahí llamada remordimiento de conciencia que tiene grabado a fuego que &amp;nbsp;pasear = &amp;nbsp;no horas sentado = &amp;nbsp;no estás trabajando.&lt;br /&gt;
Y lo peor, es que en gran parte del mundo tecnológico no se toma en serio que las ideas que se generan muchas veces fuera de la oficina, momentos que para mí, paradójicamente, son los más me han generado grandes ideas.&lt;br /&gt;
Aún hoy me encuentro proyectos que solo valoran “las horas” que ven a alguien trabajando, a los que parece importarles nada el conocimiento que acumulado durante años y que se puede aportar en 30 min., conocimiento que supone años. Parece importar poco que pienses en el proyecto cuando vas en el coche, te duchas o te lavas los dientes. Importan las horas en la oficina.&lt;br /&gt;
Sé que el mundo aún no está preparado para valorar el trabajo de otra manera, valorar el rendimiento según la motivación, el conocimiento aportado, las ideas generadas, la felicidad aportada, la garra, la valentía para sacar algo a toda costa, la entrega, etc.&lt;br /&gt;
Sé que ni siquiera los negocios y modelos de facturación en los trabajos del conocimiento están preparados para ello, la mayoría de los proyectos se facturan “por horas”.&lt;br /&gt;
Pero déjame que me atreva a decir que los próximos años aquellas empresas que aprendan a gestionar el rendimiento como “conocimiento aportado”, más allá de “horas sentado”, abrirán una brecha sin igual con las tradicionales, las que gestionan ideas de manera similar a la gestión del trabajo en una cadena de montaje de coches.&lt;br /&gt;
Yo espero rodearme de las primeras.&lt;br /&gt;
Llegado lo cual, ojo, ello no sería el paraíso, sería un cambio de modelo, en vez de valorar las horas se valoraría el conocimiento y las ideas aportadas, más horas y no buen trabajo intelectual sería un trabajo mal realizado. Pocas horas de trabajo y ningún aporte sería un muy mal trabajo.&lt;br /&gt;
Para terminar, permíteme que te diga que si estás pensando que lo ideal es gente trabajando 12 horas, soltando ideas &amp;nbsp;y mucho conocimiento cada hora… es que no has entendido este post.&lt;br /&gt;
—&lt;br /&gt;
“Puedo decirle a un obrero que a las 7 de la mañana sea productivo. Pero ¿puedo decirle a un ingeniero que tenga una buena idea a las 7 de la mañana?” Akio Morita (fundador de Sony)&lt;br /&gt;
“Contar el rendimiento de un profesional del conocimiento en base a las horas que pasa sentado en una silla tiene el mismo sentido que contar el avance de un proyecto software en función del número de líneas de código, ninguno.” Yo&lt;br /&gt;
&lt;br /&gt;
Fuente:&amp;nbsp;http://www.javiergarzas.com/2014/03/horas-vs-conocimiento.html</content><link rel='replies' type='application/atom+xml' href='http://programacionsolida.blogspot.com/feeds/4390042101856170303/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://programacionsolida.blogspot.com/2016/12/horas-vs-conocimiento.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/4390042101856170303'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/4390042101856170303'/><link rel='alternate' type='text/html' href='http://programacionsolida.blogspot.com/2016/12/horas-vs-conocimiento.html' title='Horas en la oficina vs ideas y conocimiento aportado (by Javier Garzás)'/><author><name>Juan Barrionuevo</name><uri>http://www.blogger.com/profile/07895201334150360791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6542063263487500177.post-925503883577824393</id><published>2015-12-01T20:00:00.000-03:00</published><updated>2015-12-02T15:16:55.070-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Func"/><category scheme="http://www.blogger.com/atom/ns#" term="Func&lt;T&gt;"/><category scheme="http://www.blogger.com/atom/ns#" term="Generics"/><category scheme="http://www.blogger.com/atom/ns#" term="Refactoring"/><category scheme="http://www.blogger.com/atom/ns#" term="switch"/><title type='text'>Switch para un enum vs Func delegate</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKML8X86RontSuvJDQ90mEIghD_56tSHsaGGs1mb5EYk9vOB3pIE5e34TSwbvYvhWkg3ju_zRRayllq3B1Eksd7X_aCtnOCLd_EGbvO-PYaer8ZK2wv3dbwOFJTAr321bXyVyJ6-5iRzE/s1600/image%2525255B1%2525255D%255B1%255D.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;130&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKML8X86RontSuvJDQ90mEIghD_56tSHsaGGs1mb5EYk9vOB3pIE5e34TSwbvYvhWkg3ju_zRRayllq3B1Eksd7X_aCtnOCLd_EGbvO-PYaer8ZK2wv3dbwOFJTAr321bXyVyJ6-5iRzE/s200/image%2525255B1%2525255D%255B1%255D.jpg&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
La relación entre los enum y la cláusula switch es una de las más comunes. Tanto es así que muchas veces cuesta pensar en separarlos para encarar otra manera de usar un enum como diferenciador de categorías.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Pues bueno, la intención de este post es, al menos para este ejemplo de situación, romper con esta relación y apuntar a un diseño más orientado a objetos y menos al viejo desarrollo estructurado.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot; style=&quot;text-align: justify;&quot;&gt;
Nota: Antes que nada, deseo aclarar que el ejemplo que deseo plantear, quizás resulte algo largo pero quiero dejar plasmado como puede ir evolucionando el comportamiento de una clase según los requerimientos van evolucionando. Espero sepan disculpar la monotonía en pro de una explicación más clara.&lt;/blockquote&gt;
&lt;h3 style=&quot;text-align: justify;&quot;&gt;
Manos a la obra&lt;/h3&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Supongamos que se posee una clase simple que devuelve distintas carpetas:&lt;/div&gt;
&lt;pre class=&quot;lang-cs prettyprint&quot;&gt;&lt;code&gt;
public sealed class Folder
{
    private const string APP = &quot;MyApp&quot;;
    private const string COMPANY = &quot;MyCompany&quot;;
    private const string LOGS = &quot;logs&quot;;

    public string GetLogFolder()
    {
        return LOGS;
    }

    public string GetApplicationFolder()
    {
        return APP;
    }

    public string GetCompanyFolder()
    {
        return COMPANY;
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Ahora se requiere que antes de retornar la ruta solicitada se agregue un control para validar que la ruta a retornar exista. Es decir, que si la ruta a devolver no existe, se la cree.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Un primer intento podría ser agregar a todos los métodos el control mencionado, pero nos causaría una repetición de código innecesaria. Para evitar eso, crearemos un &lt;i&gt;enum &lt;/i&gt;que nos permita saber qué carpeta se nos solicita.&lt;/div&gt;
&lt;pre class=&quot;lang-cs prettyprint&quot;&gt;&lt;code&gt;
public enum FolderType
{
    Company,
    Application,
    Log
}

public sealed class Folder
{
    private const string APP = &quot;MyApp&quot;;
    private const string COMPANY = &quot;MyCompany&quot;;
    private const string LOGS = &quot;logs&quot;;

    public Folder()
    {
    }

    public string GetFolder(FolderType folderType)
    {
        var folder = string.Empty;

        switch (folderType)
        {
            case FolderType.Company:
                folder = this.GetCompanyFolder();
                break;
            case FolderType.Application:
                folder = this.GetApplicationFolder();
                break;
            case FolderType.Log:
                folder = this.GetLogFolder();
                break;
        }

        if (!System.IO.Directory.Exists(folder))
            System.IO.Directory.CreateDirectory(folder);

        return folder;
    }

    private string GetLogFolder()
    {
        return LOGS;
    }

    private string GetApplicationFolder()
    {
        return APP;
    }

    private string GetCompanyFolder()
    {
        return COMPANY;
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Como se puede apreciar en este nuevo ejemplo, ahora agregamos un nuevo método que recibe como argumento un &lt;i&gt;enum &lt;/i&gt;(el tipo de carpeta que deseamos obtener) y en base a este &lt;i&gt;enum&lt;/i&gt;, tomamos la decisión que método ejecutar para obtener la carpeta solicitada para luego controlar que exista (y crearla en caso de inexistencia) para finalmente devolverla. Y además, se cambió el scope de las funciones para que ya no puedan ser llamadas individualmente.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Pues bien. Hemos llegado finalmente al motivo de este post: cómo reemplazar este &lt;i&gt;switch &lt;/i&gt;y ejecutar el método que se desea:&lt;/div&gt;
&lt;pre class=&quot;lang-cs prettyprint&quot;&gt;&lt;code&gt;
public enum FolderType
{
    Company,
    Application,
    Log
}

public sealed class Folder
{
    private const string APP = &quot;HSLifeSynchro&quot;;
    private const string COMPANY = &quot;Hasar Sistemas&quot;;
    private const string LOGS = &quot;logs&quot;;

    private Dictionary&lt;foldertype func=&quot;&quot; string=&quot;&quot;&gt;&amp;gt; functions = new Dictionary&lt;foldertype func=&quot;&quot; string=&quot;&quot;&gt;&amp;gt;();

    private Folder()
    {
        this.functions.Add(FolderType.Application, this.GetApplicationFolder);
        this.functions.Add(FolderType.Company, this.GetCompanyFolder);
        this.functions.Add(FolderType.Log, this.GetLogFolder);
    }

    public string Get(FolderType folderType)
    {
     // Se remplazó el switch por la ejecución del método correcto vía Dictionary.
        var directory = this.functions[folderType]();

        if (!Directory.Exists(directory))
            Directory.CreateDirectory(directory);

        return directory;
    }

    private string GetLogFolder()
    {
        return LOGS;
    }

    private string GetApplicationFolder()
    {
        return APP;
    }

    private string GetCompanyFolder()
    {
        return COMPANY;
    }
}
&lt;/foldertype&gt;&lt;/foldertype&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Para resolver este reemplazo, nos vamos a valer de un diccionario que utiliza como clave los tipos declarados en el &lt;i&gt;enum &lt;/i&gt;y como elemento, en este caso, un &lt;i&gt;Func&amp;lt;string&amp;gt;&lt;/i&gt; (una función que retorna &lt;i&gt;string &lt;/i&gt;y no recibe parámetros como es nuestro caso. Aunque se podría utilizar otras firmas de métodos, cabe aclarar que todas las funciones deben cumplir como requerimiento con la misma firma entre ellas: retorno, cantidad y tipos de argumentos).&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
En el constructor de la clase Folder agregamos los tres elementos posibles al diccionario. De esta manera queda declarada implícitamente la decisión a ser tomada: qué método debe ejecutarse según el tipo de carpeta solicitado. Una mejor aproximación sería recibir esta lista como argumento del constructor y no crearla para cumplir con &lt;a href=&quot;http://programacionsolida.com.ar/2011/12/inversion-de-control-ioc.html&quot; target=&quot;_blank&quot;&gt;IoC&lt;/a&gt; y el &lt;a href=&quot;http://programacionsolida.com.ar/2011/11/principio-de-responsabilidad-unica-srp.html&quot; target=&quot;_blank&quot;&gt;principio de Single Responsability&lt;/a&gt;, pero como ya hice largo el ejemplo, no quería complicarlo aun más.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
En el método Get (el que contenía al &lt;i&gt;switch&lt;/i&gt;) ahora simplemente ejecuta una línea antes del control de existencia del directorio solicitado.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Como se puede ver, ahora el código ha quedado mucho más limpio, mejorada la orientación a objetos y sin código repetido.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Espero que les resulte útil.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://programacionsolida.blogspot.com/feeds/925503883577824393/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://programacionsolida.blogspot.com/2015/12/switch-para-enum-vs-func-delegate.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/925503883577824393'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/925503883577824393'/><link rel='alternate' type='text/html' href='http://programacionsolida.blogspot.com/2015/12/switch-para-enum-vs-func-delegate.html' title='Switch para un enum vs Func&lt;T&gt; delegate'/><author><name>Juan Barrionuevo</name><uri>http://www.blogger.com/profile/07895201334150360791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKML8X86RontSuvJDQ90mEIghD_56tSHsaGGs1mb5EYk9vOB3pIE5e34TSwbvYvhWkg3ju_zRRayllq3B1Eksd7X_aCtnOCLd_EGbvO-PYaer8ZK2wv3dbwOFJTAr321bXyVyJ6-5iRzE/s72-c/image%2525255B1%2525255D%255B1%255D.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6542063263487500177.post-269515904307869696</id><published>2014-11-11T16:59:00.000-03:00</published><updated>2014-11-11T16:59:50.838-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Func"/><category scheme="http://www.blogger.com/atom/ns#" term="Func&lt;T&gt;"/><category scheme="http://www.blogger.com/atom/ns#" term="Generics"/><category scheme="http://www.blogger.com/atom/ns#" term="Refactoring"/><title type='text'>Código repetido? Func&amp;lt;T&amp;gt; al rescate</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKML8X86RontSuvJDQ90mEIghD_56tSHsaGGs1mb5EYk9vOB3pIE5e34TSwbvYvhWkg3ju_zRRayllq3B1Eksd7X_aCtnOCLd_EGbvO-PYaer8ZK2wv3dbwOFJTAr321bXyVyJ6-5iRzE/s1600/image%255B1%255D%5B1%5D.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;130&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKML8X86RontSuvJDQ90mEIghD_56tSHsaGGs1mb5EYk9vOB3pIE5e34TSwbvYvhWkg3ju_zRRayllq3B1Eksd7X_aCtnOCLd_EGbvO-PYaer8ZK2wv3dbwOFJTAr321bXyVyJ6-5iRzE/s200/image%25255B1%25255D%5B1%5D.jpg&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Un problema muy común que nos podemos llegar a topar al desarrollar, es encontrarnos con métodos sumamente parecidos. En ellos podemos notar que su comportamiento son muy similares y que podrían diferenciarse por muy poco.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Paar graficar un poco mejor las cosas, imaginemos un caso muy sencillo en el tenemos un Wrapper de un WebService:&lt;/div&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;pre class=&quot;lang-cs prettyprint&quot;&gt;&lt;code&gt;
namespace EjemploSimple
{
 public class WrapperMyWebService
 {
  private MyWebService webService;

  public WrapperMyWebService(MyWebService webService)
  {
   this.webService = webService;
  }

  public string GetWebServiceStatus()
  {
   return this.webService.GetStatus();
  }

  public string GetSomeValue( int key )
  {
   return this.webService.GetSomeValue( key );
  }
 }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Hasta aquí, la clase tiene dos métodos con comportamientos diferentes. Cada uno posee una única línea de código que se encarga de llamar a métodos diferentes del objeto al cual envuelven. Pero qué sucede si se le cambia el comportamiento a ambos métodos:&lt;/div&gt;
&lt;br /&gt;
&lt;pre class=&quot;lang-cs prettyprint&quot;&gt;&lt;code&gt;
namespace EjemploSimple
{
 public class WrapperMyWebService
 {
  private MyWebService webService;

  public WrapperMyWebService(MyWebService webService)
  {
   this.webService = webService;
  }

  public string GetWebServiceStatus()
  {
   string ret = &quot;&quot;;
   try
   {
    ret = this.webService.GetStatus();   
   }
   catch( Exception e )
   {
    ret = string.Concat( &quot;ERROR: &quot;,  e.Message );
   }

   return ret;
  }

  public string GetSomeValue( int key )
  {
   string ret = &quot;&quot;;
   try
   {
    ret = this.webService.GetSomeValue( key );   
   }
   catch( Exception e )
   {
    ret = string.Concat( &quot;ERROR: &quot;,  e.Message );
   }

   return ret;
  }
 }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
En esta nueva versión de la clase, podemos notar que ahora la mayor parte del código está repetido. En ambos casos se desea atrapar una excepción y en ambos casos se desea devolver el mensaje de error. Imaginemos ahora que debemos agregar más métodos con el mismo comportamiento y que luego, ese mismo comportamiento quiere ser modificado para todos los métodos. Se debe escribir esa modificación tantas veces como métodos con el mismo comportamiento hubiera.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Aquí es donde viene en nuestra ayuda &quot;Generics&quot;. Generics posee varias herramientas. Una de ellas se puede aplicar para solucionar este problema: Func&amp;lt;T&amp;gt;.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Primero y principal, debemos determinar la lógica repetida:&lt;/div&gt;
&lt;br /&gt;
&lt;pre class=&quot;lang-cs prettyprint&quot;&gt;&lt;code&gt;
  public string MethodName()
  {
   string ret = &quot;&quot;;
   try
   {
    //Invoke Web Service method.
   }
   catch( Exception e )
   {
    ret = string.Concat( &quot;ERROR: &quot;,  e.Message );
   }

   return ret;
  }
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Como podemos apreciar, sólo la invocación al método del web service es lo que diferencia a ambos métodos. Func&amp;lt;T&amp;gt; nos permite poder pasar como argumento a otro método un &quot;puntero&quot; a una función para que se invocada. Para nuestro ejemplo, el método genérico quedaría así:&lt;/div&gt;
&lt;br /&gt;
&lt;pre class=&quot;lang-cs prettyprint&quot;&gt;&lt;code&gt;
namespace EjemploSimple
{
 public class WrapperMyWebService
 {
  private MyWebService webService;

  public WrapperMyWebService(MyWebService webService)
  {
   this.webService = webService;
  }

  public string GetWebServiceStatus()
  {
   return this.GenericGetter( () =&amp;gt; this.webService.GetStatus() );
  }

  public string GetSomeValue( int key )
  {
   return this.GenericGetter( () =&amp;gt; this.webService.GetSomeValue( key ) );
  }

  public string GenericGetter( Func&amp;lt;T&amp;gt;&lt;string&gt; fetch )
  {
   string ret = &quot;&quot;;
   try
   {
    ret = fetch;
   }
   catch( Exception e )
   {
    ret = string.Concat( &quot;ERROR: &quot;,  e.Message );
   }

   return ret;
  }
 }
}
&lt;/string&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
En este último ejemplo, podemos notar que el método que poseía el comportamiento repetido queda escrito una sola vez y los métodos que tenían dicho comportamiento, pasan a ejecutar esta nueva función pasándole como argumento el puntero a la función del Web Service que se desea invocar.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://programacionsolida.blogspot.com/feeds/269515904307869696/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://programacionsolida.blogspot.com/2014/11/codigo-repetido-func-al-rescate.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/269515904307869696'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/269515904307869696'/><link rel='alternate' type='text/html' href='http://programacionsolida.blogspot.com/2014/11/codigo-repetido-func-al-rescate.html' title='Código repetido? Func&amp;lt;T&amp;gt; al rescate'/><author><name>Juan Barrionuevo</name><uri>http://www.blogger.com/profile/07895201334150360791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKML8X86RontSuvJDQ90mEIghD_56tSHsaGGs1mb5EYk9vOB3pIE5e34TSwbvYvhWkg3ju_zRRayllq3B1Eksd7X_aCtnOCLd_EGbvO-PYaer8ZK2wv3dbwOFJTAr321bXyVyJ6-5iRzE/s72-c/image%25255B1%25255D%5B1%5D.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6542063263487500177.post-154699825967450161</id><published>2014-02-04T09:00:00.000-03:00</published><updated>2014-02-04T09:00:05.120-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Dependency inversion"/><category scheme="http://www.blogger.com/atom/ns#" term="Inversion of Control"/><category scheme="http://www.blogger.com/atom/ns#" term="IoC"/><category scheme="http://www.blogger.com/atom/ns#" term="Principio de inversión de dependencia"/><category scheme="http://www.blogger.com/atom/ns#" term="Simple injector"/><title type='text'>Simple Injector: Framework para IoC</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPQaAY8Vnxue7nkit0uGEOmLyLSDcIbJxK6qVErfT5Qm6-N12swXZ_sSNz_Kines_7hcG5JGAJc2Hc0qcnZM6bQ8fvyX1QB6OlatxtmlycjnZZtIhbzQi7PCbujEWzjLpzD8GIvyIV3nE/s1600/logo2.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPQaAY8Vnxue7nkit0uGEOmLyLSDcIbJxK6qVErfT5Qm6-N12swXZ_sSNz_Kines_7hcG5JGAJc2Hc0qcnZM6bQ8fvyX1QB6OlatxtmlycjnZZtIhbzQi7PCbujEWzjLpzD8GIvyIV3nE/s1600/logo2.png&quot; height=&quot;77&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Hace ya un tiempo habíamos visto en otro &lt;a href=&quot;http://programacionsolida.com.ar/2013/06/autofac.html&quot; target=&quot;_blank&quot;&gt;post de este blog&lt;/a&gt; un framework para realizar &lt;a href=&quot;http://programacionsolida.com.ar/2011/12/inversion-de-control-ioc.html&quot; target=&quot;_blank&quot;&gt;Inversion of Control&lt;/a&gt; o &lt;a href=&quot;http://programacionsolida.com.ar/2011/12/principio-de-inversion-de-dependencia.html&quot; target=&quot;_blank&quot;&gt;Dependency inversion principle (soliD)&lt;/a&gt;, En aquella oportunidad vimos &lt;a href=&quot;http://autofac.org/&quot; target=&quot;_blank&quot;&gt;Autofac&lt;/a&gt;. Si bien es un framework muy bueno, lamentablemente no funciona al 100% en &lt;a href=&quot;http://www.mono-project.com/Main_Page&quot; target=&quot;_blank&quot;&gt;Mono&lt;/a&gt;.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;a href=&quot;http://simpleinjector.codeplex.com/&quot; target=&quot;_blank&quot;&gt;Simple injector&lt;/a&gt; nos trae esa solución sin perder l&lt;span id=&quot;goog_655557437&quot;&gt;&lt;/span&gt;o&lt;span id=&quot;goog_655557438&quot;&gt;&lt;/span&gt; bueno que ya teníamos con el framework anterior. Además de Mono, soporta las plataformas: MVC 4.0 y superior, Silverlight 4.0 y superior, Windows phone 8 y Windows phone application.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Podemos descargarlo por &lt;a href=&quot;http://www.nuget.org/packages/SimpleInjector.Integration.Web.Mvc/&quot; target=&quot;_blank&quot;&gt;NuGet&lt;/a&gt; y es muy simple de usar. Provee una fácil implementación con características cuidadosamente escogidas dentro de la librería. Sólo se requiere que la configuración de la librería se ejecute al inicio de la aplicación. Inclusive, a partir de la versión 2 se incluye la habilidad de advertir pérdidas de configuración mientras se ejecuta la aplicación en modo debug.&lt;/div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAfy3vD4OBHRcBK2sghx4VbPBk25FYBrAjAyjw2ctXeWdzYmxPpe6nhE0I4ChJR86a0zBFbaeumvaaxkgIZJDYpmSSaGkD3xyxRJE-o-0m9L3PuW1Rvw-3CS2FZfz3eosMeTF_MCSlniU/s1600/diagnosticsdebuggerview.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAfy3vD4OBHRcBK2sghx4VbPBk25FYBrAjAyjw2ctXeWdzYmxPpe6nhE0I4ChJR86a0zBFbaeumvaaxkgIZJDYpmSSaGkD3xyxRJE-o-0m9L3PuW1Rvw-3CS2FZfz3eosMeTF_MCSlniU/s1600/diagnosticsdebuggerview.gif&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
La idea general detrás de Simple Injector (o de la Inversión de Control en general) es que el diseño de la aplicación tengan un nivel bajo de acoplamiento entre sus componentes utilizando, como ya dijimos, el patrón de inversión de dependencias. Tomemos como ejemplo la siguiente clase, &lt;i&gt;UserController&lt;/i&gt;, en el contexto de una aplicación ASP.Net MVC.&lt;/div&gt;
&lt;pre class=&quot;lang-cs prettyprint prettyprinted&quot;&gt;&lt;code&gt;
public class UserController : Controller {
    private readonly IUserRepository repository;
    private readonly ILogger logger;

    // Use constructor injection for the dependencies
    public UserController(IUserRepository repository, ILogger logger) {
        this.repository = repository;
        this.logger = logger;
    }

    // implement UserController methods here:
    public ActionResult Index() {
        this.logger.Log(&quot;Index called&quot;);
        return View(this.repository.GetAll());
    } 
}
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;
La clase &lt;i&gt;UserController &lt;/i&gt;depende de las interfaces &lt;i&gt;IUserRepository &lt;/i&gt;y &lt;i&gt;ILogger&lt;/i&gt;. Al no depender de una clase concreta, podemos realizar pruebas de la clase &lt;i&gt;UserController &lt;/i&gt;de manera aislada. Y eso es sólo la punta del iceberg de las bondades de la inversión de control.&lt;br /&gt;
Usando Simple Injector, la configuración de la aplicación podría verse mas o menos así:&lt;/div&gt;
&lt;pre class=&quot;lang-cs prettyprint prettyprinted&quot;&gt;&lt;code&gt;
protected void Application_Start(object sender, EventArgs e) {
    // 1. Create a new Simple Injector container
    var container = new Container();

    // 2. Configure the container (register)
    container.Register&amp;lt;IUserRepository, SqlUserRepository&amp;gt;();

    container.RegisterSingle&amp;lt;ILogger&amp;gt;(() =&amp;gt; new CompositeLogger(
        container.GetInstance&amp;lt;DatabaseLogger&amp;gt;(),
        container.GetInstance&amp;lt;MailLogger&amp;gt;()
    ));

    // 3. Optionally verify the container&#39;s configuration.
    container.Verify();

    // 4. Register the container as MVC3 IDependencyResolver.
    DependencyResolver.SetResolver(new SimpleInjectorDependencyResolver(container));
}
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Esta configuración muestra la registración de las implementaciones para las interfaces IUserRepository y ILogger. Este código también muestra un par de cosas interesantes. Primero que nada, se pueden asociar instancias concretas (como SqlUserRepository) a interfaces o tipos base. En el ejemplo anterior, cada vez que se solicita al contenedor de Simple Injector un &lt;i&gt;IUserRepository&lt;/i&gt;, éste va a crear una nueva instancia de la clase&amp;nbsp;&lt;i&gt;SqlUserRepository&lt;/i&gt;.&lt;br /&gt;
La registración de &lt;i&gt;ILogger &lt;/i&gt;es un poco más compleja. Se registra un delegado que conoce cómo crear una nueva implementación de &lt;i&gt;ILogger&lt;/i&gt;, en este caso &lt;i&gt;CompositeLogger&lt;/i&gt; (que resulta ser una implementación de &lt;i&gt;ILogger&lt;/i&gt;). El mismo delegado es llamado dentro del contenedor de Simple Injector y crea una instancia concreta de la clase &lt;i&gt;DatabaseLogger &lt;/i&gt;y &lt;i&gt;MailLogger &lt;/i&gt;para inyectarlo dentro de &lt;i&gt;CompositeLogger&lt;/i&gt;. Mientras el tipo de registración que hemos visto para IUserRepository es la más común, el uso de delegados permite muchos escenarios interesantes.&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;Nota&lt;/b&gt;: no se ha registrado la clase UserController. Esto se debe a que es una clase concreta. Simple Injector puede implícitamente crearla (siempre y cuando pueda resolver sus dependencias).&lt;/blockquote&gt;
Esto es todo lo que se necesita para usar Simple Injector. Diseñar las clases basados en el principio de inversión de dependencias y configurar la librería al inicio de la aplicación. Algunos frameworks (tales como ASP.NET MVC) hacen el resto, mientras que otros (como ASP.NET Web forms) necesitan una vuelta más de trabajo para dejarlo hecho. Ver la &lt;a href=&quot;http://simpleinjector.codeplex.com/wikipage?title=Integration%20Guide&amp;amp;referringTitle=Home&quot; target=&quot;_blank&quot;&gt;guía de integración&lt;/a&gt; para consultar otros ejemplos de otros frameworks.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://programacionsolida.blogspot.com/feeds/154699825967450161/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://programacionsolida.blogspot.com/2014/02/simple-injector.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/154699825967450161'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/154699825967450161'/><link rel='alternate' type='text/html' href='http://programacionsolida.blogspot.com/2014/02/simple-injector.html' title='Simple Injector: Framework para IoC'/><author><name>Juan Barrionuevo</name><uri>http://www.blogger.com/profile/07895201334150360791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPQaAY8Vnxue7nkit0uGEOmLyLSDcIbJxK6qVErfT5Qm6-N12swXZ_sSNz_Kines_7hcG5JGAJc2Hc0qcnZM6bQ8fvyX1QB6OlatxtmlycjnZZtIhbzQi7PCbujEWzjLpzD8GIvyIV3nE/s72-c/logo2.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6542063263487500177.post-8359458779903077300</id><published>2014-01-28T09:00:00.000-03:00</published><updated>2014-01-28T09:00:04.226-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Factory Method"/><category scheme="http://www.blogger.com/atom/ns#" term="Null object"/><category scheme="http://www.blogger.com/atom/ns#" term="Refactoring"/><category scheme="http://www.blogger.com/atom/ns#" term="Strategy"/><title type='text'>Refactoring aplicando patrones</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhR1_-0pHKGHmehIAh8pqnpcAT2XnjDc5RxkCwEPl45Rtmb1qzSLoNVsLARWQNea7GfhVB30f8Lcqv8gjTYGhAs3oWlijzndTKrCDDu7MVRr3q1M6MuAwF2k1YpQvKB9NBi-iOEKO4omic/s1600/image%25255B1%25255D%5B1%5D.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhR1_-0pHKGHmehIAh8pqnpcAT2XnjDc5RxkCwEPl45Rtmb1qzSLoNVsLARWQNea7GfhVB30f8Lcqv8gjTYGhAs3oWlijzndTKrCDDu7MVRr3q1M6MuAwF2k1YpQvKB9NBi-iOEKO4omic/s1600/image%25255B1%25255D%5B1%5D.jpg&quot; height=&quot;130&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
En otro&amp;nbsp;&lt;a href=&quot;http://programacionsolida.com.ar/2012/07/refactoring-aplicando-patrones.html&quot; target=&quot;_blank&quot;&gt;post de este blog&lt;/a&gt;, habíamos visto la posibilidad de reescribir código que a nuestro juicio no estaba orientado a objetos. En esta ocasión, volvemos con un caso similar. Se trata de un anidamiento de sentencias condicionales IF basadas en configuraciones.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
La idea principal es reemplazar todo este árbol de condiciones con una estructura orientada a objetos que permita poder introducir modificaciones de una manera mucho más simple.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Este caso en particular presentaba un método que buscaba un código GTIN y luego, según la parametrización del sistema debía validar el resultado obtenido.&lt;/div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;blockquote class=&quot;tr_bq&quot; style=&quot;text-align: justify;&quot;&gt;
No es la idea de este post explicar exactamente lo que significa un código GTIN. Bastará con explicar que dadas las legislaciones vigentes a la fecha en Argentina, es necesario obtener dicho código para poder realizar un comprobante de venta de manera electrónica. Tampoco es el interés de este post entrar en detalle sobre la arquitectura de la clase en la cual se halla implantado este método, sino, simplemente, el código hallado en él.&amp;nbsp;&lt;/blockquote&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
El método en cuestión es el siguiente:&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;lang-cs prettyprint&quot;&gt;&lt;code&gt;public class ComprobanteDeVentas
{
    private ComprobanteDetalle comprobanteDetalle;
    private BuscadorCodigosGTIN BuscadorCodigosGTIN;

    private void AsignarCodigoGTIN()
    {
        this.comprobanteDetalle.Item.CodigoGTIN = this.BuscadorCodigosGTIN.Obtener( this.comprobanteDetalle.Item );
        if ( Parametros.TipoDeWebServiceparafacturacionelectronicanacional == 2 )
            if ( !string.IsNullOrEmpty(this.comprobanteDetalle.Item.Articulo_PK ) &amp;amp;&amp;amp; string.IsNullOrEmpty( this.comprobanteDetalle.Item.CodigoGTIN ) &amp;amp;&amp;amp; Parametros.AvisarSiNoExisteCodigo )
                if ( Parametros.PermiteContinuar == 1)
                    Mensajes.Advertir( &quot;No se encontró codigo GTIN para los datos ingresados&quot; );
                else
                    throw new Exception( &quot;No se encontró codigo GTIN para los datos ingresados&quot; );
    }
}&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;
Como se puede apreciar, no sólo hay una cuestión técnica de arquitectura, sino también una cuestión de difícil entendimiento del código debido a la aglutinación de condiciones y lo compleja de cada una de ellas.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Yendo al análisis arquitectónico de este código, se puede determinar que la validación de la obtención de un código GTIN vacío es un comportamiento que no debe ser responsabilidad del comprobante de ventas, sino de un componente y que además, dicho componente tiene tres claras validaciones dependiendo de los parámetros del sistema:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;No validar nada.&lt;/li&gt;
&lt;li&gt;Que se muestre un mensaje de advertencia pero que permita continuar.&lt;/li&gt;
&lt;li&gt;Que se lance una excepción y corte el flujo del programa.&lt;/li&gt;
&lt;/ol&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;Teniendo esto en cuenta, se procedió a la creación de tres clases nuevas para contener estos tres comportamientos (las cuales implementan una misma interfaz) y así aplicar el patrón&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://programacionsolida.com.ar/2012/06/patrones-de-diseno-de-comportamiento_14.html&quot; style=&quot;text-align: justify;&quot; target=&quot;_blank&quot;&gt;Null object&lt;/a&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;&amp;nbsp;que resulta ser una derivación del patrón&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://programacionsolida.com.ar/2012/07/patrones-de-diseno-de-comportamiento_05.html&quot; style=&quot;text-align: justify;&quot; target=&quot;_blank&quot;&gt;Strategy&lt;/a&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;pre class=&quot;lang-cs prettyprint&quot;&gt;&lt;code&gt;public interface IValidadorGTIN
{
    void Validar( Item item );
}

public class ValidadorGTINNoHaceNada : IValidadorGTIN
{
    public void Validar( Item item )
    {
        //No se lleva a cabo ninguna acción.
    }
}

public class ValidadorGTINAvisarSiEstaVacio : IValidadorGTIN
{
    public void Validar(Item item)
    {
        if (!string.IsNullOrEmpty(item.Articulo_PK) &amp;amp;&amp;amp; string.IsNullOrEmpty( item.CodigoGTIN ) )
            Mensajes.Advertir(&quot;No se encontró codigo GTIN para los datos ingresados&quot;);
    }
}

public class ValidadorGTINNoDejaSeguirSiEstaVacio : IValidadorGTIN
{
    public void Validar(Item item)
    {
        if (!string.IsNullOrEmpty( item.Articulo_PK ) &amp;amp;&amp;amp; string.IsNullOrEmpty( item.CodigoGTIN ) )
            throw new Exception(&quot;No se encontró codigo GTIN para los datos ingresados&quot;);
    }
}&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;
Vemos que cada una de las clases tiene el método &lt;i&gt;validar &lt;/i&gt;y que a su vez tienen una sola responsabilidad cada una. Todas tienen implementan la misma interfaz: un método llamado Validar que recibe un objeto Item a validar pero cada una la implementa de una manera diferente. La primer clase no hace nada. La segunda envía un mensaje a través del componente &lt;i&gt;Mensajes&lt;/i&gt;. La tercera lanza una excepción.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
El siguiente paso fue crear la lógica para que el &lt;i&gt;ComprobanteDeVentas &lt;/i&gt;pueda recibir la instancia del validador que corresponde según el caso. Para ello tratamos de usar el patrón &lt;a href=&quot;http://programacionsolida.com.ar/2012/02/patrones-de-diseno-de-creacion-factory.html&quot; target=&quot;_blank&quot;&gt;Factory Method&lt;/a&gt; para encapsular la lógica encargada de la inyección del componente correcto.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;lang-cs prettyprint&quot;&gt;&lt;code&gt;public class ValidadorGTINFactory
{
    public static IValidadorGTIN ObtenerInstancia()
    {
        IValidadorGTIN validador = new ValidadorGTINNoHaceNada();
        bool avisarSiVacio = Parametros.AvisarSiNoExisteCodigo;
        int permiteContinuar = Parametros.PermiteContinuar;

        if ( avisarSiVacio &amp;amp;&amp;amp; permiteContinuar == 1 )
            validador = new ValidadorGTINAvisarSiEstaVacio();
        if ( avisarSiVacio &amp;amp;&amp;amp; permiteContinuar == 0 )
            validador = new ValidadorGTINNoDejaSeguirSiEstaVacio();

        return validador;
    }
}&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;
Por medio del uso del patrón &lt;a href=&quot;http://programacionsolida.com.ar/2012/02/patrones-de-diseno-de-creacion-factory.html&quot; target=&quot;_blank&quot;&gt;Factory Method&lt;/a&gt;, se lleva a cabo la instanciación del objeto validador correspondiente para la parametrización del momento. Por defecto, se devuelve el componente que no hace nada. Luego, dependiendo de la parametrización del sistema, se instancia cualquiera de las otras clases. En el caso que llegare a surgir un nuevo caso o comportamiento, bastará con agregar el caso a esta clase e instanciar la clase correspondiente al nuevo caso de validación sin la necesidad de modificar la clase ComprobanteDeVentas, respetando así uno de los principios de SOLID donde cada clase debe tener una y sólo una responsabilidad (Single responsability principle).&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Finalmente, realizamos los cambios necesarios en la clase ComprobanteDeVentas para que utilice las clases creadas. Para ello, creamos una variable de clase para contener al componente validador. El mismo es inyectado en la clase vía su constructor (*).&lt;/div&gt;
&lt;pre class=&quot;lang-cs prettyprint&quot;&gt;&lt;code&gt;
public class ComprobanteDeVentas
{
    private ComprobanteDetalle comprobanteDetalle;
    private BuscadorCodigosGTIN BuscadorCodigosGTIN;
    private IValidadorGTIN validador;

    public ComprobanteDeVentas( IValidadorGTIN validador )
    {
        this.validador = validador;
    }

    private void AsignarCodigoGTIN()
    {
        this.comprobanteDetalle.Item.CodigoGTIN = this.BuscadorCodigosGTIN.Obtener( this.comprobanteDetalle.Item );
        //Con esta línea de código se ve reemplazado el árbol de condiciones preexistentes.
        this.validador.Validar( this.comprobanteDetalle.Item );
    }
}&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;
De esta manera, la lógica de validación del código GTIN obtenido, queda separada de la clase&amp;nbsp;&lt;span style=&quot;text-align: left;&quot;&gt;&lt;i&gt;ComprobanteDeVentas&amp;nbsp;&lt;/i&gt;&lt;/span&gt;y totalmente&amp;nbsp;reutilizable para otros comprobantes. A este beneficio se suma la posibilidad de poder realizar tests individuales (TDD) de cada clase sin la necesidad de instanciar un comprobante de ventas o incluso poder generar mocks o fakes de las clases del componente validador en un test de la clase&amp;nbsp;&lt;i style=&quot;text-align: left;&quot;&gt;ComprobanteDeVentas&lt;/i&gt;.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
(*) El Factory Method del validador, debe ser invocado desde el Factory Method que instancia la clase ComprobanteDeVentas&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://programacionsolida.blogspot.com/feeds/8359458779903077300/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://programacionsolida.blogspot.com/2014/01/refactoring-aplicando-patrones.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/8359458779903077300'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/8359458779903077300'/><link rel='alternate' type='text/html' href='http://programacionsolida.blogspot.com/2014/01/refactoring-aplicando-patrones.html' title='Refactoring aplicando patrones'/><author><name>Juan Barrionuevo</name><uri>http://www.blogger.com/profile/07895201334150360791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhR1_-0pHKGHmehIAh8pqnpcAT2XnjDc5RxkCwEPl45Rtmb1qzSLoNVsLARWQNea7GfhVB30f8Lcqv8gjTYGhAs3oWlijzndTKrCDDu7MVRr3q1M6MuAwF2k1YpQvKB9NBi-iOEKO4omic/s72-c/image%25255B1%25255D%5B1%5D.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6542063263487500177.post-8543073606138416194</id><published>2014-01-17T09:00:00.000-03:00</published><updated>2014-01-17T15:18:16.195-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Esperando el fin de semana"/><title type='text'>Esperando el fin de semana</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s1600/homero-pensando.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s1600/homero-pensando.png&quot; height=&quot;200&quot; width=&quot;168&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Verano... Enero... Vacaciones... Viernes... Casi se pueden tomar como sinónimos!!!! A disfrutarlo resolviendo un acertijo y así entrenamos las neuronas.&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&quot;Bien, María&quot;, dijo el granjero Jones a su esposa, &quot;si vendemos setenta y cinco pollos, como propongo, nuestra reserva de alimento duraría veinte días más, en tanto que si compramos cien pollos más, como tú dices, nos quedaremos sin alimento para pollos quince días antes.&quot;&lt;br /&gt;&quot;Veamos, Josiah&quot;, replicó ella, &quot;¿cuántos pollos tenemos?&quot;&lt;br /&gt;Ese es el problema. ¿Cuántos pollos tenían?&lt;/blockquote&gt;
Respuesta del &lt;a href=&quot;http://programacionsolida.com.ar/2014/01/esperando-el-fin-de-semana29.html&quot; target=&quot;_blank&quot;&gt;acertijo de la semana anterior&lt;/a&gt;:&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
Problema 1.13. Almacén de ramos generales del libro &quot;Los nuevos acertijos&quot; de San Loyd&quot;&lt;br /&gt;
Los valores para cada letra son: A=3, B=6, C=4, E=2, H=5, L=7, O=8, P=1, S=0, W=9.&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://programacionsolida.blogspot.com/feeds/8543073606138416194/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://programacionsolida.blogspot.com/2014/01/esperando-el-fin-de-semana30.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/8543073606138416194'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/8543073606138416194'/><link rel='alternate' type='text/html' href='http://programacionsolida.blogspot.com/2014/01/esperando-el-fin-de-semana30.html' title='Esperando el fin de semana'/><author><name>Juan Barrionuevo</name><uri>http://www.blogger.com/profile/07895201334150360791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s72-c/homero-pensando.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6542063263487500177.post-8332483262250332411</id><published>2014-01-10T09:00:00.000-03:00</published><updated>2014-01-10T09:00:14.256-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Esperando el fin de semana"/><title type='text'>Esperando el fin de semana</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s1600/homero-pensando.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s1600/homero-pensando.png&quot; height=&quot;200&quot; width=&quot;168&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Un nuevo acertijo para activar las neuronas o al menos aquellas que no se encuentren pensado en el fin de semana.&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
El dueño de un almacén de ramos generales, que es aficionado a los acertijos, ha puesto una pizarra para ver si alguno de sus amigos matemáticos puede traducirlo correctamente. Cada una de las distintas letras representa a un dígito diferente. Las palabras que están por encima de la línea horizontal representan números que, sumados, dan el total &quot;All Wool&quot;. El problema consiste en reemplazar las letras por los dígitos correctos.&lt;/blockquote&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsvkUUJvOfTPReUs7PTR8zz_tIY9imG4iKLXAd2xUbjmOMBK4i9_4b0STk3PlvZAzwnDgTsAlTwpF7wtXfpn2huTrPfJDyIqg6vR9Lv0UOniUP5lMpDYyIfIo4Rn1s3-uITQXnbJ4FIcs/s1600/Pizarra.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsvkUUJvOfTPReUs7PTR8zz_tIY9imG4iKLXAd2xUbjmOMBK4i9_4b0STk3PlvZAzwnDgTsAlTwpF7wtXfpn2huTrPfJDyIqg6vR9Lv0UOniUP5lMpDYyIfIo4Rn1s3-uITQXnbJ4FIcs/s1600/Pizarra.PNG&quot; height=&quot;320&quot; width=&quot;227&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
Respuesta del &lt;a href=&quot;http://programacionsolida.com.ar/2014/01/esperando-el-fin-de-semana28.html&quot; target=&quot;_blank&quot;&gt;acertijo de la semana pasada&lt;/a&gt;:&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
Cuarenta años atrás Biddy tenía 18 años, lo que hace que ahora tenga 58.&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://programacionsolida.blogspot.com/feeds/8332483262250332411/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://programacionsolida.blogspot.com/2014/01/esperando-el-fin-de-semana29.html#comment-form' title='5 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/8332483262250332411'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/8332483262250332411'/><link rel='alternate' type='text/html' href='http://programacionsolida.blogspot.com/2014/01/esperando-el-fin-de-semana29.html' title='Esperando el fin de semana'/><author><name>Juan Barrionuevo</name><uri>http://www.blogger.com/profile/07895201334150360791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s72-c/homero-pensando.png" height="72" width="72"/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6542063263487500177.post-2526988138382727950</id><published>2014-01-03T09:00:00.000-03:00</published><updated>2014-01-03T11:43:31.031-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Esperando el fin de semana"/><title type='text'>Esperando el fin de semana</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s1600/homero-pensando.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s1600/homero-pensando.png&quot; height=&quot;200&quot; width=&quot;168&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Primer viernes del 2014. Primer acertijo del 2014. Qué estamos esperando para resolverlo?&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
Biddy era muy sensible con la cuestión de su edad. Durante las dos últimas veintenas de años, respondía a las preguntas acerca de su edad, recitando siempre el siguiente versito:&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;Cinco veces siete y siete veces tres&lt;/li&gt;
&lt;li&gt;Suma a mi edad y obtendrás&lt;/li&gt;
&lt;li&gt;Un número que excede a seis nueves y cuatro&lt;/li&gt;
&lt;li&gt;Tanto como el doble de mi edad pasa de veinte.&lt;/li&gt;
&lt;/ul&gt;
El verso fue acertado la primera vez que Biddy lo recitó, pero, ¿puede usted decirme la edad actual de Biddy?&lt;/blockquote&gt;
Respuesta del &lt;a href=&quot;http://programacionsolida.com.ar/2013/12/esperando-el-fin-de-semana27.html&quot; target=&quot;_blank&quot;&gt;acertijo de la semana pasada&lt;/a&gt;:&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
Hank tenía 11 animales. Jim 7 y Duke 21, lo que da un total de 39 animales.</content><link rel='replies' type='application/atom+xml' href='http://programacionsolida.blogspot.com/feeds/2526988138382727950/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://programacionsolida.blogspot.com/2014/01/esperando-el-fin-de-semana28.html#comment-form' title='6 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/2526988138382727950'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/2526988138382727950'/><link rel='alternate' type='text/html' href='http://programacionsolida.blogspot.com/2014/01/esperando-el-fin-de-semana28.html' title='Esperando el fin de semana'/><author><name>Juan Barrionuevo</name><uri>http://www.blogger.com/profile/07895201334150360791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s72-c/homero-pensando.png" height="72" width="72"/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6542063263487500177.post-1055479970794187777</id><published>2013-12-31T09:00:00.000-03:00</published><updated>2013-12-31T09:36:51.257-03:00</updated><title type='text'>Feliz 2014</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWpsBLQNTk_IhfnzjN3L0-K_rpTGai0vblUa_FwuxVCzEvEARBYR08AOueMJcR-ZsOcsbY0cQ-tWiJAOB_VIiLqsQKaXYtPn10WHbm-Ds605TfR-v1Gq_ECZ6HDsYyH512Dkbo6K5-mAg/s1600/a%25C3%25B1o+nuevo.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWpsBLQNTk_IhfnzjN3L0-K_rpTGai0vblUa_FwuxVCzEvEARBYR08AOueMJcR-ZsOcsbY0cQ-tWiJAOB_VIiLqsQKaXYtPn10WHbm-Ds605TfR-v1Gq_ECZ6HDsYyH512Dkbo6K5-mAg/s1600/a%25C3%25B1o+nuevo.jpg&quot; height=&quot;266&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Un nuevo año finaliza y desde este blog quiero alzar mi copa junto a ustedes y desearles un feliz y próspero año nuevo.</content><link rel='replies' type='application/atom+xml' href='http://programacionsolida.blogspot.com/feeds/1055479970794187777/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://programacionsolida.blogspot.com/2013/12/feliz-2014.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/1055479970794187777'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/1055479970794187777'/><link rel='alternate' type='text/html' href='http://programacionsolida.blogspot.com/2013/12/feliz-2014.html' title='Feliz 2014'/><author><name>Juan Barrionuevo</name><uri>http://www.blogger.com/profile/07895201334150360791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWpsBLQNTk_IhfnzjN3L0-K_rpTGai0vblUa_FwuxVCzEvEARBYR08AOueMJcR-ZsOcsbY0cQ-tWiJAOB_VIiLqsQKaXYtPn10WHbm-Ds605TfR-v1Gq_ECZ6HDsYyH512Dkbo6K5-mAg/s72-c/a%25C3%25B1o+nuevo.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6542063263487500177.post-6373904780193606449</id><published>2013-12-27T09:00:00.000-03:00</published><updated>2013-12-27T09:00:01.936-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Esperando el fin de semana"/><title type='text'>Esperando el fin de semana</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s1600/homero-pensando.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s1600/homero-pensando.png&quot; height=&quot;200&quot; width=&quot;168&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h2&gt;
&lt;b&gt;ULTIMO VIERNES DE AÑO!!!!&lt;/b&gt;&amp;nbsp;&lt;/h2&gt;
No nos lo podemos perder... Un acertijo para despedir el año como se lo merece: estrujando la neurona...&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
Tres vaqueros tejanos se encontraron en la ruta y sostuvieron la siguiente conversación:&lt;br /&gt;&lt;ul&gt;
&lt;li&gt;Hank le dice a Jim: &#39;le doy seis cerdos a cambio de un caballo; así tendrás en tu manada el doble de animales de los que quedarán en la mía&quot;.&lt;/li&gt;
&lt;li&gt;Duke le dice a Hank: &#39;le doy catorce ovejas a cambio de un caballo, así tendrás el triple de animales que yo&quot;.&lt;/li&gt;
&lt;li&gt;Jim le dice a Duke: &quot;Te daré cuatro vacas a cambio de un caballo; así tendrás seis veces más animales que yo&quot;.&lt;/li&gt;
&lt;/ul&gt;
A partir de estos datos, ¿puede usted decirme cuántos animales había en cada una de las tres manadas?&lt;/blockquote&gt;
Respuesta del &lt;a href=&quot;http://programacionsolida.com.ar/2013/12/esperando-el-fin-de-semana26.html&quot; target=&quot;_blank&quot;&gt;acertijo de la semana pasada&lt;/a&gt;:&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;La manera más barata de hacer una cadena con las seis piezas de cinco eslabones es abrir los cinco eslabones de una pieza y después utilizarlos Para unir las cinco piezas restantes. El costo seria de $1,30 lo que resulta 20 centavos más barato que el costo de una cadena nueva.</content><link rel='replies' type='application/atom+xml' href='http://programacionsolida.blogspot.com/feeds/6373904780193606449/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://programacionsolida.blogspot.com/2013/12/esperando-el-fin-de-semana27.html#comment-form' title='2 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/6373904780193606449'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/6373904780193606449'/><link rel='alternate' type='text/html' href='http://programacionsolida.blogspot.com/2013/12/esperando-el-fin-de-semana27.html' title='Esperando el fin de semana'/><author><name>Juan Barrionuevo</name><uri>http://www.blogger.com/profile/07895201334150360791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s72-c/homero-pensando.png" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6542063263487500177.post-1205071104243837573</id><published>2013-12-23T09:00:00.000-03:00</published><updated>2013-12-23T09:00:14.922-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Esperando el fin de semana"/><title type='text'>Esperando el fin de semana</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s1600/homero-pensando.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s1600/homero-pensando.png&quot; height=&quot;200&quot; width=&quot;168&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Ya que el último fin de semana no hubo acertijo (ni el anterior) por falta de gente que se anime a responder (debo buscar mejores incentivos), publicamos uno hoy, para hacer la previa a la navidad...&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
Un granjero tenía seis pedazos de cadena de cinco eslabones cada uno, y deseaba convertirlos en una cadena de treinta eslabones.&lt;br /&gt;
Si cuesta ocho centavos abrir un eslabón y dieciocho centavos volver a soldarlo, y si una cadena nueva cuesta un 1 dólar y medio, preguntamos:&lt;br /&gt;
¿Cuánto dinero se ahorraría gracias al plan más económico?&lt;/blockquote&gt;
Respuesta del &lt;a href=&quot;http://programacionsolida.com.ar/2013/11/esperando-el-fin-de-semana25.html&quot; target=&quot;_blank&quot;&gt;acertijo de la semana pasada&lt;/a&gt;:&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;Cada uno de los profesionales cobra:&lt;br /&gt;
Empapelador $ 200&lt;br /&gt;
Pintor $ 900&lt;br /&gt;
Plomero $ 800&lt;br /&gt;
Electricista $ 300&lt;br /&gt;
Carpintero $3.000&lt;br /&gt;
Albañil $2.300</content><link rel='replies' type='application/atom+xml' href='http://programacionsolida.blogspot.com/feeds/1205071104243837573/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://programacionsolida.blogspot.com/2013/12/esperando-el-fin-de-semana26.html#comment-form' title='7 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/1205071104243837573'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/1205071104243837573'/><link rel='alternate' type='text/html' href='http://programacionsolida.blogspot.com/2013/12/esperando-el-fin-de-semana26.html' title='Esperando el fin de semana'/><author><name>Juan Barrionuevo</name><uri>http://www.blogger.com/profile/07895201334150360791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s72-c/homero-pensando.png" height="72" width="72"/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6542063263487500177.post-8998911059025991784</id><published>2013-11-29T09:00:00.000-03:00</published><updated>2013-11-29T09:00:06.675-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Esperando el fin de semana"/><title type='text'>Esperando el fin de semana</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s1600/homero-pensando.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s1600/homero-pensando.png&quot; height=&quot;200&quot; width=&quot;168&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Tras un lapsus sin acertijos, volvemos nuevamente a la carga!&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
Un contratista abocado a la construcción de una casa descubrió que debía pagar:&lt;br /&gt;&amp;nbsp; &amp;nbsp; $ 1.100 al empapelador y al pintor,&lt;br /&gt;&amp;nbsp; &amp;nbsp; $ 1.700 al pintor y al plomero,&lt;br /&gt;&amp;nbsp; &amp;nbsp; $ 1.100 al plomero y al electricista,&lt;br /&gt;&amp;nbsp; &amp;nbsp; $ 3.300 al electricista y al carpintero,&lt;br /&gt;&amp;nbsp; &amp;nbsp; $ 5.300 al carpintero y al albañil,&lt;br /&gt;&amp;nbsp; &amp;nbsp; $ 2.500 al albañil y al empapelador.&lt;br /&gt;¿Cuánto cobra por sus servicios cada uno de ellos?&lt;/blockquote&gt;
Respuesta del &lt;a href=&quot;http://programacionsolida.com.ar/2013/11/esperando-el-fin-de-semana24.html&quot; target=&quot;_blank&quot;&gt;acertijo del 8 de noviembre&lt;/a&gt;:&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;Como el avaro podía dividir cada tipo de moneda de manera pareja en cuatro, cinco y seis partes, debe haber tenido por lo menos sesenta monedas de cada clase, haciendo un total de $ 2.100.</content><link rel='replies' type='application/atom+xml' href='http://programacionsolida.blogspot.com/feeds/8998911059025991784/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://programacionsolida.blogspot.com/2013/11/esperando-el-fin-de-semana25.html#comment-form' title='5 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/8998911059025991784'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/8998911059025991784'/><link rel='alternate' type='text/html' href='http://programacionsolida.blogspot.com/2013/11/esperando-el-fin-de-semana25.html' title='Esperando el fin de semana'/><author><name>Juan Barrionuevo</name><uri>http://www.blogger.com/profile/07895201334150360791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s72-c/homero-pensando.png" height="72" width="72"/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6542063263487500177.post-5036728330455396596</id><published>2013-11-08T09:00:00.000-03:00</published><updated>2013-11-08T09:35:27.167-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Esperando el fin de semana"/><title type='text'>Esperando el fin de semana</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s1600/homero-pensando.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s1600/homero-pensando.png&quot; height=&quot;200&quot; width=&quot;168&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Otro viernes gris en Buenos Aires. A ponerle garra y levantarlo resolviendo el acertijo de hoy!!!!&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
Un avaro, antes de morirse de hambre, acumuló una cantidad de monedas de oro de cinco, diez y veinte dólares. Las guardaba en cinco bolsas que eran exactamente iguales en cuanto a que todas contenían la misma cantidad de monedas de cinco dólares, el mismo número de&lt;br /&gt;monedas de diez dólares y el mismo número de monedas de veinte dólares.&lt;br /&gt;El avaro contaba su tesoro poniendo todas las monedas sobre la mesa y dividiéndolas luego en cuatro pilas que también contenían la misma cantidad de cada tipo de monedas. Su último paso era tomar dos cualesquiera de estas pilas, reunir las monedas y distribuidas luego en tres pilas que eran exactamente iguales en el sentido ya explicado.&lt;br /&gt;¿Cuál es la menor cantidad de dinero que debe haber poseído este pobre anciano?&lt;/blockquote&gt;
Respuesta del &lt;a href=&quot;http://programacionsolida.com.ar/2013/11/esperando-el-fin-de-semana23.html&quot; target=&quot;_blank&quot;&gt;acertijo de la semana pasada&lt;/a&gt;:&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;Los siete fósforos se disponen de modo de formar las letras de la palabra mil, y los cinco se disponen para formar un uno y un cero (10).</content><link rel='replies' type='application/atom+xml' href='http://programacionsolida.blogspot.com/feeds/5036728330455396596/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://programacionsolida.blogspot.com/2013/11/esperando-el-fin-de-semana24.html#comment-form' title='2 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/5036728330455396596'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/5036728330455396596'/><link rel='alternate' type='text/html' href='http://programacionsolida.blogspot.com/2013/11/esperando-el-fin-de-semana24.html' title='Esperando el fin de semana'/><author><name>Juan Barrionuevo</name><uri>http://www.blogger.com/profile/07895201334150360791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s72-c/homero-pensando.png" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6542063263487500177.post-6161507838047713133</id><published>2013-11-01T09:00:00.000-03:00</published><updated>2013-11-01T09:02:45.497-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Esperando el fin de semana"/><title type='text'>Esperando el fin de semana</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s1600/homero-pensando.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s1600/homero-pensando.png&quot; height=&quot;200&quot; width=&quot;168&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Llueve en Buenos Aires y aledaños, pero no nos va a amargar el día. Es viernes y el fin de semana está sólo a un paso!!! Levanta este día gris resolviendo el acertijo de hoy.&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
Harry ha dado a su hermana siete fósforos, desafiándola a que los disponga de manera que parezcan mil. Ella, a su vez, le ha dado a él cinco fósforos, instándolo a que los disponga de tal manera que parezcan diez.&lt;/blockquote&gt;
Respuesta del &lt;a href=&quot;http://programacionsolida.com.ar/2013/10/esperando-el-fin-de-semana22.html&quot; target=&quot;_blank&quot;&gt;acertijo de la semana pasada&lt;/a&gt;: &lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;Mary tiene 27 años y 6 meses.</content><link rel='replies' type='application/atom+xml' href='http://programacionsolida.blogspot.com/feeds/6161507838047713133/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://programacionsolida.blogspot.com/2013/11/esperando-el-fin-de-semana23.html#comment-form' title='4 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/6161507838047713133'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/6161507838047713133'/><link rel='alternate' type='text/html' href='http://programacionsolida.blogspot.com/2013/11/esperando-el-fin-de-semana23.html' title='Esperando el fin de semana'/><author><name>Juan Barrionuevo</name><uri>http://www.blogger.com/profile/07895201334150360791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s72-c/homero-pensando.png" height="72" width="72"/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6542063263487500177.post-886384877976661915</id><published>2013-10-25T09:00:00.000-03:00</published><updated>2013-10-25T09:00:03.803-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Esperando el fin de semana"/><title type='text'>Esperando el fin de semana</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s1600/homero-pensando.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s1600/homero-pensando.png&quot; height=&quot;200&quot; width=&quot;168&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Un nuevo viernes llegó y un nuevo acertijo llegó con él. Lo puedes resolver?&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&quot;Ya ves&quot; - comentó el abuelo- &quot;las edades de Ann y Mary suman cuarenta y cuatro años, y Mary tiene el doble de la edad que tenía Ann cuando Mary tenía la mitad de la edad que Ann tendrá cuando Ann tenga tres veces la edad que Mary tenía cuando su edad era tres veces la de Ann.&quot;&lt;br /&gt;¿Cuántos años tiene Mary?&lt;/blockquote&gt;
Solución &lt;a href=&quot;http://programacionsolida.com.ar/2013/10/esperando-el-fin-de-semana21.html&quot; target=&quot;_blank&quot;&gt;del acertijo de la semana pasada&lt;/a&gt;:&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt; Los cuatro hombres llevaban al quinto en un ataúd. por este motivo éste no se había mojado.</content><link rel='replies' type='application/atom+xml' href='http://programacionsolida.blogspot.com/feeds/886384877976661915/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://programacionsolida.blogspot.com/2013/10/esperando-el-fin-de-semana22.html#comment-form' title='4 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/886384877976661915'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/886384877976661915'/><link rel='alternate' type='text/html' href='http://programacionsolida.blogspot.com/2013/10/esperando-el-fin-de-semana22.html' title='Esperando el fin de semana'/><author><name>Juan Barrionuevo</name><uri>http://www.blogger.com/profile/07895201334150360791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s72-c/homero-pensando.png" height="72" width="72"/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6542063263487500177.post-7088735922267243360</id><published>2013-10-18T09:00:00.000-03:00</published><updated>2013-10-18T12:33:34.929-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Esperando el fin de semana"/><title type='text'>Esperando el fin de semana</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s1600/homero-pensando.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s1600/homero-pensando.png&quot; height=&quot;200&quot; width=&quot;168&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Semana corta en Argentina, pero no por eso el viernes pierde su natural alegría. Vamos con nuestro acertijo semanal!!!&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
Cinco hombres iba juntos por un camino en el campo. Comienza a llover. Cuatro de los hombres apuran el paso.&lt;br /&gt;El quinto no hace ningún esfuerzo por darse prisa. Sin embargo, se mantiene seco mientras que los otros cuatro se mojan.&lt;br /&gt;Los cinco llegan a su destino juntos. NOTA: Para trasladarse sólo contaban con los pies y ninguno llevaba paraguas o similar.&lt;br /&gt;¿Cómo pudo ser?&lt;/blockquote&gt;
Respuesta del &lt;a href=&quot;http://programacionsolida.com.ar/2013/10/esperando-el-fin-de-semana-bis.html&quot; target=&quot;_blank&quot;&gt;acertijo bis de la semana pasada&lt;/a&gt;:&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;Los niños Jones vendieron 220 periódicos más que los niños Smith.</content><link rel='replies' type='application/atom+xml' href='http://programacionsolida.blogspot.com/feeds/7088735922267243360/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://programacionsolida.blogspot.com/2013/10/esperando-el-fin-de-semana21.html#comment-form' title='7 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/7088735922267243360'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/7088735922267243360'/><link rel='alternate' type='text/html' href='http://programacionsolida.blogspot.com/2013/10/esperando-el-fin-de-semana21.html' title='Esperando el fin de semana'/><author><name>Juan Barrionuevo</name><uri>http://www.blogger.com/profile/07895201334150360791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s72-c/homero-pensando.png" height="72" width="72"/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6542063263487500177.post-461295544477072949</id><published>2013-10-16T09:00:00.000-03:00</published><updated>2013-10-16T09:00:08.612-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="MVC"/><category scheme="http://www.blogger.com/atom/ns#" term="The field X must be a date"/><title type='text'>MVC, Datetime y la localización regional</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEcHXBOv1xtZGZ5_Ef_DAlTdE8tKE4U3QOmQbXTs77l8ma5HPj44rqwhHJEy1UDB4XRNg-oyWvHhYjUJ2DUag6MpwwcofglRTqGZGB0NXdwMpEKCY5EAhB5Bs4DSdmPV3oDvCR2oVZ5FQ/s1600/MVC%255B1%255D.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEcHXBOv1xtZGZ5_Ef_DAlTdE8tKE4U3QOmQbXTs77l8ma5HPj44rqwhHJEy1UDB4XRNg-oyWvHhYjUJ2DUag6MpwwcofglRTqGZGB0NXdwMpEKCY5EAhB5Bs4DSdmPV3oDvCR2oVZ5FQ/s1600/MVC%255B1%255D.png&quot; height=&quot;173&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Descubrí hace poco que existe un tema muy frecuente y poco esperable por parte de MVC y las localizaciones. Para los que manejamos las fechas con un formato diferente del de Estados Unidos, nos suele aparecer el error &quot;The field [date] has format invalid&quot; cuando ingresamos un día del mes superior a 12 y se desea .&lt;br /&gt;
Esto se debe a un problema del model binder que tiene por defecto MVC y se debe reemplazar por uno personalizado para que se pueda tener en cuenta el formato de la hora correspondiente.&lt;br /&gt;
Veamos un ejemplo que he probado y funciona. Incluso hace uso del atributo [DisplayFormat] para poder utilizar el formato de fecha que más nos convenga.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h4&gt;
Model:&lt;/h4&gt;
&lt;pre class=&quot;lang-cs prettyprint&quot;&gt;&lt;code&gt;public class MyViewModel
{
&amp;nbsp; &amp;nbsp; [DisplayName(&quot;date of birth&quot;)]
&amp;nbsp; &amp;nbsp; [DataType(DataType.Date)]
&amp;nbsp; &amp;nbsp; [DisplayFormat(DataFormatString = &quot;{0:dd/MM/yyyy}&quot;, ApplyFormatInEditMode = true)]
&amp;nbsp; &amp;nbsp; public DateTime? Birth { get; set; }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;h4&gt;
Controller:&lt;/h4&gt;
&lt;pre class=&quot;lang-cs prettyprint&quot;&gt;&lt;code&gt;public class HomeController : Controller
{
&amp;nbsp; &amp;nbsp; public ActionResult Index()
&amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return View(new MyViewModel
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Birth = DateTime.Now
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; });
&amp;nbsp; &amp;nbsp; }

&amp;nbsp; &amp;nbsp; [HttpPost]
&amp;nbsp; &amp;nbsp; public ActionResult Index(MyViewModel model)
&amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return View(model);
&amp;nbsp; &amp;nbsp; }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;h4&gt;
View:&lt;/h4&gt;
&lt;pre class=&quot;lang-cs prettyprint&quot;&gt;&lt;code&gt;@model MyViewModel

@using (Html.BeginForm())
{
&amp;nbsp; &amp;nbsp; @Html.LabelFor(x =&amp;gt; x.Birth)
&amp;nbsp; &amp;nbsp; @Html.EditorFor(x =&amp;gt; x.Birth)
&amp;nbsp; &amp;nbsp; @Html.ValidationMessageFor(x =&amp;gt; x.Birth)
&amp;nbsp; &amp;nbsp; &amp;lt;button type=&quot;submit&quot;&amp;gt;OK&amp;lt;/button&amp;gt;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;h4&gt;
Model Binder personalizado:&lt;/h4&gt;
Hasta aquí sólo hemos hecho lo de costumbre en MVC. Para poder resolver nuestro problema, deberemos escribir nuestro propio Model Binder y así reemplazar el que utiliza MVC por defecto.&lt;br /&gt;
&lt;pre class=&quot;lang-cs prettyprint&quot;&gt;&lt;code&gt;public class MyDateTimeModelBinder : DefaultModelBinder
{
&amp;nbsp; &amp;nbsp; public override object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
&amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var displayFormat = bindingContext.ModelMetadata.DisplayFormatString;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var value = bindingContext.ValueProvider.GetValue(bindingContext.ModelName);

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (!string.IsNullOrEmpty(displayFormat) &amp;amp;&amp;amp; value != null)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DateTime date;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; displayFormat = displayFormat.Replace(&quot;{0:&quot;, string.Empty).Replace(&quot;}&quot;, string.Empty);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // use the format specified in the DisplayFormat attribute to parse the date
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (DateTime.TryParseExact(value.AttemptedValue, displayFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out date))
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return date;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; bindingContext.ModelState.AddModelError(
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; bindingContext.ModelName,
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string.Format(&quot;{0} is an invalid date format&quot;, value.AttemptedValue)
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; );
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return base.BindModel(controllerContext, bindingContext);
&amp;nbsp; &amp;nbsp; }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;h4&gt;
Registración del Model Binder:&lt;/h4&gt;
Para que MVC utilice nuestro Model Binder, debemos registrarlo. Para ello, agregaremos la siguiente línea en el método Application_Start.&lt;br /&gt;
&lt;pre class=&quot;lang-cs prettyprint&quot;&gt;&lt;code&gt;ModelBinders.Binders.Add(typeof(DateTime?), new MyDateTimeModelBinder());&lt;/code&gt;&lt;/pre&gt;
Ya no importa la cultura en la que se encuentre el servidor o el cliente, se utilizará el formato especificado en el atributo DisplayFormat para parsear la fecha.&lt;br /&gt;
La solución hasta aquí propuesta fue hallada en &lt;a href=&quot;http://stackoverflow.com/questions/11272851/format-datetime-in-asp-net-mvc-4&quot; target=&quot;_blank&quot;&gt;StackOverflow&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
Bonus:&lt;/h4&gt;
Hasta aquí, esta solución resuelve el problema para los navegadores: Firefox, Opera e Internet Explorer. Pero persiste para Chrome y Safari, ya que estos no usan la localización regional para instanciar el objeto Datetime de jQuery, lo que ocasiona el mismo error pero del lado del cliente.&lt;br /&gt;
Para solucionar este último escollo, también es necesario modificar el archivo jQuery.validate.js.&lt;br /&gt;
La función debe quedar así:&lt;br /&gt;
&lt;pre class=&quot;lang-cs prettyprint&quot;&gt;&lt;code&gt;// http://docs.jquery.com/Plugins/Validation/Methods/date
date: function(value, element) {
&amp;nbsp; &amp;nbsp;return this.optional(element) || !/Invalid|NaN/.test(new Date($.browser.webkit ? d[1] + &quot;/&quot; + d[0] + &quot;/&quot; + d[2] : value));
},
&lt;/code&gt;&lt;/pre&gt;
Y no se debe olvidar modificar el archivo minificado tabién (jQuery.validate.min.js):&lt;br /&gt;
&lt;pre class=&quot;lang-cs prettyprint&quot;&gt;&lt;code&gt;date:function(a,b){return this.optional(b)||!/Invalid|NaN/.test(new Date($.browser.webkit?d[1]+&quot;/&quot;+d[0]+&quot;/&quot;+d[2]:a))}
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://programacionsolida.blogspot.com/feeds/461295544477072949/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://programacionsolida.blogspot.com/2013/10/mvc-datetime-y-la-localizacion-regional.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/461295544477072949'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/461295544477072949'/><link rel='alternate' type='text/html' href='http://programacionsolida.blogspot.com/2013/10/mvc-datetime-y-la-localizacion-regional.html' title='MVC, Datetime y la localización regional'/><author><name>Juan Barrionuevo</name><uri>http://www.blogger.com/profile/07895201334150360791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEcHXBOv1xtZGZ5_Ef_DAlTdE8tKE4U3QOmQbXTs77l8ma5HPj44rqwhHJEy1UDB4XRNg-oyWvHhYjUJ2DUag6MpwwcofglRTqGZGB0NXdwMpEKCY5EAhB5Bs4DSdmPV3oDvCR2oVZ5FQ/s72-c/MVC%255B1%255D.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6542063263487500177.post-1134405112452610938</id><published>2013-10-11T12:00:00.000-03:00</published><updated>2013-10-11T12:00:00.603-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Abstract Factory"/><category scheme="http://www.blogger.com/atom/ns#" term="Esperando el fin de semana"/><title type='text'>Esperando el fin de semana (bis)</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s1600/homero-pensando.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s1600/homero-pensando.png&quot; height=&quot;200&quot; width=&quot;168&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Viendo que el acertijo de hoy ha sido resuelto tan pronto y a pedido del público, hoy hay bis!!!!&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
Cinco jóvenes y listos diarieros se asociaron e hicieron lo siguiente: Tom Smith vendió un periódico más que un cuarto del total, Billy Jones vendió un periódico más que un cuarto de lo que quedaba, Ned Smith vendió uno más que uno más que un cuarto del resto, y Charley Jones vendió la cuarta parte del sobrante, más uno. En este punto, los chicos Smith, juntos, habían vendido cien periódicos más que los chicos Jones, en conjunto. El pequeño Jimmy Jones, el más joven del grupo, vendió entonces los periódicos que aún quedaban.&lt;br /&gt;Los tres chicos Jones vendieron más periódicos que los dos chicos Smith, pero ¿cuántos más?&lt;/blockquote&gt;
Respuesta &lt;a href=&quot;http://programacionsolida.com.ar/2013/10/esperando-el-fin-de-semana20.html&quot; target=&quot;_blank&quot;&gt;del acertijo anterior&lt;/a&gt;: &lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;El pendiente cayó sobre una taza de café... en grano.</content><link rel='replies' type='application/atom+xml' href='http://programacionsolida.blogspot.com/feeds/1134405112452610938/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://programacionsolida.blogspot.com/2013/10/esperando-el-fin-de-semana-bis.html#comment-form' title='6 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/1134405112452610938'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/1134405112452610938'/><link rel='alternate' type='text/html' href='http://programacionsolida.blogspot.com/2013/10/esperando-el-fin-de-semana-bis.html' title='Esperando el fin de semana (bis)'/><author><name>Juan Barrionuevo</name><uri>http://www.blogger.com/profile/07895201334150360791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s72-c/homero-pensando.png" height="72" width="72"/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6542063263487500177.post-5184598104990149297</id><published>2013-10-11T09:00:00.000-03:00</published><updated>2013-10-11T09:00:09.605-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Esperando el fin de semana"/><title type='text'>Esperando el fin de semana</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s1600/homero-pensando.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s1600/homero-pensando.png&quot; height=&quot;200&quot; width=&quot;168&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Vamos que ya es viernes!!! Solo un rato más y el fin de semana se hará presente. Usa este acertijo para pasar el tiempo. Anímense a dejar un comentario con la respuesta y firmen su comentario, no sean tímidos :)&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
Esta mañana a Mariana se le cayó un pendiente en el café. Y aunque la taza estaba llena, el pendiente no se mojó. ¿Cómo fue eso posible?&lt;/blockquote&gt;
Respuesta &lt;a href=&quot;http://programacionsolida.com.ar/2013/10/esperando-el-fin-de-semana19.html&quot; target=&quot;_blank&quot;&gt;del acertijo de la semana pasada&lt;/a&gt;: &lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;Se trataba de un muchacho con su padre y su abuelo paterno.</content><link rel='replies' type='application/atom+xml' href='http://programacionsolida.blogspot.com/feeds/5184598104990149297/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://programacionsolida.blogspot.com/2013/10/esperando-el-fin-de-semana20.html#comment-form' title='4 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/5184598104990149297'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/5184598104990149297'/><link rel='alternate' type='text/html' href='http://programacionsolida.blogspot.com/2013/10/esperando-el-fin-de-semana20.html' title='Esperando el fin de semana'/><author><name>Juan Barrionuevo</name><uri>http://www.blogger.com/profile/07895201334150360791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s72-c/homero-pensando.png" height="72" width="72"/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6542063263487500177.post-9061871721499817092</id><published>2013-10-04T09:00:00.000-03:00</published><updated>2013-10-04T09:26:42.300-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Esperando el fin de semana"/><title type='text'>Esperando el fin de semana</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s1600/homero-pensando.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s200/homero-pensando.png&quot; width=&quot;168&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Tras un lapsus, volvemos con todo. Un acertijo corto y simple para esperar este nuevo fin de semana!!!&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
Dos padres y dos hijos fueron a pescar, tres peces pescaron y a cada uno le tocó un pez.&lt;br /&gt;¿Cómo pudo ser?&lt;/blockquote&gt;
Respuesta &lt;a href=&quot;http://programacionsolida.com.ar/2013/09/esperando-el-fin-de-semana18.html&quot; target=&quot;_blank&quot;&gt;del acertijo de la semana pasada&lt;/a&gt;:&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
Cuando a José le tocó pasar delante de la caja de las bolas, metió la mano y tomó una de las bolas y, sin mostrarla a nadie, se la metió en la boca y se la tragó. Inmediatamente – tan pronto pudo respirar bien – dijo: “yo he sacado la bola blanca, pues solo quedan en la caja las nueve bolas negras”. Todos miraron dentro de la caja. Era verdad. El alcalde no pudo negarse a dejarlo libre. O bien, el preso José pasa al final de los que van a sacar la bola, no la saca y dice “salieron ya las 9 bolas negras, la sobrante es la blanca”, (no se plantea que cada bola que sacan se regrese a la caja)</content><link rel='replies' type='application/atom+xml' href='http://programacionsolida.blogspot.com/feeds/9061871721499817092/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://programacionsolida.blogspot.com/2013/10/esperando-el-fin-de-semana19.html#comment-form' title='2 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/9061871721499817092'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/9061871721499817092'/><link rel='alternate' type='text/html' href='http://programacionsolida.blogspot.com/2013/10/esperando-el-fin-de-semana19.html' title='Esperando el fin de semana'/><author><name>Juan Barrionuevo</name><uri>http://www.blogger.com/profile/07895201334150360791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s72-c/homero-pensando.png" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6542063263487500177.post-1997891814771212877</id><published>2013-09-25T09:00:00.000-03:00</published><updated>2013-09-25T09:00:08.815-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="MVC"/><category scheme="http://www.blogger.com/atom/ns#" term="Parrot"/><category scheme="http://www.blogger.com/atom/ns#" term="Razor"/><category scheme="http://www.blogger.com/atom/ns#" term="view engine"/><title type='text'>Parrot, view-engine que facilita la lectura de HTML para MVC</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEcHXBOv1xtZGZ5_Ef_DAlTdE8tKE4U3QOmQbXTs77l8ma5HPj44rqwhHJEy1UDB4XRNg-oyWvHhYjUJ2DUag6MpwwcofglRTqGZGB0NXdwMpEKCY5EAhB5Bs4DSdmPV3oDvCR2oVZ5FQ/s1600/MVC%255B1%255D.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;173&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEcHXBOv1xtZGZ5_Ef_DAlTdE8tKE4U3QOmQbXTs77l8ma5HPj44rqwhHJEy1UDB4XRNg-oyWvHhYjUJ2DUag6MpwwcofglRTqGZGB0NXdwMpEKCY5EAhB5Bs4DSdmPV3oDvCR2oVZ5FQ/s200/MVC%255B1%255D.png&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Cuando Microsoft decidió mejorar el código escrito en las vista para MVC, fue con la intención de agilizar la escritura de dicho código, pero también para que fuera fácil de escribir.&lt;br /&gt;
Lamentablemente, optaron por dejar los tag de HTML tal y como estaban. No está en mí criticar esta decisión, pero aunque razor ha ayudado a hacer más legible el código, cuando se posee una página algo compleja, los tags de HTML pueden llegar a dejar las vistas algo incómodas de leer (Sí, lo sé, también existen las partial view).&lt;br /&gt;
En ayuda a esto, surge una librería llamada &lt;a href=&quot;http://thisisparrot.com/&quot; target=&quot;_blank&quot;&gt;Parrot&lt;/a&gt; que se define a sí misma como un view-engine o motor de vistas.&lt;br /&gt;
Es una librería relativamente joven y aunque no cubren el 100% de los casos, tienen una gran cantidad cubierta. La última versión, la 1.0.3, salió en julio de 2013 y prometen seguir haciéndola crecer.&lt;br /&gt;
Esta herramienta nos permite ahorrar bastante &quot;código&quot; HTML al momento de escribir las vistas ya que con una muy simple sintaxis, este motor nos renderiza todo lo necesario para agregar los tags y atributos deseados. Pero vayamos a los ejemplos que va a resultar más claro que toda mi palabrería.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
Con razor hoy escribiriamos un código más o menos similar al siguiente para llenar una lista con un modelo de tipo List&amp;lt;&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint lang-html&quot; id=&quot;codigo-ejemplo&quot;&gt;&lt;code&gt;&amp;lt;ul id=&quot;ListOfPeople&quot;&amp;gt;
&amp;nbsp; &amp;nbsp; @foreach (Models.Person p in Model)
&amp;nbsp; &amp;nbsp; {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;li&amp;gt;@p.Name - @p.Phone&amp;lt;/li&amp;gt;
&amp;nbsp; &amp;nbsp; }
&amp;lt;/ul&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
Con esta librería sólo tendríamos que escribir una línea de código:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint lang-html&quot; id=&quot;codigo-ejemplo&quot;&gt;&lt;code&gt;ul#ListOfPeople(Model) &amp;gt; li | @Name - @Phone
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
Usa una sintaxis muy simple, parecida a jQuery o CSS. Con la línea anterior dice que tiene que poner un tag ul, cuyo id va a ser ListOfPeople, que dentro debe poner un tag li y usar como texto (lo que viene luego del pipe) @Name - @Phone. Con esa sola línea resuelve lo que normalmente escribiríamos en 6.&lt;br /&gt;
Este es el resultado que se obtiene una vez renderizado en el browser (en cualquiera de ambos casos):&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint lang-html&quot; id=&quot;codigo-ejemplo&quot;&gt;&lt;code&gt;&amp;lt;ul id=&quot;”ListOfPeople”&quot;&amp;gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;li&amp;gt;John Smith – 555-1234&amp;lt;/li&amp;gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;li&amp;gt;Mary Smith – 555-1236&amp;lt;/li&amp;gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;li&amp;gt;Steve Smith – 555-1236&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
Un ejemplo mucho más simple, es ver cómo se renderizan tags simples:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint lang-html&quot; id=&quot;codigo-ejemplo&quot;&gt;&lt;code&gt;ul
p
div
span
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
Parrot tiene también la capacidad de detectar de qué manera puede cerrar los tags de HTML para hacer más liviana la página. Teniendo en cuenta el ejemplo anterior, su renderizado, sería el siguiente:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint lang-html&quot; id=&quot;codigo-ejemplo&quot;&gt;&lt;code&gt;&amp;lt;ul&amp;gt;&amp;lt;/ul&amp;gt;
&amp;lt;p /&amp;gt;
&amp;lt;div /&amp;gt;
&amp;lt;span /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
Aquí sólo les presento dos ejemplos de cómo Parrot permite ahorrar mucho espacio en las vistas y cómo éstas se hacen más legibles para el desarrollador.&lt;br /&gt;
Esta librería puede encontrarse entre los &lt;a href=&quot;http://www.nuget.org/packages/Parrot.AspNet/&quot; target=&quot;_blank&quot;&gt;paquetes de NuGet&lt;/a&gt; por lo que resulta aun más fácil su implementación y además cuenta con un &lt;a href=&quot;http://testdrive.thisisparrot.com/&quot; target=&quot;_blank&quot;&gt;sitio para probar el renderizado de código de prueba&lt;/a&gt;.&lt;br /&gt;
Los invito a visitar su &lt;a href=&quot;http://thisisparrot.com/&quot; target=&quot;_blank&quot;&gt;sitio oficial&lt;/a&gt; y su &lt;a href=&quot;http://testdrive.thisisparrot.com/&quot; target=&quot;_blank&quot;&gt;sitio de pruebas&lt;/a&gt; para que saquen sus propias conclusiones.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: right;&quot;&gt;
Nota publicada en el &lt;a href=&quot;http://blog.triadasoftware.com.ar/?p=6&quot; target=&quot;_blank&quot;&gt;blog de Triada Software&lt;/a&gt;.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://programacionsolida.blogspot.com/feeds/1997891814771212877/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://programacionsolida.blogspot.com/2013/09/parrot-view-engine.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/1997891814771212877'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/1997891814771212877'/><link rel='alternate' type='text/html' href='http://programacionsolida.blogspot.com/2013/09/parrot-view-engine.html' title='Parrot, view-engine que facilita la lectura de HTML para MVC'/><author><name>Juan Barrionuevo</name><uri>http://www.blogger.com/profile/07895201334150360791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEcHXBOv1xtZGZ5_Ef_DAlTdE8tKE4U3QOmQbXTs77l8ma5HPj44rqwhHJEy1UDB4XRNg-oyWvHhYjUJ2DUag6MpwwcofglRTqGZGB0NXdwMpEKCY5EAhB5Bs4DSdmPV3oDvCR2oVZ5FQ/s72-c/MVC%255B1%255D.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6542063263487500177.post-8813170047611637843</id><published>2013-09-20T09:00:00.000-03:00</published><updated>2013-09-20T10:42:58.290-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Esperando el fin de semana"/><title type='text'>Esperando el fin de semana</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s1600/homero-pensando.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s200/homero-pensando.png&quot; width=&quot;168&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Viernes previo a la llegada de la primavera (al menos para los del hemisferio sur) y lo arrancamos a toda máquina con un nuevo acertijo.&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
El alcalde de una prisión ofrece la libertad inmediata a uno de los diez presos que mantiene entre rejas, elegido al azar. Para ello, prepara una caja con diez bolas: 9 negras y una 1 blanca y les dice que aquel que extraiga la bola blanca será el preso que quede libre. Pero el alcalde, mala persona, coloca, sin que nadie lo sepa, las diez bolas negras, para &amp;nbsp;asegurarse que ninguno de sus 10 presos va a quedar en libertad. El preso José, que tiene fama de listo, se enteró casualmente de la trampa que iba a hacer el alcalde e ideó una estrategia que le dio la libertad. ¿Cómo lo hizo José?.&lt;/blockquote&gt;
Respuesta &lt;a href=&quot;http://programacionsolida.com.ar/2013/09/esperando-el-fin-de-seamana17.html&quot; target=&quot;_blank&quot;&gt;del acertijo de la semana pasada&lt;/a&gt;:&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;Porque era de día.</content><link rel='replies' type='application/atom+xml' href='http://programacionsolida.blogspot.com/feeds/8813170047611637843/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://programacionsolida.blogspot.com/2013/09/esperando-el-fin-de-semana18.html#comment-form' title='2 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/8813170047611637843'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/8813170047611637843'/><link rel='alternate' type='text/html' href='http://programacionsolida.blogspot.com/2013/09/esperando-el-fin-de-semana18.html' title='Esperando el fin de semana'/><author><name>Juan Barrionuevo</name><uri>http://www.blogger.com/profile/07895201334150360791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s72-c/homero-pensando.png" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6542063263487500177.post-7526760444195014869</id><published>2013-09-13T09:00:00.000-03:00</published><updated>2013-09-13T16:18:31.623-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Esperando el fin de semana"/><title type='text'>Esperando el fin de seamana</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s1600/homero-pensando.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s200/homero-pensando.png&quot; width=&quot;168&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
VIERNES!!!!!!!!!!! Ya llega el fin de semana y además, nuestro acertijo :)&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
El martes, Juan consiguió apagar la luz de su dormitorio y meterse en la cama antes de que la habitación quedase a oscuras. Hay tres metros desde la cama al interruptor de la luz. ¿Cómo pudo hacerlo?&lt;/blockquote&gt;
Respuesta &lt;a href=&quot;http://programacionsolida.com.ar/2013/09/esperando-el-fin-de-semana16.html&quot; target=&quot;_blank&quot;&gt;del acertijo de la semana pasada&lt;/a&gt;:&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;El hombre había saltado desde un avión pero su paracaídas no logró abrirse. Este era el paquete sin abrir.</content><link rel='replies' type='application/atom+xml' href='http://programacionsolida.blogspot.com/feeds/7526760444195014869/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://programacionsolida.blogspot.com/2013/09/esperando-el-fin-de-seamana17.html#comment-form' title='2 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/7526760444195014869'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/7526760444195014869'/><link rel='alternate' type='text/html' href='http://programacionsolida.blogspot.com/2013/09/esperando-el-fin-de-seamana17.html' title='Esperando el fin de seamana'/><author><name>Juan Barrionuevo</name><uri>http://www.blogger.com/profile/07895201334150360791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s72-c/homero-pensando.png" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6542063263487500177.post-7722240327872341161</id><published>2013-09-06T09:00:00.000-03:00</published><updated>2013-09-06T14:37:58.674-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Esperando el fin de semana"/><title type='text'>Esperando el fin de semana</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s1600/homero-pensando.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s200/homero-pensando.png&quot; width=&quot;168&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Un nuevo viernes, un nuevo mes y&amp;nbsp;un nuevo acertijo... A RESOLVERLO!&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
Un hombre yace muerto en un campo. A su lado hay un paquete sin abrir. No hay nadie más en el campo. ¿Como murió?&lt;br /&gt;Ayuda: Mientras se acercaba el hombre al lugar donde se le encontró muerto, sabía que irremediablemente moriría.&lt;/blockquote&gt;
Respuesta del &lt;a href=&quot;http://programacionsolida.com.ar/2013/08/esperando-el-fin-de-semana15.html&quot; target=&quot;_blank&quot;&gt;acertijo de la semana pasada&lt;/a&gt;:&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;La botella estaba vacía.&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://programacionsolida.blogspot.com/feeds/7722240327872341161/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://programacionsolida.blogspot.com/2013/09/esperando-el-fin-de-semana16.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/7722240327872341161'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/7722240327872341161'/><link rel='alternate' type='text/html' href='http://programacionsolida.blogspot.com/2013/09/esperando-el-fin-de-semana16.html' title='Esperando el fin de semana'/><author><name>Juan Barrionuevo</name><uri>http://www.blogger.com/profile/07895201334150360791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s72-c/homero-pensando.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6542063263487500177.post-5813251160143967752</id><published>2013-08-28T09:00:00.000-03:00</published><updated>2013-08-28T09:00:14.849-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Esperando el fin de semana"/><title type='text'>Esperando el fin de semana</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s1600/homero-pensando.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s200/homero-pensando.png&quot; width=&quot;168&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Llegó el fin de semana y junto con él, el final del mes. Despidamos la semana como se lo merece, sacándole punta al ingenio!&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
En el centro de una mesa, sobre un mantel de 30 cm de diámetro, hay una botella de vino abierta. ¿Cómo quitar el mantel sin derramar el vino y sin tocarla con ningún otro objeto ni con alguna parte del cuerpo?&lt;/blockquote&gt;
Respuesta del &lt;a href=&quot;http://programacionsolida.com.ar/2013/08/esperando-el-fin-de-semana14.html&quot; target=&quot;_blank&quot;&gt;acertijo de la semana pasada&lt;/a&gt;:&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;El reo dice: “Me van a matar en la silla eléctrica”. Y piensan los verdugos: si es verdad lo que ha dicho, no podemos matarlo en la silla eléctrica, ya que ésta forma de ejecución habíamos quedado en reservarla para el caso de que mintiera. Pero, por otra parte, si lo matamos en la horca, habrá mentido en su afirmación, así que tampoco podemos matarlo en la horca porque esta forma de matarlo la íbamos a utilizar si decía la verdad.</content><link rel='replies' type='application/atom+xml' href='http://programacionsolida.blogspot.com/feeds/5813251160143967752/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://programacionsolida.blogspot.com/2013/08/esperando-el-fin-de-semana15.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/5813251160143967752'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6542063263487500177/posts/default/5813251160143967752'/><link rel='alternate' type='text/html' href='http://programacionsolida.blogspot.com/2013/08/esperando-el-fin-de-semana15.html' title='Esperando el fin de semana'/><author><name>Juan Barrionuevo</name><uri>http://www.blogger.com/profile/07895201334150360791</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2tKqJT5i77YtqSX5Hw3Q2Mj-6UcqwRVH1Q5mBlfshBRl9vrpsdzww-xbgTGqaRIsqzc9UykeBxAk0fujHQKHn_UrZELxaPbPGEhCkZQovjx1RSPY1KfPT0D5s5_bg5UxfQO04k47LYo0/s72-c/homero-pensando.png" height="72" width="72"/><thr:total>0</thr:total></entry></feed>