<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Isidro Martínez on Medium]]></title>
        <description><![CDATA[Stories by Isidro Martínez on Medium]]></description>
        <link>https://medium.com/@Isidro?source=rss-396512e58904------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*BXm3OuQAX88CnWpWmdyWXw.jpeg</url>
            <title>Stories by Isidro Martínez on Medium</title>
            <link>https://medium.com/@Isidro?source=rss-396512e58904------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 17 Jun 2026 04:36:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Isidro/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[Book Review: Data and Reality]]></title>
            <link>https://medium.com/@Isidro/book-review-data-and-reality-816df6fbab0f?source=rss-396512e58904------2</link>
            <guid isPermaLink="false">https://medium.com/p/816df6fbab0f</guid>
            <category><![CDATA[books]]></category>
            <category><![CDATA[philosophy]]></category>
            <category><![CDATA[data-modeling]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[Isidro Martínez]]></dc:creator>
            <pubDate>Mon, 26 Jan 2026 06:13:50 GMT</pubDate>
            <atom:updated>2026-01-26T06:13:50.280Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/248/1*4Yvar2hObhMhizfyhsR9PQ.jpeg" /></figure><p>I have just finished reading <em>Data and Reality</em> by William Kent. This book is not very popular and was written in 1978, so programming practices and database technology were quite different at the time. The most popular database system back then was IBM IMS (Information Management System), while CODASYL was gaining popularity. IBM IMS offered a simple way to store and retrieve data using a tree structure, whereas CODASYL implemented a graph-based (network) model, providing an alternative way to relate entities without relying on joins.</p><p>The book focuses mainly on the idea that reality cannot be fully expressed in systems or databases. It presents many examples that are still valid today. Nowadays, we have many ways to store data and a wide variety of underlying algorithms, yet we are always searching for more optimal ways to store and retrieve information. For example, we use SQL databases, NoSQL databases, graph databases, spreadsheets, and cache databases. The author anticipated that the tools we have are not sufficient to replicate reality in our systems, and the most interesting aspect of this book is that even today, in 2026, the tools we use are still not enough to fully represent reality.</p><p>One example showing that reality is hard to express in a system is a book that could be printed in two physical volumes because it is too large and stored in different places, but in the system it would be represented as a single book entity.</p><p>Another example: a husband and wife may work at the same company and, when considering medical benefits, they must be treated separately. Or suppose a person has two jobs within the same company. In reality, these situations can happen, but they are hard to represent correctly in a system.</p><p>In terms of changes to entities, an important question arises: <em>When does an entity remain the same entity?</em> For example, owning a car could mean registering the engine block, while all other parts can be removed or changed without affecting the identity of the car in the system.</p><p>The author explains that it is often better to treat objects as eternal for practical purposes. Objects can be stored for analytical reasons, or they can be recreated with the same values (for example, rehiring the same person). This expresses the idea that, in reality, objects can be destroyed, but in a system they conceptually always exist.</p><p>In a system, the administrator ultimately decides what “reality” is. For example: Should we allow numbers in names? Should we include middle names? Should we allow capital letters? Should we include hyphens or commas? These are decisions that define the reality of your system. The same applies to things like telephone numbers.</p><p>He has a chapter dedicated to the record model, which is closer to the relational model. However, he shows many examples where modeling can be challenging without the practices we use today. For example, when modeling a many-to-many relationship, it is necessary to create a separate record for the relationship. Theoretically, you could also create relationship records even if the relationship is not many-to-many. He also discusses considerations such as deleting data, dependencies between entities, and data validation.</p><p>I can imagine why the author felt limited when trying to represent data reality in older systems such as IMS, which used a tree-based algorithm to store and retrieve data. Today, SQL is the most popular language with a relational model behind it. This prediction was written by William Kent in his book when he mentioned that, in the future, data would be modeled by entities and relationships instead of data items and records.</p><h3>Key Takeaways</h3><ul><li>Reality is more than the current tools can represent.</li><li>As a data models what part of reality you want to represent in your system.</li><li>No single data model fits all problems; trade-offs are unavoidable.</li><li>During the 70’s the most popular data models were based on tree and network system.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=816df6fbab0f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reseña de libro: El siglo de las drogas]]></title>
            <link>https://medium.com/@Isidro/rese%C3%B1a-de-libro-el-siglo-de-las-drogas-9365d9cb00c8?source=rss-396512e58904------2</link>
            <guid isPermaLink="false">https://medium.com/p/9365d9cb00c8</guid>
            <category><![CDATA[drugs]]></category>
            <category><![CDATA[books]]></category>
            <category><![CDATA[book-review]]></category>
            <category><![CDATA[mexico]]></category>
            <dc:creator><![CDATA[Isidro Martínez]]></dc:creator>
            <pubDate>Tue, 02 Dec 2025 06:00:24 GMT</pubDate>
            <atom:updated>2025-12-02T06:00:24.141Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/328/0*Bb4PQvCVYp8LndAM.jpg" /></figure><p>He terminado de leer este libro recientemente. Como mexicano, encuentro en él una interesante reseña sobre el consumo de drogas en el último siglo. El libro narra cómo México ha lidiado con las drogas desde 1900 hasta principios del 2000. No había leído antes un libro sobre este tema en México y este me pareció muy bueno.</p><p>La forma en que Luis Astorga describe la historia de las drogas en el país es desde un punto de vista neutro, y menciona muchos nombres de personas involucradas, como jefes de cárteles, policías, presidentes municipales y otros cargos políticos. Puede ser un poco abrumador ver tantos nombres y personajes involucrados a lo largo de un siglo, pero cada una de esas personas tuvo un impacto en las políticas y estrategias de México para enfrentar a los cárteles.</p><p>En general, está lleno de contenido histórico y referencias a periódicos, lo cual hace de este libro un excelente trabajo.</p><p>Me parece muy interesante cómo, a pesar de que ha pasado un siglo, la situación de México no ha cambiado realmente. Varios presidentes han pasado y varios señores del narco han surgido y desaparecido, y pareciera que es el destino de México vivir en esta situación. El problema de las drogas no es exclusivo de México; varios países lo tienen. Sin embargo, México se distingue especialmente por la brecha económica entre Estados Unidos y México, y esto ha hecho que el país sea un proveedor de muchos productos para Estados Unidos, incluyendo drogas, alcohol, frutas, verduras y partes de autos.</p><p>Entre las primeras cosas que encontré interesantes está que, desde el siglo XIX, se elaboraban tónicos a base de vino con pepsina, coca (hoja de un arbusto), kola (una nuez) y otros ingredientes. Estos fueron los orígenes de bebidas como Pepsi y Coca-Cola. Además de estos tónicos, había otras sustancias, píldoras e inyecciones para diferentes enfermedades. En aquellos años no existían regulaciones sobre el uso de sustancias nocivas y muchas personas abusaron de sus efectos.</p><p>El uso de estas drogas ha estado presente en la historia de la humanidad durante muchos años, solo que a principios del siglo XX surgió una tendencia entre los imperios por intentar “perfeccionar” la raza. En ese contexto, el uso de drogas — incluyendo tabaco y alcohol — empezó a considerarse como algo que degradaba a la población. El consumo de sustancias se asociaba específicamente con accidentes, muertes por sobredosis y la incapacidad de participar en labores.</p><p>Los principales estados mencionados son Sinaloa, Chihuahua y Sonora. Se habla más sobre Sinaloa, pues se menciona que hubo asentamientos de chinos en México y que solían consumir opio. Durante un tiempo, se les culpó del incremento en el consumo de esta droga.</p><p>El autor también menciona los diferentes precios de los narcóticos a través de los años. En general, estos precios han cambiado con el tiempo, pero el costo de las drogas en Estados Unidos siempre ha sido significativamente mayor que en México.</p><p>El libro contiene bastantes datos históricos, pero me gustaría concluir este blog con algunos datos más recientes que he encontrado en internet.</p><ul><li>Se estima que el jefe de la droga más poderoso tiene alrededor de 15 mil millones de dólares.<br> Además, entre 18 mil y 29 mil millones de dólares en efectivo pueden generar los cárteles al año.</li><li><strong>Una hectárea</strong> cultivada de coca puede producir aproximadamente 7 kilos de cocaína. Si consideramos un precio de <strong>40 mil USD por kilo</strong>, una sola hectárea podría generar <strong>280 mil USD</strong>. Esto significa que una hectárea puede producir cerca de <strong>6 millones de pesos.</strong></li><li>El salario promedio anual en México es de alrededor de 140 mil pesos. Lo cual significa que una sola hectárea de coca podría cubrir <strong>el salario anual de 42 mil mexicanos.</strong></li></ul><p>Estos números muestran el enorme impacto económico de esta industria en México, pues prácticamente puede influir en sembradores, comerciantes, transportistas, policías, cargos políticos y ciudadanos.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QDS66YFtlY8RusJ8.jpg" /></figure><p>Adjunto una imagen con información actualizada que muestra el precio de la cocaína por país. En ella se aprecia que, en 2019, 1 kilo de cocaína en México costaba alrededor de 12,000 USD, mientras que en Estados Unidos su precio rondaba los 69,000 USD. También se observa que el precio en Colombia era significativamente menor — 1500 USD . Esta información refuerza la enorme diferencia de valor a lo largo de la cadena de producción y distribución, lo cual explica por qué esta industria tiene un impacto tan fuerte en la región.</p><p><a href="https://eltiempolatino.com/2022/11/09/opinion/cuanto-cuesta-la-cocaina-en-el-mundo/">https://eltiempolatino.com/2022/11/09/opinion/cuanto-cuesta-la-cocaina-en-el-mundo/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9365d9cb00c8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Acordeón para la elección del poder judicial de la federación 2024–2025.]]></title>
            <link>https://medium.com/@Isidro/accordion-para-la-elecci%C3%B3n-del-poder-judicial-de-la-federaci%C3%B3n-2024-2025-b2d58355e995?source=rss-396512e58904------2</link>
            <guid isPermaLink="false">https://medium.com/p/b2d58355e995</guid>
            <category><![CDATA[government]]></category>
            <category><![CDATA[mexico]]></category>
            <category><![CDATA[politics]]></category>
            <category><![CDATA[democracy]]></category>
            <category><![CDATA[law]]></category>
            <dc:creator><![CDATA[Isidro Martínez]]></dc:creator>
            <pubDate>Tue, 27 May 2025 05:54:03 GMT</pubDate>
            <atom:updated>2025-05-27T06:47:12.542Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j4Q-H-vWN3dQDfGS_MTy8Q.png" /></figure><p>Con varias controversias al final del año pasado, en 2024, en México se aprobó una reforma para que los ciudadanos pudieran elegir a los miembros del poder judicial. Se dice que una de las principales razones por esta reforma es porque, según investigaciones, solo un pequeño grupo selecto llega al poder y no cuentan con un filtro meritocrático. Además, se dice que el poder judicial no es tan eficiente como se espera. El contexto también tiene que ver con desacuerdos entre el expresidente Andrés Manuel y la presidenta de la Suprema Corte de Justicia, Norma Piña.</p><p>Aunque muchos afirman que esta reforma va a solucionar los problemas actuales, otros sugieren que no se están atacando los principales problemas. Por ejemplo, se dice que esta reforma no toca las fiscalías, las cuales son una parte importante porque son quienes recaban las evidencias para que los jueces puedan tomar decisiones. Debido a la gran cantidad de casos de delincuencia, la fiscalía no puede proporcionar las evidencias necesarias para procesar un caso correctamente.</p><p>La reforma al poder judicial plantea poder elegir a los jueces de forma popular. Aunque suena bien del lado democrático, también genera otros problemas, porque la mayoría de las personas no conocemos a quienes se postulan. La verdad es que investigar a cada una de las personas requiere un esfuerzo inhumano. Si fuera a votar el día de hoy, lo más probable es que elija al azar a cada uno de los candidatos.</p><p>Por esta razón decidí utilizar herramientas de <em>deep thinking</em> como Gemini y ChatGPT para analizar a cada uno de los candidatos. Utilizar inteligencia artificial para seleccionar candidatos suena como dejar que la IA nos controle, pero debido al poco tiempo que tengo, creo que usar IA es mejor que votar al azar.</p><p>Usar una IA para analizar los candidatos no es tan simple como pedir los nombres para votar. Debemos ser claros en nuestros requerimientos y también aplicar <em>deep thinking</em> para que profundice en el análisis de cada candidato. Hay algunas desventajas en este tipo de análisis, porque muchos candidatos pueden no tener mucha información en internet, lo cual podría sesgar la decisión.</p><p>Vamos a empezar generando un <em>prompt</em>. La forma en que lo hice fue a través de ChatGPT Pro y Gemini: le di contexto sobre la elección judicial y le pedí múltiples veces que analizara el <em>prompt</em> y lo mejorara. Este fue el resultado, excluyendo alguna información como el análisis de cada uno. Además, modifiqué el <em>prompt</em> de acuerdo a la boleta.</p><p>Nuestro principial objectivo es obtener la lista de los candidatos mejores calificados para el perfil.</p><h3><strong>TLDR;</strong></h3><p>Morado Mujeres: 09, 14, 17, 05, 04.<br> Morado Hombres: 35, 55, 38, 43.<br> Verde mujeres: 02, 09, 01.<br> Verde hombres: 30, 23.<br> Azul Mujer: 03.<br> Azul Hombre: 13.<br> Beige Mujeres: 02, 07.<br> Beige Hombres: 11.</p><h3>PROMPT</h3><blockquote>Rol Principal: Actúa como un Analista Jurídico experto, especializado en el riguroso proceso de selección de MINISTRAS Y MINISTROS DE LA SUPREMA CORTE DE JUSTICIA DE LA NACIÓN</blockquote><blockquote>Tu Misión: Evaluar la idoneidad de cada candidato/a para ocupar una vacante en este prestigioso tribunal. Tu análisis se basará exclusivamente en la información que te proporcionaré (entrevistas, declaraciones públicas, CVs, y documentación relevante).</blockquote><blockquote>Proceso por Candidato/a:</blockquote><blockquote>Para cada candidato/a que te presente, realizarás el siguiente análisis individual:</blockquote><blockquote>A. Evaluación por Criterios Fundamentales:</blockquote><blockquote>Otorga una calificación de 1 a 10 (donde 1 = muy deficiente y 10 = excelente) para cada uno de los siguientes criterios. Justifica brevemente cada valoración, destacando los puntos fuertes y débiles observados para ese criterio específico, similar al ejemplo proporcionado:</blockquote><blockquote>Ética (1–10):</blockquote><blockquote>Principios rectores: Integridad personal intachable, independencia de criterio demostrada, compromiso con los principios constitucionales y el respeto irrestricto a los derechos humanos.</blockquote><blockquote>Conducta: Ausencia total de conflictos de interés (pasados o potenciales) y de conductas públicas o privadas que hayan sido cuestionadas fundadamente.</blockquote><blockquote>Justificación Breve: (Ej. “Demuestra sólida integridad en su trayectoria [mencionar evidencia], aunque se observa una [ligera crítica o punto a considerar si existe, o ‘sin puntos débiles evidentes en este rubro’]”).</blockquote><blockquote>Conocimientos Jurídicos (1–10):</blockquote><blockquote>Dominio técnico: Profundo conocimiento del derecho constitucional y electoral, así como de disciplinas afines.</blockquote><blockquote>Capacidad analítica: Calidad y solidez en la argumentación jurídica, claridad conceptual y precisión técnica.</blockquote><blockquote>Contribución intelectual: Relevancia y calidad de sus aportes (artículos de investigación, libros, dictámenes, ponencias, sentencias si aplica).</blockquote><blockquote>Justificación Breve: (Ej. “Sobresaliente dominio del derecho electoral evidenciado en [publicación X / cargo Y]. Su capacidad argumentativa es [calificativo]. Podría profundizar en [área específica si aplica]”).</blockquote><blockquote>Trayectoria Profesional (1–10):</blockquote><blockquote>Desarrollo y coherencia: Estabilidad y progresión lógica en su carrera profesional.</blockquote><blockquote>Relevancia de cargos: Importancia e impacto de los cargos desempeñados en el ámbito jurídico, especialmente en materia electoral o constitucional.</blockquote><blockquote>Logros y contribuciones: Aportaciones significativas al desarrollo del derecho, la academia o la función pública.</blockquote><blockquote>Reconocimientos: Distinciones oficiales, académicas o profesionales relevantes.</blockquote><blockquote>Justificación Breve: (Ej. “Carrera ascendente y coherente en [sector]. Su rol como [cargo] fue clave para [logro]. Se echa en falta experiencia en [ámbito X], si aplica”).</blockquote><blockquote>Experiencia Judicial o Jurídica Relevante (1–10):</blockquote><blockquote>Práctica directa: Participación activa y demostrable en la función judicial (preferentemente electoral), litigio estratégico en la materia, docencia jurídica especializada a nivel superior, o desempeño de funciones públicas/privadas con alta incidencia y relación directa con el derecho electoral y constitucional.</blockquote><blockquote>Justificación Breve: (Ej. “Amplia experiencia como [rol judicial/litigante/docente]. Su participación en [caso/proyecto Z] es destacable. Sería deseable mayor experiencia en [aspecto específico]”).</blockquote><blockquote>B. Estructura del Informe Individual por Candidato/a:</blockquote><blockquote>Informe Descriptivo del Perfil (Máximo 350 palabras):</blockquote><blockquote>Realiza una valoración cualitativa integral sobre la idoneidad del candidato/a para el cargo.</blockquote><blockquote>Integra tus observaciones de los cuatro criterios, destacando las principales fortalezas y debilidades del perfil en su conjunto.</blockquote><blockquote>Nota Adicional Obligatoria (si aplica): Si durante tu análisis detectas posibles riesgos significativos, conflictos de interés no resueltos, o conductas controversiales documentadas que podrían impactar su desempeño como Magistrado/a, inclúyelos de forma clara y concisa aquí.</blockquote><blockquote>Lenguaje: Profesional, objetivo, claro y accesible, evitando tecnicismos innecesarios.</blockquote><blockquote>Tabla Comparativa de Calificaciones:</blockquote><blockquote>| Criterio | Calificación (1–10) | Justificación Breve (incluyendo fortalezas y debilidades específicas del criterio) |</blockquote><blockquote>| : — — — — — — — — — — — — — — | : — — — — — — — — — | : — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — |</blockquote><blockquote>| Ética | | |</blockquote><blockquote>| Conocimientos jurídicos | | |</blockquote><blockquote>| Trayectoria profesional | | |</blockquote><blockquote>| Experiencia judicial/jurídica | | |Si algún criterio no puede ser evaluado fehacientemente por falta de información específica y crucial, indícalo explícitamente con “Información Insuficiente” en la calificación y explica brevemente en la justificación.</blockquote><blockquote>Síntesis de Pros y Contras del Perfil (General):</blockquote><blockquote>Pros: Lista de 3–5 aspectos más destacados y fortalezas relevantes del candidato/a, considerando el conjunto de los criterios evaluados y su adecuación al cargo.</blockquote><blockquote>Contras: Lista de 3–5 debilidades, vacíos o alertas más significativos detectados en el perfil, fundamentados estrictamente en la información disponible (evita especulaciones o hipótesis externas).</blockquote><blockquote>C. Proceso de Entrega de Información y Reporte Final:</blockquote><blockquote>Selecciona top 4 de hombre y top 5mujer.</blockquote><blockquote>Lista de candidatos:</blockquote><h3><strong>MUJERES MINISTRAS Y MINISTROS DE LA SUPREMA CORTE DE JUSTICIA DE LA NACIÓN</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qkd8W6WXHNhMbKmZQafZgQ.png" /></figure><p><strong>ESTRADA TENA FABIANA</strong></p><ul><li><strong>Calificación Promedio:</strong> 9.25</li><li><strong>Argumentos Clave para Alta Valoración:</strong> Su profundo conocimiento del Poder Judicial Federal y de la SCJN, acumulado a lo largo de 26 años en roles de alta responsabilidad como Coordinadora General de Asesores de la Presidencia, se complementa con su papel protagónico como jefa del equipo redactor de la reforma judicial de 2021, lo que evidencia su dominio técnico y visión estratégica. Además, cuenta con una sólida formación académica (Licenciada en Derecho UNAM, Maestra en Derecho U. de Virginia) y experiencia docente en instituciones de prestigio.</li><li><strong>Calificaciones destacadas:</strong> Ética 9.0, Conocimientos 9.5, Trayectoria 9.5, Experiencia 9.0.</li><li><strong>Punto en contra:</strong> Su experiencia, aunque vasta, se ha desarrollado predominantemente dentro de la estructura interna del Poder Judicial Federal, con menor visibilidad de experiencia en litigio externo o en otros sectores del ámbito jurídico.</li></ul><p><strong>GONZALEZ TIRADO ROSA ELENA</strong></p><ul><li><strong>Calificación Promedio:</strong> 9.25</li><li><strong>Argumentos Clave para Alta Valoración:</strong> Posee una trayectoria excepcionalmente amplia y diversificada de más de 34 años en el Poder Judicial de la Federación, donde ocupó cargos desde Secretaria de Estudio y Cuenta en la SCJN hasta Jueza de Distrito y Consejera de la Judicatura Federal, lo que le otorga un profundo conocimiento integral del sistema. Su sólida formación académica, con maestría especializada en materia constitucional y administrativa, se suma a una clara postura pública sobre la importancia de la ética judicial, la transparencia y el combate a la corrupción.</li><li><strong>Calificaciones destacadas:</strong> Ética 9.0, Conocimientos 9.0, Trayectoria 9.5, Experiencia 9.5.</li><li><strong>Punto en contra:</strong> Si bien ha participado en la presentación de obras jurídicas y es autora de artículos , la información no detalla una extensa obra doctrinal individual (libros) en temas constitucionales de vanguardia.</li></ul><p><strong>IBARRA OLGUIN ANA MARIA</strong></p><ul><li><strong>Calificación Promedio:</strong> 9.2</li><li><strong>Argumentos Clave para Alta Valoración:</strong> Su perfil destaca por una excepcional y pertinente formación académica (Lic. CIDE, Mtra. y Doctoranda U. de Virginia, Máster U. Panamericana) y su actual rol como Directora del Centro de Estudios Constitucionales de la SCJN, que la posiciona en la vanguardia del pensamiento constitucional. Esto se complementa con una prolífica producción intelectual en derechos humanos y su experiencia directa en la SCJN como Secretaria de Estudio y Cuenta, donde contribuyó a importantes líneas jurisprudenciales.</li><li><strong>Calificaciones destacadas:</strong> Ética 9.5, Conocimientos 9.8, Trayectoria 9.0, Experiencia 8.5.</li><li><strong>Punto en contra:</strong> Su experiencia profesional, aunque de muy alto nivel intelectual y estratégico dentro de la SCJN, no incluye una trayectoria extensa como jueza o magistrada en la resolución directa de casos en órganos jurisdiccionales inferiores.</li></ul><p><strong>CASTAÑEDA PEREZ MARISOL</strong></p><ul><li><strong>Calificación Promedio:</strong> 9.0</li><li><strong>Argumentos Clave para Alta Valoración:</strong> Cuenta con una sólida y extensa trayectoria dentro del Poder Judicial de la Federación, con experiencia como Jueza de Distrito y Magistrada de Circuito en diversas materias, respaldada por una robusta formación académica que incluye un Doctorado en Derecho Penal y Maestrías en Derecho Fiscal y Constitucionalismo. Su liderazgo es reconocido al haber sido Presidenta de la Asociación Mexicana de Juzgadoras y distinguida como una de las “Abogadas más Influyentes en México”.</li><li><strong>Calificaciones destacadas:</strong> Ética 8.5, Conocimientos 9.0, Trayectoria 9.0, Experiencia 9.5.</li><li><strong>Punto en contra:</strong> Aunque las denuncias y quejas en su contra fueron declaradas improcedentes , su existencia podría ameritar una revisión más detallada si se dispusiera de mayor información contextual.</li></ul><p><strong>BONILLA GARCIA JAZMIN</strong></p><ul><li><strong>Calificación Promedio:</strong> 8.875</li><li><strong>Argumentos Clave para Alta Valoración:</strong> Su perfil combina una sólida y especializada formación académica (Maestra en Derechos Humanos y Democracia FLACSO, doctoranda en Derecho UP) con un profundo conocimiento del funcionamiento interno de la SCJN, adquirido como Secretaria de Estudio y Cuenta y Secretaria de Acuerdos de Sala. Ha demostrado una trayectoria coherente y ascendente en el Poder Judicial Federal, culminando como Magistrada de Circuito comisionada en la SCJN, y ha presentado propuestas concretas para la modernización de la justicia, además de contribuciones intelectuales publicadas.</li><li><strong>Calificaciones destacadas:</strong> Ética 9.0, Conocimientos 9.0, Trayectoria 8.5, Experiencia 9.0.</li><li><strong>Punto en contra:</strong> Su nombramiento como Magistrada de Circuito es reciente (2024) , por lo que su experiencia directa en la resolución de casos como juzgadora titular de un órgano colegiado es limitada en tiempo, aunque su experiencia en la SCJN es extensa.</li></ul><h3><strong>HOMBRE MINISTRAS Y MINISTROS DE LA SUPREMA CORTE DE JUSTICIA DE LA NACIÓN</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3qgwCU5Q-Kv6gt4l3KYunQ.png" /></figure><p><strong>JAIME ALLIER CAMPUZANO</strong></p><ul><li><strong>Calificación Promedio:</strong> 9.45</li><li><strong>Argumentos Clave para Alta Valoración:</strong> Su perfil es excepcionalmente sólido debido a una extensa y completa carrera judicial dentro del Poder Judicial de la Federación, donde ha ascendido desde mecanógrafo hasta Magistrado de Circuito, demostrando un profundo conocimiento práctico del sistema. Esta experiencia se complementa con una robusta formación académica, que incluye un Doctorado en Derecho con promedio perfecto , y una prolífica producción intelectual de diez libros jurídicos y numerosos artículos en diversas áreas del derecho, incluyendo laboral, constitucional y amparo. Su propuesta de “humanismo judicial” y su reflexión sobre las virtudes republicanas del juzgador evidencian una filosofía judicial clara y un fuerte compromiso ético.</li><li><strong>Calificaciones destacadas:</strong> Ética 9.0, Conocimientos 9.5, Trayectoria 9.5, Experiencia 9.8.</li><li><strong>Punto en contra:</strong> Su enfoque en la justicia social y la interpretación más allá de la “ley a rajatabla” , aunque positivo, podría requerir un cuidadoso equilibrio para evitar percepciones de activismo judicial excesivo.</li></ul><p><strong>SERGIO JAVIER MOLINA MARTÍNEZ</strong></p><ul><li><strong>Calificación Promedio:</strong> 9.0</li><li><strong>Argumentos Clave para Alta Valoración:</strong> Su extensa y multifacética carrera dentro del Poder Judicial de la Federación, que incluye roles como Juez de Distrito, Magistrado y Consejero de la Judicatura Federal, le otorga una profunda experiencia y una visión estratégica del sistema judicial. Su robusto perfil académico, con un Doctorado en Derecho y múltiples especializaciones , se ve reforzado por una significativa producción académica centrada en la reforma laboral, donde ha demostrado liderazgo intelectual. Las distinciones por sentencias que protegen derechos humanos y aplican perspectiva de género subrayan su calidad como juzgador.</li><li><strong>Calificaciones destacadas:</strong> Ética 8.0, Conocimientos 9.0, Trayectoria 9.5, Experiencia 9.5.</li><li><strong>Punto en contra:</strong> Fue señalado como “traidor” por críticos de la reforma judicial debido a su voto decisivo en el Consejo de la Judicatura Federal , y se mencionó su cercanía con la ministra Yasmín Esquivel Mossa (su esposa trabaja en la ponencia de dicha ministra) como un potencial conflicto de interés.</li></ul><p><strong>EDGAR CORZO SOSA</strong></p><ul><li><strong>Calificación Promedio:</strong> 8.625</li><li><strong>Argumentos Clave para Alta Valoración:</strong> Combina una sólida formación académica internacional (Doctor en Derecho Constitucional por la UNAM y la Universidad Autónoma de Madrid; Maestría en París I Panthéon-Sorbonne) con una relevante experiencia en derechos humanos a nivel nacional (Quinto Visitador General en la CNDH) e internacional (representante de México ante la ONU). Su paso por la SCJN como asesor y Secretario de Estudio y Cuenta le proporciona un valioso conocimiento interno del máximo tribunal , y su rol como Investigador Titular en el IIJ-UNAM (SNI Nivel III) respalda su autoridad académica con publicaciones centradas en derechos humanos, migración y justicia constitucional.</li><li><strong>Calificaciones destacadas:</strong> Ética 8.5, Conocimientos 9.0, Trayectoria 8.5, Experiencia 8.5.</li><li><strong>Punto en contra:</strong> Su experiencia directa como juez o magistrado no es explícita en la información proporcionada, centrándose más en la academia, la asesoría y la defensa de derechos humanos.</li></ul><p><strong>GIOVANNI AZAEL FIGUEROA MEJÍA</strong></p><ul><li><strong>Calificación Promedio:</strong> 8.0</li><li><strong>Argumentos Clave para Alta Valoración:</strong> Su perfil académico es sobresaliente, con un Doctorado en Derecho Constitucional (Sobresaliente Cum Laude) por la Universidad Complutense de Madrid y reconocimiento como Investigador Nacional Nivel II del SNI. Su vasta producción académica, que incluye 3 libros como autor único, la coordinación de 12 obras colectivas y cerca de 50 textos académicos , ha influido en sentencias judiciales y ha sido citada en la Iniciativa de Reforma Constitucional al Poder Judicial, demostrando la relevancia de sus contribuciones doctrinales. Aunque carece de experiencia directa como juez, sus roles como asesor en el TEPJF y el CJF, y como director de escuela judicial, le otorgan una comprensión profunda del sistema.</li><li><strong>Calificaciones destacadas:</strong> Ética 6.0, Conocimientos 9.5, Trayectoria 8.5, Experiencia 8.0.</li><li><strong>Punto en contra:</strong> Fue sancionado con una amonestación pública por el TEPJF debido a la presentación extemporánea de su declaración patrimonial, calificada como falta no grave pero con señalamiento de “reiteración de conducta”, y no rindió informe durante el procedimiento administrativo</li></ul><h3><strong>MAGISTRADAS Y MAGISTRADOS DEL TRIBUNAL DE DISCIPLINA JUDICIAL</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/1*2uJY169CwrJ5XeDqx5quBA.png" /></figure><p><strong>TOP 3 MUJERES</strong></p><p><strong>EVA VERONICA DE GYVES ZARATE</strong></p><ul><li><strong>Calificación Promedio:</strong> 8.75</li><li><strong>Argumentos Clave para Alta Valoración:</strong> Su perfil destaca por una extensa y profunda carrera judicial, habiendo desempeñado roles como Juez, Magistrada y, notablemente, Consejera de la Judicatura Federal (2019–2024). Esta trayectoria se complementa con una sólida formación académica que incluye una Licenciatura en Derecho por la UNAM y múltiples especializaciones y maestrías en áreas cruciales como Derecho Penal, Amparo y Derecho Procesal Penal Acusatorio. En sus declaraciones, ha manifestado un firme compromiso con la independencia judicial, la imparcialidad y la lucha contra la impunidad, principios fundamentales para el Tribunal de Disciplina Judicial.</li><li><strong>Calificaciones destacadas:</strong> Ética 8.5, Conocimientos Jurídicos 9.0, Trayectoria Profesional 8.5, Experiencia Judicial/Jurídica 9.0.</li><li><strong>Punto en contra:</strong> Si bien su experiencia en el ámbito penal y procesal es vasta, la información disponible no detalla con la misma profundidad contribuciones específicas o experiencia directa en materia electoral, aunque su rol en la Judicatura Federal presupone una visión amplia del sistema.</li></ul><p><strong>CELIA MAYA GARCIA</strong></p><ul><li><strong>Calificación Promedio:</strong> 8.5</li><li><strong>Argumentos Clave para Alta Valoración:</strong> Posee una trayectoria judicial sumamente extensa y de alto nivel, habiendo sido Magistrada del Tribunal Superior de Justicia del Estado de Querétaro por más de tres décadas (1986–2019) y Juez en materia civil (1979–1985). Su preparación académica es robusta, ostentando un Doctorado en Derecho, Maestría en Derecho Fiscal y licenciaturas en Derecho y Contaduría Pública. Sus propuestas para el Tribunal se centran en la prevención de la corrupción, la promoción de la ética, la equidad y la justicia accesible, demostrando una visión integral para la disciplina judicial.</li><li><strong>Calificaciones destacadas:</strong> Ética 8.5, Conocimientos Jurídicos 8.5, Trayectoria Profesional 8.0, Experiencia Judicial/Jurídica 9.0.</li><li><strong>Punto en contra:</strong> Su perfil incluye múltiples candidaturas a cargos de elección popular por diferentes partidos políticos (PRD, Morena) , lo que, a pesar de su extensa carrera judicial, podría generar interrogantes sobre su independencia política percibida para un cargo que exige neutralidad absoluta.</li></ul><p><strong>ARIADNA CAMACHO CONTRERAS</strong></p><ul><li><strong>Calificación Promedio:</strong> 7.25</li><li><strong>Argumentos Clave para Alta Valoración:</strong> Cuenta con una sólida formación académica, que incluye dos Maestrías en Derecho, una en Litigio con especializaciones en Derecho Constitucional, Administrativo y Fiscal, y otra por la Southwestern Law School. Ha acumulado más de 15 años de experiencia en roles jurídicos de alta dirección dentro del Poder Ejecutivo a nivel federal y local, como Directora General de Asuntos Jurídicos en la Secretaría de Turismo y Subprocuradora en la SAFCDMX. Ha presentado propuestas articuladas para el Tribunal, enfocadas en la eficiencia, transparencia, perspectiva de género y combate a la corrupción.</li><li><strong>Calificaciones destacadas:</strong> Ética 6.5, Conocimientos Jurídicos 8.0, Trayectoria Profesional 7.5, Experiencia Judicial/Jurídica 7.0.</li><li><strong>Punto en contra:</strong> Un incidente durante su campaña, relacionado con una queja ante el INE por publicidad pagada por un tercero (“Político MX”) en su beneficio que fue ordenada a retirar , genera un punto de atención sobre la percepción de probidad. Además, carece de experiencia judicial directa como jueza o magistrada.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/1*TiCWJ5CxxnxVaGDyz0BHPQ.png" /></figure><p><strong>TOP 2 HOMBRES</strong></p><p><strong>GILDARDO GALINZOGA ESPARZA</strong></p><ul><li><strong>Calificación Promedio:</strong> 8.875</li><li><strong>Argumentos Clave para Alta Valoración:</strong> Su perfil se distingue por una carrera de 35 años íntegramente dentro del Poder Judicial de la Federación, ascendiendo desde Oficial Administrativo hasta Magistrado de Circuito, cargo que ocupa actualmente. Posee una robusta formación académica que incluye un Doctorado en Derecho, tres Maestrías (una en Derecho Judicial por la Universidad Panamericana) y una Especialidad en Derecho Administrativo por la Escuela Federal de Formación Judicial. Sus propuestas enfatizan la transparencia en los procedimientos disciplinarios y la lucha contra la corrupción.</li><li><strong>Calificaciones destacadas:</strong> Ética 8.0, Conocimientos Jurídicos 9.0, Trayectoria Profesional 9.0, Experiencia Judicial/Jurídica 9.5.</li><li><strong>Punto en contra:</strong> Aunque su compromiso con la transparencia y la lucha contra la corrupción es claro en sus propuestas , la información disponible no detalla logros específicos de alto impacto en materia anticorrupción más allá del ejercicio inherente a sus funciones judiciales.</li></ul><p><strong>BERNARDO BATIZ VAZQUEZ</strong></p><ul><li><strong>Calificación Promedio:</strong> 8.625</li><li><strong>Argumentos Clave para Alta Valoración:</strong> Cuenta con una notable experiencia en cargos de alta responsabilidad, habiendo sido Procurador General de Justicia del Distrito Federal (2000–2006) y Consejero de la Judicatura Federal (2019–2024). Su trayectoria incluye una extensa carrera legislativa como Diputado Federal en cuatro ocasiones, participando activamente en comisiones de Justicia y Gobernación. Ha manifestado una sólida postura ética respecto a la independencia judicial y un compromiso con la justicia. Es autor de varios libros de temática jurídica y profesor universitario.</li><li><strong>Calificaciones destacadas:</strong> Ética 8.5, Conocimientos Jurídicos 8.5, Trayectoria Profesional 9.0, Experiencia Judicial/Jurídica 8.5.</li><li><strong>Punto en contra:</strong> Su larga trayectoria política, con militancia en diversos partidos (PAN, PRD y posteriormente Morena) , podría ser vista por algunos como un factor que podría influir en la percepción de su imparcialidad, a pesar de su experiencia en roles judiciales y de procuración de justicia.</li></ul><h3><strong>MAGISTRADAS Y MAGISTRADOS DE LA SALA SUPERIOR DEL TRIBUNAL ELECTORAL DEL PODER JUDICIAL DE LA FEDERACIÓN.</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oTaDQENRf4vWb35yOuh8zg.png" /></figure><p><strong>ADRIANA MARGARITA FAVELA HERRERA</strong></p><ul><li><strong>Calificación Promedio:</strong> 9.5</li><li><strong>Argumentos Clave para Alta Valoración:</strong> Cuenta con una excepcional y extensa trayectoria en los más altos niveles de los órganos electorales, tanto administrativos (Consejera del INE durante 9 años) como jurisdiccionales (Magistrada de Sala Regional del TEPJF). Demuestra un profundo conocimiento del derecho electoral, respaldado por su Doctorado en Derecho, múltiples publicaciones especializadas y vasta experiencia práctica en la materia. Posee un reconocido y sólido compromiso con la igualdad de género y la protección de los derechos de grupos vulnerables, además de experiencia directa en la organización de procesos electorales y la resolución de quejas y denuncias como Consejera del INE. No se identificaron señalamientos éticos en la información analizada.</li><li><strong>Calificaciones destacadas:</strong> Ética 9, Conocimientos Jurídicos 9, Trayectoria Profesional 10, Experiencia Judicial/Jurídica 10.</li><li><strong>Punto en contra:</strong> No se identificaron contras significativos en la información analizada para este perfil.</li></ul><p><strong>JORGE SÁNCHEZ MORALES</strong></p><ul><li><strong>Calificación Promedio:</strong> 9.5</li><li><strong>Argumentos Clave para Alta Valoración:</strong> Posee una trayectoria excepcionalmente amplia y diversa que abarca todos los ámbitos de la materia electoral: administrativo (Consejero Presidente del Instituto Electoral del Estado de Puebla), jurisdiccional local (Magistrado del Tribunal Electoral del Estado de Puebla) y jurisdiccional federal (Magistrado y Presidente de la Sala Regional Guadalajara del TEPJF, y actualmente Director General en el TEPJF). Cuenta con una sólida formación académica a nivel doctoral, complementada con múltiples estudios de posgrado en instituciones internacionales de prestigio, y es autor de varios libros y numerosos artículos sobre temas electorales relevantes como la reelección y la ciudadanía intercultural. Ha demostrado experiencia en la organización de elecciones a diversos niveles (presidenciales, senadores, diputados y gobernadores) y es el único candidato que ha llegado por segunda ocasión a la etapa final del proceso de selección para Magistrado de la Sala Superior. No se identificaron señalamientos éticos en la información analizada.</li><li><strong>Calificaciones destacadas:</strong> Ética 9, Conocimientos Jurídicos 9, Trayectoria Profesional 10, Experiencia Judicial/Jurídica 10.</li><li><strong>Punto en contra:</strong> No se identificaron contras significativos en la información analizada para este perfil.</li></ul><h3><strong>MAGISTRADAS Y MAGISTRADOS DE LA SALA REGIONAL DEL TRIBUNAL ELECTORAL DEL PODER JUDICIAL DE LA FEDERACIÓN.</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A75kDy6SHmpmC21wKRrq5A.png" /></figure><p><strong>IRINA GRACIELA CERVANTES BRAVO</strong></p><ul><li><strong>Calificación Promedio: </strong>9.75</li><li><strong>Argumentos Clave para Alta Valoración: </strong>Posee una excepcional formación académica que incluye un Doctorado en Derecho Procesal (sobresaliente cum laude) por la Universidad Complutense de Madrid y un Máster en Derecho Constitucional y Ciencia Política por el Centro de Estudios Políticos y Constitucionales de Madrid. Es miembro del Sistema Nacional de Investigadores Nivel 1 y cuenta con una prolífica producción intelectual con múltiples libros y artículos en materia constitucional y electoral. Su trayectoria profesional es sólida y ascendente, habiendo sido Magistrada y Presidenta del Tribunal Electoral de Nayarit, Secretaria de Estudio y Cuenta en el TEPJF, y Presidenta de la Asociación de Tribunales Electorales de la República Mexicana. Actualmente, se desempeña como Defensora Pública Electoral Especializada en violencia política de género, lo que añade una alta relevancia social y jurídica a su perfil. Ha recibido reconocimientos como el Premio AMIJ 2020.</li><li><strong>Calificaciones destacadas:</strong> Ética 9, Conocimientos Jurídicos 10, Trayectoria Profesional 10, Experiencia Judicial/Jurídica 10.</li><li><strong>Punto en contra:</strong> La evaluación de su ética, si bien positiva por sus declaraciones y reconocimientos , carece de detalles específicos sobre el manejo de dilemas éticos complejos en los fragmentos provistos, lo cual es una limitación inherente a la información disponible.</li></ul><p><strong>GABRIELA DOLORES RUVALCABA GARCIA</strong></p><ul><li><strong>Calificación Promedio:</strong> 9.5</li><li><strong>Argumentos Clave para Alta Valoración:</strong> Presenta un perfil académico sobresaliente con Doctorado y Maestría en Derecho Electoral, además de una Maestría en Derecho Constitucional y Amparo, y una especialización en Justicia Constitucional en España. Es una autora prolífica y coordinadora de múltiples libros y artículos especializados en derecho electoral y constitucional, demostrando un profundo dominio técnico. Su trayectoria dentro del TEPJF es extensa y relevante, habiendo sido Secretaria de Estudio y Cuenta en la Sala Superior, Secretaria Instructora en la Sala Regional Guadalajara, y actualmente es Directora de la Escuela Judicial Electoral del TEPJF. Posee un profundo conocimiento del sistema de justicia electoral desde perspectivas jurisdiccionales, académicas y de formación profesional. Su visión de la justicia enfatiza la perspectiva de género e intercultural.</li><li><strong>Calificaciones destacadas:</strong> Ética 8, Conocimientos Jurídicos 10, Trayectoria Profesional 10, Experiencia Judicial/Jurídica 10.</li><li><strong>Punto en contra:</strong> La evaluación de su ética se basa principalmente en sus declaraciones y la ausencia de información negativa en los fragmentos disponibles , sin evidencia documental específica sobre el manejo de dilemas éticos complejos (limitación inherente a la información disponible).</li></ul><p><strong>ENRIQUE BASAURI CAGIDE</strong></p><ul><li><strong>Calificación Promedio: </strong>8.0</li><li><strong>Argumentos Clave para Alta Valoración:</strong> Cuenta con una extensa experiencia de siete años como Secretario de Estudio y Cuenta Regional en el TEPJF, donde estuvo directamente involucrado en la elaboración de proyectos de resolución en materia electoral federal. Posee una sólida formación académica, siendo Maestro en Derecho Electoral y Licenciado en Derecho por la Universidad de Guadalajara con excelencia académica. Es miembro de la Carrera Judicial del Poder Judicial de la Federación desde 2009. Ha contribuido intelectualmente como autor de artículos sobre temas electorales y colaborador en un libro sobre nulidades, además de ser un activo ponente y capacitador en la materia. Es fundador de la Academia Mexicana de Profesionales en Derecho Electoral A.C.</li><li><strong>Calificaciones destacadas:</strong> Ética 7, Conocimientos Jurídicos 8, Trayectoria Profesional 8, Experiencia Judicial/Jurídica 9.</li><li><strong>Punto en contra:</strong> Su experiencia principal en el TEPJF fue en un rol de apoyo técnico-jurídico fundamental, pero no como magistrado titular. La información sobre su trayectoria profesional más reciente (posterior a 2016/2017) no está completamente actualizada en todos los fragmentos disponibles. La evaluación de su ética se basa en su pertenencia a la carrera judicial y la ausencia de información negativa, sin detalles específicos sobre el manejo de dilemas éticos complejos.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b2d58355e995" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Book Review: Learning Domain-Driven Design]]></title>
            <link>https://medium.com/@Isidro/book-review-learning-domain-driven-design-2e2cdc746da8?source=rss-396512e58904------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e2cdc746da8</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[books]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[domain-driven-design]]></category>
            <category><![CDATA[book-review]]></category>
            <dc:creator><![CDATA[Isidro Martínez]]></dc:creator>
            <pubDate>Mon, 15 Apr 2024 04:41:03 GMT</pubDate>
            <atom:updated>2024-10-15T16:47:53.393Z</atom:updated>
            <content:encoded><![CDATA[<h3>Book Notes: Learning Domain-Driven Design.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*BoSHuck3b_uKgxGxa0ZXEg.png" /><figcaption>Learning Domain-Driven Design. Vlad Khononv Foreword by Julie Lerman.</figcaption></figure><p>This review is part of a series of books I’ve been reading on software development. I selected this book because Domain-Driven Design (DDD) has been a trending topic in the industry in recent years. Similar to previous books I’ve read on coding patterns, this book covers a methodology applied to software development, encompassing coding, software design, and communication between teams.</p><p>The primary focus of DDD is effective communication, achieved through two main parts: Strategic and Tactical. Strategic Design addresses questions such as ‘What software are we building?’ and ‘Why are we building it?’ Tactical Design, on the other hand, enables us to write code that reflects the business domain, addresses its goals, and speaks the language of the business domain.</p><h3>Analyzing Business Domains.</h3><p>Bossiness Domain is the company’s main area. It’s a service the company provides to its client.</p><p>DDD distinguishes between three types of subdomains: core, generic, and supporting. Core subdomain is what a company does differently from its competitors, it is naturally complex and it covers the interesting part of the business. Generic Subdomain are business that all companies are performing in the same way, it is a general solved problem. Supporting Subdomain, Similar to generic subdomain but it doesn’t provide a significant advantage, the problems are obvious with obvious solutions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zhh00cLydi-5bXF6r89drw.png" /><figcaption>The differences between the tree types of subdomains. (extract from the book)</figcaption></figure><p>A good starting point to identify subdomain is starting with company departments and other organizational units, we can use the definition”subdomains are a set of coherent use cases” as a guiding principle.</p><p>Domain experts are either the people coming up with requirements or the software’s end users. The software is supposed to solve their problems.</p><h3>Discovering Domain Knowledge.</h3><p>Projects require the collaboration between different roles: domain experts, product owners, engineers, UI and UX designers, project manager, testers analysts and others. DDD proposes to get knowledge from domain expert to software engineers by using an ubiquitous language. The ubiquitous language is the language of the business, it must be precise and consistent, it should eliminate the need for assumptions and should me the business domain logic explicit. For example the term “user” can not be obvious and should can be represented as “user”, “visitor”, “administrator” and“account”.It should be reinforced throughout the project, requirements, test, documentation and source code.</p><p>The book recommends the usage of automated tests written in the Gherkin language for capturing the ubiquitous language and act as an additional tool for bridging the gap between domain experts and software engineers.</p><h3>Managing Domain Complexity.</h3><p>With the bounded context pattern, the contexts are modeled as an explicit and integral part of the business domain. A ubiquitous language is ubiquitous only in the boundaries of its bounded context, the wider the ubiquitous language the harder is to keep consistency, the smaller the more overhead the design induces.</p><ul><li>Choosing model’s boundaries is a strategic design decision.</li><li>Subdomains are discovered. These are defined by the business strategy.</li><li>Bounded context serve not only as a model boundaries but also as a phisical boundaries of systems implementing them.</li><li>Each bounded context should be implemented as an individual service.</li><li>While subdomains are discovered, bounded context are designed.</li><li>A bounded and its ubiquitous language can be implemented and maintained by one team, no two teams can shared the work on the same bounded context. However, one team can work on multiple bounded context</li></ul><h3>Integration Bounded Context.</h3><p>Contracts are the touch-points between bounded contexts.</p><p>Partnership model: One team can notify a second team about a change in the API and the second team will cooperate and adapt.</p><p>Shared Kernel: Is implemented so that any modification in its source code is immediately reflected in all bounded context using it. Continues Integration is required because the shared kernel belongs to multiple bounded context. The frequently the changes the higher the cost will be.</p><p>Customer Supplier: The anticorruption layer pattern address scenarios in which it is not desirable or worth the effort to confirm to the supplier model.<br>- When the upstream model is inefficient or inconvenient for a customer needs.<br>- When the suppliers contract change often.<br>- When the downstream bounded context contains a core subdomain.</p><p>Anticorruption layer: The consumer translates the service provider’s model into a model that fits the consumer’s needs.</p><p>Open-Host Service: This pattern is often used in combination especially if you are implementing APIs. The format of the API is the “Published Language” and the “Open/Host service” indicates you are exposing this service to other.</p><p>Separate Ways: It’s less expensive to duplicate particular functionality than to collaborate and integrate it. This pattern should be avoided when integrating core subdomains.</p><h4>Context Map.</h4><p>Context map is a visual representation of the system’s bounded context and the integration between them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xLHvFTc2nDMjM1wWSvnWkA.png" /><figcaption>Complicated context map (extract from the book).</figcaption></figure><h3>Implementing Simple Business Logic.</h3><h4>Transaction Script.</h4><ul><li>A collection of business transactions that consumers can execute.</li><li>Each operation should either succeeded or fail but never result in an invalid state.</li><li>To ensure transactional behavior is to make the operation idempotent: that is, leading to the same result even if the operation repeated multiple times or the use optimistic concurrency control.</li><li>This pattern naturally fits supporting subdomains where, by definition, the business logic is simple.</li><li>Transaction scrips should never be used for core subdomains.</li><li>A Transaction Script organizes all this logic primarily as a single procedure, making calls directly to the database or through a thin database wrapper.</li><li>This patterns is some times consider as an anti-pattern.</li></ul><h4>Active Record.</h4><p>An object that wraps a row in a database table or view, encapsulates the database access, and adds domain logic on that data.</p><ul><li>Apart from data structure these objects also implement CRUD operations.</li><li>The objects are coupled to an ORM or some data access framework.</li><li>The pattern’s goal is to encapsulate the complexity of mapping the in-memory object to the database schema.</li><li>This pattern is also known as an anemic domain model anti-pattern. in other words, an improperly desined domain model.</li></ul><h3>Tackling Complex Business Logic.</h3><h4>Domain Model.</h4><p>DDD’s tactical patterns — aggregates, value objects, domain events and domain service — are building blocks of such a object model. These patterns share the common theme: they put the business logic first. Objects used on the modeling should not introduce any additional accidental complexities (objects to be plain objects).</p><h4>Value Objects.</h4><ul><li>A value object is an object that can be identified by the composition of its values.</li><li>There is no need to validate the values before the assignment, as the validation logic resides in the value object themselves.</li><li>Value objects expresses the business domain’s concepts: they make the code speak the ubiquitous language.</li><li>The value object removes the need for conventions.</li><li>Compare to an integer-base value, the Height value object makes the intent clear and decouples the measurement from a specific measurement unit.</li><li>Value Objects are implemented as immutable objects.</li><li>Value Objects describe an entity’s properties.</li></ul><h4>Aggregates.</h4><ul><li>An aggregate is an entity: it requires an explicit identification field and its state is expected to change during an instance’s lifecycle.</li><li>The aggregate logic has to validate all incoming modifications and ensure the the changes do not contradict its business rules.</li><li>Its state can only be mutated by executing corresponding methods of the aggregate’s public interface.</li><li>The state-modifying methods exposed as an aggregate’s public interface are often referred to as command.</li><li>An aggregates’s public interface is responsible for validating the input and enforcing all the relevant business rules and invariants.</li><li>It’s crucial to ensure that the database used for storing an aggregate’s data supports concurrency management.</li><li>All changes to the aggregate’s state should be committed transactionally as one atomic operation.</li><li>A change to an aggregate’s state can only be committed individually, one aggregate per database transaction.</li><li>The aggregate ensures that all the conditions are checked against strongly consistent data.</li><li>All information that can be eventually consistent should reside outside of the aggregate’s boundary.</li><li>Aggregates should reflect the ubiquitous language.</li></ul><h4>Domain Events.</h4><ul><li>A domain event is message describing a significant event that has occurred in the business domain.</li><li>Events should be formulated in the past tense.</li></ul><h4>Domain Service.</h4><ul><li>A domain service is a stateless object that implements the business logic.</li><li>Domain services make it easy to coordinate the work of multiple aggregates.</li><li>A stateless object that hosts business logic that naturally doesn’t belong to any of the domain model’s aggregates or value objects.</li></ul><h3>Modeling the Dimension of Time.</h3><h4>Event-Source Domain.</h4><ul><li>The event sourcing pattern introduces the dimension of time into the data model.</li><li>All changes to an aggregates’s state are expressed as a series of domain events.</li><li>The database that stores the system’s event is the only strongly consistent storage: the system’s source of truth.</li><li>The accepted name for the database that is used for persisting events is “event store”.</li><li>The event store should not allow modifying or deleting the events since it’s append-only storage.</li><li>When you append new events you also specify the version of the entity on which you are basing your decisions.</li><li>You can always reconstitute all the past states of an aggregate.</li><li>Event source provides the flexible model that allows for transforming the events into different state representations.</li><li>The persisted domain events represented a strongly consistent audit log of everything that has happened to the aggregates states.</li></ul><h3>Architectural Patterns.</h3><h4>Layered Architecture.</h4><p>Layered architecture is one of the most common architectural patterns. It organizes the codebase into horizontal layers, with each layer addressing one of the following technical concern: interaction with the consumers, implementing business logic, and persisting the data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fXgnOv1HgL_0Gf73ac8KzQ.png" /><figcaption>Layered architecture. (extract from the book)</figcaption></figure><h4>Ports &amp; Adapters.</h4><p>The <strong>Ports &amp; Adapters</strong> architecture addresses the shortcomings of the layered architecture and is a better fit for implementing more complex business logic. The goal of Ports &amp; Adapters is to decouple the system’s logic from its infrastructural components.</p><p>By decoupling the business logic from all <strong>technological</strong> concerns, Ports &amp; Adapters architecture becomes a perfect fit for business logic implemented with the <strong>Domain Model</strong> pattern.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TAqKSW11JAPNqlWEqrXB-g.png" /><figcaption>Ports &amp; adapters architecture. (extract from the book)</figcaption></figure><ul><li>The ports &amp; adapters architecture is also know as hexagonal architecture, onion architecture, and clean architecture.</li><li>Application layer = service layer = use case layer.</li><li>Business layer = domain layer = core layer.</li></ul><h4>Command-Query Responsibility Segregation.</h4><p>This pattern is based on the same organizational principles for business logic and infrastructural layers as <strong>Ports &amp; Adapters</strong>. However, it differs in how the system’s data is managed. This pattern enables the representation of the system’s data in multiple persistent models implementing one database for reading (optimized for queries) and another for writing (optimized for commands and transactional consistency).</p><p>The <strong>CQRS</strong> pattern is closely related to <strong>event sourcing</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*irBKQb_0sS7kYbPKfNNxLA.png" /><figcaption>CQRS architecture. (Extract from the book)</figcaption></figure><ul><li>Proper implementation of CQRS allows for wiping out all data of a projection and regenerating it from scratch.</li><li>The system can define as many models as needed to present to users or supply information to other systems: it is called <em>projections or read models.</em></li><li>A command should always let the caller know whether it has succeeded or failed.</li><li>The CQRS pattern can be useful for applications that need to work with the same data in multiple models, potentially stored in different kinds of database.</li></ul><h3>Communication Patterns.</h3><p>For <strong>stateless model translation,</strong> the bounded context that owns the translation (OHS for upstream, ACL for downstream) implements proxy design pattern to inject the incoming and outgoing request and map the source model. There are two types of stateless models synchronous and asynchronous. Asynchronous models can use an <em>API gateway pattern</em> to managing and serving multiple versions of the bounded context. Asynchronous models can implement a <em>message proxy.</em></p><p><strong>A stateful translation</strong> may be require when the translation mechanism has to aggregate the source data or unify data from multiple sources into a single model. You can use off-the-shelf products such as stream-process platform (Kafka, AWS Kinesis, etc.), or a batching solution (Apache NiFi, AWS Glue, Spark, etc.)</p><h4>Outbox</h4><p>The outbox pattern ensures reliable publishing of domain event using the following algorithm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YujMl4OTQqDuB-QpUubWtQ.png" /><figcaption>Outbox Pattern (Extract from the book)</figcaption></figure><ol><li>Both the updated aggregate’s state and the new domain events are committed in the same atomic transaction.</li><li>A message relay fetches newly committed events from the database.</li><li>The relay publishes the domain events to the message bus.</li><li>Upon successful publishing, the relay either marks the event as published in the database or deletes them completely.</li></ol><h4>Saga</h4><p>The saga pattern orchestrates a multicomponent transaction, the states of the involved components are eventually consistent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QMJ1b9hqfJi5UaXxAvwYHg.png" /><figcaption>Saga Pattern (Extract from the book)</figcaption></figure><p>Only the the data within an aggregate’s boundaries can be considered strongly consistent. Everything outside is eventually consistent.</p><p>The saga pattern is often confused with another pattern: process manager. Although the implementation is similar, these are different patterns. If a saga contains if-else statements to choose the correct course of action, it is probably a process manager.</p><h3>Design Heuristic</h3><p>When designing bounded contexts, start with wider boundaries. If required, decompose the wide boundaries into smaller ones as you gain domain knowledge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RSqwFgTvj7dK1ZoxXeRqYg.png" /><figcaption>Tactical design decision tree (extract from the book)</figcaption></figure><h3>Microservices.</h3><p>A service is a mechanism that enables access to one or more capabilities, where the access is provided using any mechanism for getting data in or out of a service. It can be synchronous, such as a request/response model, or asynchronous, such as a model that is producing and consuming events.</p><p>Micro-services encapsulate their databases. The data can only be accessed through a much more compact, integration-oriented public interface.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*woZREU1IX86zE48WtevDDQ.png" /><figcaption>Deep modules. (Extract from the book)</figcaption></figure><ul><li>The stronger the aggregate’s relationship is with the other business entities of its subdomain, the shallower it will be as an individual service.</li><li>The coherent nature of the use cases contained in a subdomain also ensures the resultant module’s depth.</li><li>From a system complexity standpoint, a deep module reduces the system’s global complexity.</li><li>Shallow services are also the reason why so many micro-services-oriented projects fail.</li></ul><p>The micro-services and bounded context patterns have a lot in common, so much so that the patterns are often used interchangeably. Microservices are indeed bounded contexts. Although microservices are bounded contexts, not every bounded context is a microservice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kjhC9ZoGKZ5mFXTfdgNY1w.png" /><figcaption>Granularity and modularity (extract from the book)</figcaption></figure><h3>Event-Driven Architecture.</h3><p>Event-driven architecture is an architectural style in which a system’s components communicate with one another asynchronously by exchanging event messages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2o8MXfycTEIRNd84QkPiUQ.png" /><figcaption>Event Driven Architecture. (Extract from the book)</figcaption></figure><p>Event: A message describing a change that has already happened.</p><p>Command: A message describing an operation that has to be carried out.</p><ul><li>Event notification: A notification that something important has happened, but requiring the consumer to query the producer for additional information explicitly.</li><li>Event-carried state transfer: A message-based data replication mechanism. Each event contains a snapshot of a state that can be used to maintain a local cache of the producer’s data.</li><li>Domain events: A message describing an event in the producer’s business domain.</li><li>When operating large data structures, it may be reasonable to include in the ECST message only the fields that were actually modified:</li><li>Instead of querying the data sources each time the data is needed, all the data can be cached locally.</li><li>Domain events include all the information describing the event. The consumer does not need to take any further action to get the complete picture.</li><li>The driven in event-driven architecture means your whole system depends on successful delivery of the messages.</li><li>Use the outbox pattern to publish message reliably.</li><li>When publishing messages, ensure that the subscribers will be able to deduplicate the messages and identify and reorder out-of-order messages.</li><li>Leverage the saga and process manager patterns when orchestrating cross-bounded context process.</li></ul><p>Assuming the worse:</p><ul><li>The network is going to be slow.</li><li>Servers will fail at the most inconvenient moment.</li><li>Events will arrive out of order.</li><li>Events will be duplicated.</li></ul><h3>Data Mesh</h3><p>OLAP models ignore the individual business entities and instead focus on business activities by modeling fact tables and dimension tables.</p><p>Fact Table: Represent business activities that have already happened. Fact records are never deleted or modified: analytical data is append-only data. The only way to express that current data is outdated is to append a new record with the current state.</p><p>Dimension Table: Are designed to describe the facts attributes and are referenced as a foreign key from a fact table to a dimension table.</p><p>Star schema: Each dimension record is used by many facts; a fact’s foreign key points to a single dimension record.</p><p>The snowflake schema: The dimensions are multilevel, each dimension is further normalized into more fine-grained dimensions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XmqTtiuRtcx6AVhuPd5ZFA.png" /><figcaption>Multilevel dimensions in the snowflake schema. (Extract from the book).</figcaption></figure><h4>Data Warehouse.</h4><p>The data warehouse (DWH) architecture is relatively straightforward. Extract data from all of the enterprise’s operational systems, transform the source data into an analytical model, and load the resultant data into a data analysis–oriented database: ETL scripts.</p><p>In some cases, the transformation may require temporary storage for the incoming data. This is known as the staging area.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*udJ-lPR-y4pvCWVNZvQxOg.png" /><figcaption>Typical enterprise data warehouse architecture (Extract from the book)</figcaption></figure><h4>Data Lake.</h4><p>A data lake–based system ingests the operational systems’ data. However, instead of being transformed right away into an analytical model, the data is persisted in its raw form, that is, in the original operational model.</p><p>A data lake–based system ingests the operational systems’ data. However, instead of being transformed right away into an analytical model, the data is persisted in its raw form, that is, in the original operational model.<br>Eventually, the raw data cannot fit the needs of data analysts. As a result, it is the job of the data engineers and the BI engineers to make sense of the data in the lake and implement the ETL scripts that will generate analytical models and feed them into a data warehouse.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TTKmKXlIiI9hIq9LKiP6bw.png" /><figcaption>Data lake architecture (Extract from the book).</figcaption></figure><h4>Data Mesh.</h4><p>The data mesh architecture is, in a sense, domain-driven design for analytical data. The data mesh architecture is based on four core principles: decompose data around domains, data as a product, enable autonomy, and build an ecosystem.</p><p>Each bounded context now owns its operational (OLTP) and analytical (OLAP) models. Consequently, the same team owns the operational model, now in charge of transforming it into the analytical model.</p><p>The ubiquitous language and the resultant domain knowledge are essential for designing analytical models.</p><p>The data as a product principle calls for treating the analytical data as a first-class citizen.</p><p>The primary principle of DDD is to organize the system into distinct domains, facilitating adaptability to changes and improving communication efficiency between teams. Throughout the book, various design solutions are explored in relation to DDD, with a focus on utilizing the ubiquitous language as the cornerstone of domain-driven design.</p><p>This book opened my eyes to various strategies for storing data, designing systems, and communicating between different components. The content is incredibly easy to read and is accompanied by numerous illustrations that enhance understanding of the topics. Additionally, the book contains references to other works, which complement the information provided. While Domain-Driven Design (DDD) is a methodology not tied to a specific programming language, the book emphasizes the usage of Object-Oriented Programming (OOP) and many online courses predominantly use Java.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e2cdc746da8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My journey solving 150 LeetCode problems]]></title>
            <link>https://medium.com/@Isidro/coding-journey-solving-150-leetcode-problems-410f835fea32?source=rss-396512e58904------2</link>
            <guid isPermaLink="false">https://medium.com/p/410f835fea32</guid>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[code-challenge]]></category>
            <category><![CDATA[leetcode]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Isidro Martínez]]></dc:creator>
            <pubDate>Mon, 11 Mar 2024 05:49:16 GMT</pubDate>
            <atom:updated>2024-10-16T19:16:16.080Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AYA_ZPqFf98zp7j_aR_gYg.jpeg" /></figure><p>Last year, I found myself with plenty of free time to engage in various activities, and though I wasn’t heavily focused on coding, I decided to commit to a personal challenge: solving 150 code problems. Despite enjoying coding and the satisfaction of solving challenges independently, the primary goal was to become familiar with a broad range of code problems, identify patterns, and gain proficiency in solving various types of challenges. This exploration allowed me to make informed decisions about whether I truly wanted to master specific fields by tackling additional code problems. It’s worth noting that my background lies in being a Software Backend Engineer.</p><h4>Code Challenges in an Interview</h4><p>Solving code challenges is not something new for me; it’s a common aspect of software engineer interviews. I’ve been practicing with easy problems for a while, mostly related to arrays and hash-maps, which are the most common. In many interviews, companies require you to solve easy code challenges, and if completed, they may you require to solve a medium-level problems. While code challenges aren’t the main focus of a software interview, many companies use them as a primary filter. There’s an ongoing debate about this, as proficiency in solving code challenges doesn’t always correlate with real-world coding abilities and experience in the field. Recently, I’ve observed a shift where more companies ask candidates to develop small applications within a short timeframe, shareable via GitHub or a zip file. This approach may better assess a developer’s ability to recognize patterns in a system, write clean code, and adhere to best practices in software development.</p><h4>Complexity.</h4><p>When solving a code challenge, optimization is a crucial criteria. There are various ways to solve the same problem, and being able to provide the most efficient solution is expected. The algorithm’s complexity is often measured by Big O Notation. During interviews, it is common to indicate both the space and time complexity of your algorithm. Linear complexity, O(n), is typically associated with simpler code challenges.</p><h4>About LeetCode.</h4><p>Many websites offer code challenges, but the ones I’ve personally liked and tried are listed below.</p><ul><li><a href="https://leetcode.com/">https://leetcode.com/</a></li><li><a href="https://www.hackerrank.com/">https://www.hackerrank.com/</a></li><li><a href="https://www.geeksforgeeks.org/">https://www.geeksforgeeks.org/</a></li></ul><p>LeetCode stands out as one of the most popular platforms, boasting a large and collaborative community where users often assist each other with code problems and offer recommendations for interviews at leading companies like Apple, Amazon, Google, Microsoft, Meta, and more. LeetCode’s paid plan even allows users to simulate real interviews for these top companies. The platform hosts weekly global contests, drawing an impressive number of participants eager to take on these challenges.</p><p><a href="https://clist.by/resource/leetcode.com/">https://clist.by/resource/leetcode.com/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*5M-_l4qVnubthpZrlHbWdQ.png" /><figcaption>Leetcode contest Country distribution</figcaption></figure><p>Mexico was in the position 22 with <a href="https://leetcode.com/Tlatoani/">this guy (Tlatoani) l</a>eading the board.</p><h4>The Language.</h4><p>I didn’t find a chart for top programming languages used in Leetcode, however I would say that Python is the most popular due to its flexibility and human readability. However, I have seen a lot of submissions Java and C++ too, I believe most of these people use these languages for performance purposes.</p><h4>My profile.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U7j083iwodU2R-2eU_cLnA.png" /><figcaption>Leetcode profile screenshot — 2024</figcaption></figure><p><a href="https://leetcode.com/isidroamv/">https://leetcode.com/isidroamv/</a></p><p>I’ve tackled around 150 problems, solving about 80% or 85% independently. Some challenges demanded hours of effort, while others led me to give up after multiple attempts, especially those involving dynamic programming and graphs. My primary language was Python, with occasional use of Java. This is the study plan I took. <a href="https://leetcode.com/studyplan/top-interview-150/">https://leetcode.com/studyplan/top-interview-150/</a></p><h3>Tips for code challenges.</h3><h4>Minimize the number of check conditions in the loop.</h4><pre># This code has 2 checks in the loop<br>def find_max_number(arr):<br>    if not arr:<br>        return None<br>    result = None    <br>    for num in arr:<br>        # 2 checks in the loop<br>        if result is None or num &gt; result:<br>            result = num<br>    return result<br><br><br># The previous code can be improved by reducing the checks to 1<br>def find_max_number(arr):<br>    if not arr:<br>        return None<br>    result = arr[0]<br>    for num in arr[1:]:<br>        # 1 check in the loop<br>        if num &gt; result:<br>            result = num<br>    return result<br><br><br># Another alternative if is initialize the code the the inf values<br>def find_max_number(arr):<br>    if not arr:<br>        return None<br>    result = float(&#39;-inf&#39;)<br>    for num in arr:<br>        # 1 check in the loop<br>        if num &gt; result:<br>            result = num<br>    return result<br></pre><h4>The usage of Set.</h4><p>Sets are less commonly used than arrays in software development, but their usage can be highly beneficial as they automatically eliminate duplicates from a collection. Consider the following example that reduces complexity from O(nˆ2) to O(n).</p><pre><br># The complexity of this is O(nˆ2)<br>def find_duplicates(arr):<br>    duplicates = []<br><br>    for i in range(len(arr)):<br>        for j in range(i + 1, len(arr)):<br>            if arr[i] == arr[j] and arr[i] not in duplicates:<br>                duplicates.append(arr[i])<br><br>    return duplicates<br><br># The usage of set reduce the complexity to O(n)<br>def find_duplicates(arr):<br>    seen = set()<br>    duplicates = set()<br>    <br>    for num in set(arr):<br>        if num in seen:<br>            duplicates.add(num)<br>        else:<br>            seen.add(num)<br><br>    return list(duplicates)</pre><h4>Binary Search</h4><p>The Binary Search algorithm is a crucial topic on LeetCode, offering exceptional efficiency for searching values in ordered lists. Understanding this algorithm is highly important, as its efficiency is commonly applied in real-world software development. Based on the concept of dividing the array in half and searching in a specific section, this algorithm is widely discussed in numerous online articles. The following algorithm is basic example of a binary search.</p><pre>def binary_search(arr, target):<br>    # Set pointers at the beginning and end of the array<br>    low, high = 0, len(arr) - 1<br>    <br>    # Continue until the pointers meet<br>    while low &lt;= high: <br>        # Calculate the middle position - important to rememeber this formula<br>        mid = (low + high) // 2 <br>        <br>        if arr[mid] == target:<br>            # Target found, return its index<br>            return mid  <br>        elif arr[mid] &lt; target:<br>            # Search the right half<br>            low = mid + 1  <br>        else:<br>            # Search the left half<br>            high = mid - 1  <br>    <br>    # Target not found in the array<br>    return -1</pre><h4>Slow and Fast</h4><p>Employing a 2-pointer strategy in a linked list is a valuable approach. The concept is simple: the slow pointer advances by one, and the fast pointer advances by two. As long as the fast pointer is not null, you can implement logic for the slow pointer. For instance, the following code checks for duplicate values in a linked list.</p><pre>def has_cycle(head):<br>    # Check if the linked list is empty or has only one node<br>    if not head or not head.next:<br>        return False  # No cycle in this case<br><br>    # Initialize slow and fast pointers<br>    slow = head<br>    fast = head.next<br><br>    # Iterate through the linked list<br>    while fast and fast.next:<br>        # Check if slow and fast pointers meet, indicating a cycle<br>        if slow == fast:<br>            return True  # Cycle detected<br><br>        # Move slow one node per iteration<br>        slow = slow.next<br>        # Move fast two nodes per iteration<br>        fast = fast.next.next<br><br>    return False  # No cycle found</pre><h4>DFS (Depth First Search) with data in memory</h4><p>Depth-First Search (DFS) is a widely-used algorithm for traversing data structures like trees or graphs. It starts from the root node, explores each branch’s edges before backtracking. To prevent duplicate values in the result, an array is used to store already visited values in memory. While this algorithm may take various forms, a basic structure can be visualized in the following example:</p><pre>def generate_combinations(characters, length):<br>    def dfs(length, current_combination, seen):<br>        # Base case: If the desired length is achieved, add the current combination to the result<br>        if length == 0:<br>            all_combinations.append(&#39;&#39;.join(current_combination))<br>            return<br><br>        # Explore all possible characters<br>        for char in characters:<br>            # Check if the character is not already used in the current combination<br>            if char not in seen:<br>                current_combination.append(char)<br>                # Mark the character as visited<br>                seen.add(char)<br>                # Recursively explore combinations with the reduced length<br>                dfs(length - 1, current_combination, seen)<br>                # Backtrack: Remove the last character to explore other possibilities<br>                current_combination.pop()<br>                # Release the character from the visited set for future exploration<br>                seen.remove(char)<br><br>    # Initialize the result list and start the depth-first search<br>    all_combinations = []<br>    dfs(length, [], set())<br>    return all_combinations</pre><h4>Dynamic Programming.</h4><p>Dynamic programming is a powerful algorithm that enhances code performance by reusing previously calculated solutions, often stored in an array. A classic example is a coin change problem, where it efficiently counts the ways to make change.</p><pre>def count_ways_to_make_change(coins, amount):<br>    # Initialize an array to store the results of subproblems<br>    dp = [0] * (amount + 1)<br>    <br>    # There is one way to make change for amount=0, i.e., using no coins<br>    dp[0] = 1<br><br>    # Iterate over each coin and update the table<br>    for coin in coins:<br>        # Iterate from the coin value to the target amount<br>        for i in range(coin, amount + 1):<br>            # Reuse the already calculated problem to update <br>            # the number of ways to make change <br>            dp[i] += dp[i - coin]<br><br>    return dp[amount]</pre><p>There are a bunch of cool algorithms out there, like bit manipulations, HashMaps (super common), Trie, min heap, max heap, math tricks, hashing, sorting, and more. However, the algorithms I described are the ones I’ve encountered frequently and found them interesting. I see solving coding challenges as a creative process that requires a solid foundation in algorithms. While I won’t be focusing as much on this topic in the coming months, I’ve enjoyed the process of solving code challenges.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=410f835fea32" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Book review: Head First Design Patterns.]]></title>
            <link>https://medium.com/@Isidro/book-review-head-first-design-patterns-dd21a38b6593?source=rss-396512e58904------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd21a38b6593</guid>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[book-review]]></category>
            <category><![CDATA[pattern-designing]]></category>
            <dc:creator><![CDATA[Isidro Martínez]]></dc:creator>
            <pubDate>Mon, 05 Feb 2024 06:06:15 GMT</pubDate>
            <atom:updated>2024-02-05T06:13:50.935Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/398/1*gp0jKkOUow6G91RQkC90tg.jpeg" /></figure><p>This year, I made a commitment to delve into more than 10 books centered around Software Engineering. “Head First Design Patterns” is the second book I’ve chosen to explore, as it addresses fundamental aspects of software development. Despite encountering these patterns in various projects throughout my career, I haven’t delved into the details of pattern design. Additionally, I haven’t had the chance to read a “Head First” book before. This seemed like the perfect opportunity to dive into both areas.</p><p>Similar to other Head First books, the content is presented in an easily digestible manner, incorporating jokes, images, and puzzles. Key phrases are reiterated in various ways, enhancing your brain’s ability to grasp the underlying concepts effortlessly. The book encourages the readers to solve puzzles and participate in activities. Inspired by this interactive approach, I’ve decided to transcribe the Java code from the book into TypeScript code.</p><p>Here are some notes I took and the typescript code.</p><blockquote>Identify the aspects of your application that vary and separate them from stays the same</blockquote><blockquote>Program to an interface not an implementation. Favor composition over inheritance.</blockquote><p><strong>The Strategy Patter: </strong>Defines a family of algorithms, encapsulate them and makes them interchangeable. Strategy let’s the algorithm vary independently from clients that use it.</p><ul><li><a href="https://github.com/isidroamv/design-patterns-typescript/tree/main/Chapter%201">https://github.com/isidroamv/design-patterns-typescript/tree/main/Chapter%201</a></li></ul><pre><br>// Strategy and Composition Pattern example<br>const d = new RuberDuck();<br>// Use Composition Pattern implemented in the Duck class to perform behavior<br>d.performFly(); // Output: &quot;I&#39;m flying with a rocket!&quot;<br>d.performQuack(); // Output: &quot;Quack&quot;<br><br>// Use Strategy Pattern to change behavior<br>d.flyBehavior = new FlyNoWay();<br>d.performFly(); // Output: &quot;I can&#39;t fly :(&quot;<br><br><br>// Strategy Pattern example<br>const k = new King();<br>k.fight(); // Output: &quot;I&#39;m using a knife&quot;<br><br>k.weapon = new SwordBehavior();<br>k.fight(); // Output: &quot;I&#39;m using a sword&quot;</pre><blockquote>Patterns allows you to say more with less. When you use a pattern in a description other developers quickly know precisely the design you have in mind.</blockquote><blockquote>There are some object-oriented principles that underline the patterns and knowing these will help you to cope when you can’t find a pattern that matches your problem.</blockquote><blockquote>One of the secrets to create maintainable OO System is thinking about how they might change in the future, the pattern design address those issues. Change is constant in software development.</blockquote><p><strong>The Observer Pattern</strong> defines a one-to-many dependency between objects so that when one object changes state, all of its dependents are notified and updated automatically.</p><ul><li><a href="https://github.com/isidroamv/design-patterns-typescript/tree/main/Chapter%202">https://github.com/isidroamv/design-patterns-typescript/tree/main/Chapter%202</a></li></ul><pre>// Client code for Observer pattern<br><br>const weatherData = new WeatherData();<br>const cd = new CurrentConditionsDisplay(weatherData);<br><br>// Simulate measurements<br>// The WeatherData object will notify all observers when measurements change<br>weatherData.setMeasurements(80, 65, 30.4); // Output: 80F degrees and 65% humidity<br>weatherData.setMeasurements(82, 70, 29.2); // Output: 82F degrees and 70% humidity</pre><blockquote>Loosely coupled: Objects can interact, but they typically have very little knowledge of each other. Strive for loosely coupled designs between objects that interact.</blockquote><blockquote>Classes should be open for extensions, but closed for modifications.</blockquote><p><strong>The decorator pattern</strong> attaches additional responsibilities to an object dynamically. Decorator provides a flexible alternative to subclassing for extending functionality.</p><ul><li><a href="https://github.com/isidroamv/design-patterns-typescript/tree/main/Chapter%203">https://github.com/isidroamv/design-patterns-typescript/tree/main/Chapter%203</a></li></ul><pre>// Client code for the decorator pattern<br><br>let beverage1: Beverage = new HouseBlend(); // Make a HouseBlend object<br>beverage1.size = Size.TALL;<br><br>beverage1 = new Soy(beverage1); // Decorate it Wraping it with Soy<br>beverage1 = new Soy(beverage1); // Decorate it Wraping it in a second Soy<br>beverage1 = new Mocha(beverage1); // Decorate it Wraping it with Mocha<br>beverage1 = new Whip(beverage1); // Decorate it Wraping it with whip<br><br>console.log(beverage1.description + &quot; $&quot; + beverage1.cost.toFixed(2));</pre><p>The<strong> factory method pattern</strong> defines an interface for creating an object but let’s subclasses decide which class to instantiate.</p><ul><li><a href="https://github.com/isidroamv/design-patterns-typescript/tree/main/Chapter%204">https://github.com/isidroamv/design-patterns-typescript/tree/main/Chapter%204</a></li></ul><pre>// Client code for factory method pattern<br><br>const nyPizza = new NYPizzaStore();<br>const chicagoPizza = new ChicagoPizzaStore();<br><br>let pizza = nyPizza.order(&quot;cheese&quot;);<br>console.log(&quot;Ethan ordered a &quot; + pizza.name + &quot;\n&quot;);<br><br>pizza = chicagoPizza.order(&quot;veggie&quot;);<br>console.log(&quot;Ethan ordered a &quot; + pizza.name + &quot;\n&quot;);</pre><blockquote>Depend upon abstractions. Do not depend upon concrete classes.</blockquote><blockquote>A “High-level” (abstract operations)component is a class with behavior in terms of other “Low-level” components. High-level components should not depend on our low-level component, rather, they should both depend on abstractions.</blockquote><p>Dependency inversion variations:</p><ul><li>No variables should hold a reference for a concrete class.</li><li>No class should derive from a concrete class. (It should derive from abstractions).</li><li>No method should override an implemented method of any of its base class.</li></ul><p><strong>The abstract Factory pattern </strong>provides an interface for creating families of related or dependent on objects without specifying their concrete classes.</p><ul><li><a href="https://github.com/isidroamv/design-patterns-typescript/tree/main/Chapter%204">https://github.com/isidroamv/design-patterns-typescript/tree/main/Chapter%204</a></li></ul><pre>// Client code for Abstract Factory patterns<br><br>import { NYPizzaStoreV2 } from &quot;./AbstractFactory&quot;;<br><br>// Abstract Factory pattern example<br>const nyPizzaStore = new NYPizzaStoreV2();<br>nyPizzaStore.order(&quot;pepperoni&quot;);</pre><p><strong>Singleton</strong> — Ensure a class only has one instance and provide a global point of access to it.</p><ul><li><a href="https://github.com/isidroamv/design-patterns-typescript/tree/main/Chapter%205">https://github.com/isidroamv/design-patterns-typescript/tree/main/Chapter%205</a></li></ul><pre>// Client code for Singleton pattern<br><br>const boiler = ChocolateBoiler.getInstance();<br>boiler.fill();<br>boiler.boil();<br>boiler.drain();<br><br>if (boiler === ChocolateBoiler.getInstance()) {<br>    console.log(&quot;Singleton works, both variables contain the same instance.&quot;);<br>}</pre><p><strong>The command pattern</strong> encapsulates a request as an object, thereby letting you parameterize other objects with different request, queue or log requests and support undoable operations.</p><ul><li><a href="https://github.com/isidroamv/design-patterns-typescript/tree/main/Chapter%206">https://github.com/isidroamv/design-patterns-typescript/tree/main/Chapter%206</a></li></ul><pre>// Client code for Command Pattern<br><br>const remote = new RemoteControl();<br>const light = new Light();<br>const garageDoor = new GarageDoor();<br>const stereo = new Stereo();<br><br>remote.setCommand(0, new LightOnCommand(light), new LightOffCommand(light));<br>remote.buttonWasPressed(0);<br>remote.undoButtonWasPressed();<br>remote.setCommand(1, new GarageDoorOpenCommand(garageDoor), new GarageDoorCloseCommand(garageDoor));<br>remote.buttonWasPressed(1);<br>remote.setCommand(2, new StereoOnWithCDCommand(stereo), new StereoOffCommand(stereo));<br>remote.buttonWasPressed(2);<br>remote.buttonWasPressed(5);</pre><p><strong>Adapter</strong> lets classes work together that couldn’t otherwise because of incompatible interfaces.</p><ul><li><a href="https://github.com/isidroamv/design-patterns-typescript/tree/main/Chapter%207">https://github.com/isidroamv/design-patterns-typescript/tree/main/Chapter%207</a></li></ul><pre>// Client code for adapter example<br><br>const duck = new MallardDuck();<br>const turkey = new WildTurkey();<br>const turkeyAdapter = new TurkeyAdapter(turkey);<br><br>duck.fly();<br>duck.quack();<br><br>turkeyAdapter.fly();<br>turkeyAdapter.quack();</pre><p><strong>Facade</strong> defines a higher-level interface that makes the subsystem easier to use.</p><ul><li><a href="https://github.com/isidroamv/design-patterns-typescript/tree/main/Chapter%207">https://github.com/isidroamv/design-patterns-typescript/tree/main/Chapter%207</a></li></ul><pre>// Client for Template Pattern<br><br>const tea = new Tea();<br>const coffee = new Coffee();<br><br>tea.prepareRecipe();<br>coffee.prepareRecipe();</pre><blockquote><strong>The Hollywood principle</strong>: Don’t call us, we call you. A technique for creating a design that allow low-level structures to interoperate while preventing other classes from becoming too dependent on them.</blockquote><p><strong>Template method </strong>lets subclasses redefine certain steps of an algorithm without changing the algorithm structure.</p><ul><li><a href="https://github.com/isidroamv/design-patterns-typescript/tree/main/Chapter%208">https://github.com/isidroamv/design-patterns-typescript/tree/main/Chapter%208</a></li></ul><pre>// Client code for a Template Pattern <br><br>const tea = new Tea();<br>const coffee = new Coffee();<br><br>tea.prepareRecipe();<br>coffee.prepareRecipe();</pre><p><strong>The iterator pattern</strong> provides a way to access the elements of an aggregate object sequentially without exposing its underlying representation.</p><ul><li><a href="https://github.com/isidroamv/design-patterns-typescript/tree/main/Chapter%209">https://github.com/isidroamv/design-patterns-typescript/tree/main/Chapter%209</a></li></ul><pre><br>// Correct implementation of the iterator pattern<br>const menu1 = new DinnerMenuIterator([<br>    new MenuItem2(&quot;Vegetarian BLT&quot;, &quot;(Fakin&#39;) Bacon with lettuce &amp; tomato&quot;, true, 2.99),<br>    new MenuItem2(&quot;BLT&quot;, &quot;Bacon with lettuce &amp; tomato&quot;, false, 2.99),<br>]);<br><br>const menu2 = new CafeMenuIterator({<br>    breakfast: new MenuItem2(&quot;Pancakes&quot;, &quot;Pancakes with scrambled eggs, and toast&quot;, true, 2.99),<br>    lunch: new MenuItem2(&quot;Soup of the day&quot;, &quot;Soup of the day, with a side of potato salad&quot;, false, 3.29),<br>});<br><br>const menu = new WaitreesMenu(menu1, menu2);<br>menu.printMenu();</pre><blockquote><em>A class should have only one reason to change.</em></blockquote><p><strong>Composite</strong> compose object into tree structures to represent part-whole hierarchies. Composite let’s clients treat individual objects and compositions of objects uniformly.</p><ul><li><a href="https://github.com/isidroamv/design-patterns-typescript/tree/main/Chapter%209">https://github.com/isidroamv/design-patterns-typescript/tree/main/Chapter%209</a></li></ul><pre>// Client code, using the composite design pattern with submenus<br><br>const pancakeHouseMenu = new Menu(&quot;PANCAKE HOUSE MENU&quot;, &quot;Breakfast&quot;);<br>const dinerMenu = new Menu(&quot;DINER MENU&quot;, &quot;Lunch&quot;);<br>const cafeMenu = new Menu(&quot;CAFE MENU&quot;, &quot;Dinner&quot;);<br>const dessertMenu = new Menu(&quot;DESSERT MENU&quot;, &quot;Dessert of course!&quot;);<br><br>const allMenus = new Menu(&quot;ALL MENUS&quot;, &quot;All menus combined&quot;);<br>allMenus.add(pancakeHouseMenu);<br>allMenus.add(dinerMenu);<br>allMenus.add(cafeMenu);<br><br><br>dinerMenu.add(new MenuItem3(&quot;Pasta&quot;, &quot;Spaghetti with Marinara Sauce, and a slice of sourdough bread&quot;, true, 3.89));<br>dessertMenu.add(new MenuItem3(&quot;Apple Pie&quot;, &quot;Apple pie with a flakey crust, topped with vanilla ice cream&quot;, true, 1.59));<br>dinerMenu.add(dessertMenu);<br><br>const waitress = new Waitress(allMenus);<br>waitress.printMenu();</pre><p><strong>State</strong> allows an object alter its behavior when its internal state changes. The object will appear to change its class.</p><ul><li><a href="https://github.com/isidroamv/design-patterns-typescript/tree/main/Chapter%2010">https://github.com/isidroamv/design-patterns-typescript/tree/main/Chapter%2010</a></li></ul><pre>// Client code using the state pattern<br><br>const gumballMachine = new GumballMachine(1);<br>gumballMachine.insertQuarter();<br>gumballMachine.ejectQuarter();<br>gumballMachine.turnCrank();<br><br>gumballMachine.insertQuarter();<br>gumballMachine.turnCrank();<br><br>gumballMachine.insertQuarter();<br>gumballMachine.turnCrank();<br><br>gumballMachine.refill(2);</pre><p><strong>Proxy</strong> provide a surrogate or placeholder for another object to control access to it.</p><ul><li><a href="https://github.com/isidroamv/design-patterns-typescript/tree/main/Chapter%2011">https://github.com/isidroamv/design-patterns-typescript/tree/main/Chapter%2011</a></li></ul><pre>// Client code using the proxy pattern<br><br>const youTubeService = new YouTubeLib();<br>const youTubeProxy = new CachedYouTubeLib(youTubeService);<br>const manager = new YouTubeManager(youTubeProxy);<br><br>// The first attempt gets the data from the youTubeService<br>manager.reactOnUserInput();<br><br>// The second attempt gets the data from the cache<br>manager.reactOnUserInput();</pre><p>In general, the book has delve into various patter designs in a easy manner. However, some examples in the book appear kind somewhat outdated, as the first publication took place around 20 years ago. For instance, consider the Proxy pattern, initially proposed for Remote Method Invocation (RMI), a protocol that is not widely used today. Nevertheless, the same Proxy pattern can be effectively applied to interact with modern REST applications.</p><p>Book: <a href="https://www.goodreads.com/book/show/58128.Head_First_Design_Patterns">https://www.goodreads.com/book/show/58128.Head_First_Design_Patterns</a></p><p>Repository: <a href="https://github.com/isidroamv/design-patterns-typescript">https://github.com/isidroamv/design-patterns-typescript</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd21a38b6593" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Book Review: Architecting for Scale: High Availability for Your Growing Applications.]]></title>
            <link>https://medium.com/@Isidro/book-review-architecting-for-scale-high-availability-for-your-growing-applications-61c6f34faf47?source=rss-396512e58904------2</link>
            <guid isPermaLink="false">https://medium.com/p/61c6f34faf47</guid>
            <category><![CDATA[scalability]]></category>
            <category><![CDATA[book-review]]></category>
            <category><![CDATA[software-architecture]]></category>
            <dc:creator><![CDATA[Isidro Martínez]]></dc:creator>
            <pubDate>Thu, 11 Jan 2024 18:13:30 GMT</pubDate>
            <atom:updated>2024-01-11T18:13:30.981Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mOZPTrcd47oqH36XJfLVfw.jpeg" /><figcaption>Software architecting for scale (Generated by Bing with AI)</figcaption></figure><p>This year I finished reading this book as part of my plan to read more books about Software Architecture. The book was written by <strong>Lee Atchison, </strong>it was first publish on 2016 and it covers in a simple manner multiple topics for scaling software.</p><p>I recommend this book for people who are starting learning about Software Architecture or you if your are looking for some recommendations when you are scaling your organization. This book you covers topics like strategies to mitigate risk, measure availability, SLA, the use of Tiers and strategies to prevent risk.</p><p>Within this summary, I have encapsulated insights and key takeaways that hold particular significance for my journey and understanding of software architecture</p><h3>Mitigate Risk</h3><p><strong>Risk Management</strong>: How much risk is accepted in a given project.</p><p><strong>Risk Mitigation:</strong> A plan defined when an error happens.</p><h4>Risks</h4><ul><li>Server will crash.</li><li>Database will became corrupted.</li><li>Response will be incorrect.</li><li>Network connection will fail.</li><li>Deployed piece will fail.</li></ul><h3>Monitoring</h3><ul><li>Server monitoring.</li><li>Configuration changes monitoring.</li><li>Application performance monitoring.</li><li>Synthetic testing ( Simulate a normal user flow).</li><li>Alerting (Identify trend and outliers).</li></ul><h3>Define way to respond to issues.</h3><ul><li>Establish a process to help to diagnose issues.</li><li>The owner should be alerted first, then the other teams that depend on the service.</li></ul><h3>Measure Availability</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Oj6qLCHMcxQyrBS29Q4Xeg.png" /></figure><pre>+--------+-------------+-----------------+<br>| Nines  | Percentage  | Monthly Outage  |<br>+--------+-------------+-----------------+<br>|   2    | 99%         | 432 Minutes     |<br>|   3    | 99.9%       | 43 Minutes      |<br>|   4    | 99.99%      | 4 Minutes       |<br>|   5    | 99.999%     | 26 Seconds      |<br>|   6    | 99.9999%    | 2.6 Seconds     |<br>+--------+-------------+-----------------+</pre><ul><li>3 Nines are commonly accepted for a basic web application, (43 minutes down per month).</li><li>You should monitor the availability percentage and report the results.</li><li>Use tiers from 1 to 4 to assess the importance level of a service.</li><li>You should never perform manual operations on production.</li><li>Test your changes before implement them.</li><li>If a task is repeatable it is a high candidate to be automated.</li><li>Automate deploys and never accept bypass the configuration management system</li><li>Have a record of changes in your system and implement it automated change sanity testing.</li></ul><h3>Improve your system</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CaU8dUdN-tCu1svATP2YEA.png" /></figure><p>This matrix is document that you can use as reference to mitigate the risks identified in your system. This matrix can be use one per team for big companies or just one matrix document for the entire company for small companies. You should maintain this document updated and remove the worst offenders (It is recommended to review monthly and updated every time you note a new risk).</p><p>This matrix should be populated this table with the information from: Dev team, Support, feature backlog, technical debt, business owners, performance, system and process.</p><ul><li>The significance of a risk is the combination of the severity of the risk happening with the likelihood of it happening.</li><li>A mitigation plan is a plan for how you are going to put in changes that are designed to either reduce the severity of the risk or reduce the likelihood.</li><li>Low likelihood/ Low severity don’t need to be mitigated.</li></ul><h3>Recovery Plan</h3><ul><li>You should have a plan when a external disaster affect your system (Disaster recovery plan).</li><li>It should be part of the culture to regularly test the recovery plan and other risk.</li><li>Game day is a test strategy that invoke failures and see how the team respond to it (Usually in dev environment). You can use control actions to test on production.</li></ul><p>Your recover plan should contain:</p><ul><li>Details of what must be happening that would trigger the recovery plan to be implemented.</li><li>The list of actors that need to be involved in implementing the recovery plan.</li><li>Step-by-step instructions for implementing the recovery plan, and which actor should execute those steps.</li><li>Management, escalation, and notifications that need to be informed.</li><li>Required follow-up that must happen after the problem is resolved.</li></ul><h3>Redundancy</h3><ul><li>Design your app to run in multiple servers.</li><li>Design your app to run in independently tasks.</li><li>Design your app to run in parallel tasks.</li><li>Localize the state into specific areas. (develop stateless preferable).</li><li>Utilize <a href="https://www.baeldung.com/cs/idempotent-operations">idempotent interface.</a></li></ul><h3>Self Repair Strategies</h3><ul><li>A load balancer that reroutes traffic to a new server when a previous server fails.</li><li>A “hot standby” database that is kept up to date with the main production database.</li><li>A service that retries a request if it gets an error, anticipating that perhaps the original request suffered a transient problem.</li><li>A queuing system that keeps track of pending work so that if a request fails, it can be rescheduled to a new worker later.</li></ul><h3>Microservices.</h3><ul><li>The teams can focus on the specific scaling and availability requirements of their system.</li><li>Complexity localization: You can think about services as black boxes.</li><li>Service-based architectures are easier to test.</li><li>Microservice should have a contract (API) and Service Level Agreement (SLA).</li><li>Your system can be splited into microservices when the business requirements are different, you can separe the ownership, the date is separable, it contains shared capabilities.</li><li>No more than 8 developer per microservices is recommended.</li><li>A single team can operate more than one service.</li></ul><h3>Determining Failures</h3><ul><li>The response was not understandable.</li><li>The response indicate a fatal error.</li><li>The result is out of the expected bounds.</li><li>Response did not arrive.</li><li>The response was slow in arriving.</li><li>Circuit breaker pattern can be implemented to notify the issue.</li></ul><h3>Appropriated actions.</h3><ul><li>Graceful degradation: Reduce the features of your service.</li><li>Graceful backoff: Show a different alternative for your users.</li><li>Fail early as possible: Don’t call other services if you already detect the error.</li><li>Provide service limits (such as pagination).</li></ul><h3>Scaling applications.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vHlEhwu8prjZSaiD_bmXfg.png" /></figure><ul><li>You should always have a backup plan for recovering from a mistake.</li><li>Thread your backup and redundant system just preciusly as you treat your primary system.</li><li>1 extra node will handle traffic but will not handle a not failure.</li><li>2 extra nodes will handle failure but will not handle upgrade or maintainance.</li><li>3 extra nodes will handle multiple failures while other nodes are down for maintainance.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OjjTo-Ce1ttO-o60Jw85eQ.png" /></figure><h3>Service Tiers.</h3><p>Tier 1: A service is considered Tier 1 if a failure of that service will result in a significant impact to customers or to the company’s bottom line.</p><p>Tier 2: A service that affect your backend business processes in significant ways, but might not be directly noticeable to your customers.</p><p>Tier 3: A service that can have minor, unnoticeable, or difficult-to-notice customer impact, or have limited effect on your business and systems.</p><p>Tier 4: A service that when it fails, causes no significant effect on the customer experience and does not significantly affect the customer’s business or finances.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RO1O0Qtbynzn60WU0_nTKg.png" /><figcaption>Service tier of service with problem</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6rlvfaYbNxGoOMS6mPEX4A.png" /><figcaption>\</figcaption></figure><h3>Service Level Agreements (SLA).</h3><ul><li>SLA are about building trust in a highly distributed in a scalable way.</li><li>You should have SLA in critical areas of your business.</li><li>You should have a dashboard to monitor your SLA.</li><li>SLA should be part of your language when talking with other teams.</li><li>SLA can be measure by: call latency, traffic volume, uptime, error rates, latency groups.</li></ul><h3>Continue Improvement</h3><ul><li>The sooner we consider scalability in the lifecycle of an application the easier it will be to scale.</li><li>Move your system to a distributed ownership model.</li><li>Use stateless servers so the service can manage no data and state for their own.</li><li>Use functional partitioning to split your dataset base on functional lines.</li><li>Choosing your partition key is critical, in general, account name or account id is always a bad partition key. A better partition key would be one that result in consistently sized as much partition as possible.</li></ul><h3>Distributing the cloud.</h3><ul><li>In AWS, the goal is to make access between any server within a region without concerning for the AZ.</li><li>If your application wants to be in multiple regions multiple copies of the application are typically run independently, one copy within each region is desired.</li><li>Two EC2 instances created in different account may or may not be in the same data center, even if the AZ is different.</li><li>Make sure you maintain a redundant components in distinct AZ within a single account. If you have redundant components that are in multiple accounts, make sure you maintain redundancy in multiple AZ within each account individually.</li><li>Dynamic containers are great for easy deployment of complex app in a microservice base application.</li><li>Microcompute is optimized for high volume data streaming and event processing.</li><li>Lambda removes the concerns around scalability. It gives you virtually unlimited scalability within the ability to pay at a subsecond-metered level.</li><li>A common use for lambda is image upload (event processing), API gateway integration.</li><li>Lambda is very good ay handling massive scale loads without the need to increase the amount of infrastructure allocated in your application.</li></ul><p>You can find the book here: <a href="https://www.goodreads.com/book/show/27560189-architecting-for-scale">https://www.goodreads.com/book/show/27560189-architecting-for-scale</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=61c6f34faf47" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Working with typescript and workspace.]]></title>
            <link>https://medium.com/@Isidro/working-with-typescript-and-workspace-758cae972833?source=rss-396512e58904------2</link>
            <guid isPermaLink="false">https://medium.com/p/758cae972833</guid>
            <category><![CDATA[yarn]]></category>
            <category><![CDATA[monorepo]]></category>
            <category><![CDATA[workspace]]></category>
            <category><![CDATA[typescript]]></category>
            <dc:creator><![CDATA[Isidro Martínez]]></dc:creator>
            <pubDate>Fri, 15 Dec 2023 03:42:56 GMT</pubDate>
            <atom:updated>2023-12-15T03:42:56.155Z</atom:updated>
            <content:encoded><![CDATA[<p>The concept of a workspace involves organizing multiple projects within a single repository, commonly referred to as a monorepo. This article aims to guide you through the process of extracting a package from the workspace, highlighting potential challenges that may arise during this process.</p><p>Recently I was involved in a typescript project that was configured as mono repo. The objective was to relocate the “example-package” from the existing workspace, as illustrated in the following example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cThwwKCAvhrPuLvAsQ2X4Q.png" /></figure><p>Initially, it’s crucial to note that when relocating your package outside the workspace, you have the advantage of not needing to include dependencies directly in your package.json. Instead, consider importing them directly into your files as needed.</p><pre><br>{<br>  &quot;dependencies&quot;: {<br>    // Don&#39;t import using the workspace protocol<br>    &quot;@my-org/utils&quot;: &quot;workspace:^&quot;<br>    // Don&#39;t import using local path<br>    &quot;@my-org/utils&quot;: &quot;./..&quot;<br>  }<br>}</pre><p>If you attempt to import the a workspace package out of the workspace using and explicitly path like ./../packages/module-b where module-b belongs to the workspace you will get an error. This error indicates that Yarn cannot recognize the workspace structure. To resolve this issue, you should use the path relative to the root workspace package.</p><pre>➜  examples yarn<br>➤ YN0000: ┌ Resolution step<br>➤ YN0013: │ @ts-workspace/module-a@file:./../packages/module-b#./../packages/module-b::hash=e6<br>➤ YN0001: │ Error: @ts-workspace/module-a@workspace:^: Workspace not found (@ts-workspace/module-a@workspace:^)<br>    at ze.getWorksp</pre><p>When you import a package using a local path (e.g. ./../packages/module-b) yarn makes a copy of the entire folder including the node_modulesfolder and files that are listed in the .gitignore. This implies that if you have large files, hidden files, or data generated during the build process, Yarn will also move those files into your new package outside the workspace.</p><pre>// If your files are too big to be process by yarn you will see an error like this:<br>➤ YN0000: ⠸ libqp@npm:2.0.1<br><br>// And then the following error<br>.: Couldn&#39;t allocate enough memory<br> at li.allocateBuffer (/mypath/.yarn/releases/yarn-3.2.3.cjs:314:22707)</pre><p>Solution 1: A possible solution for this error is to increase the memory space for node. E.g. export NODE_OPTIONS=&quot;--max-old-space-size=8192&quot; .</p><p>Solution 2: Another option is to use the remote repository path so can avoid dealing local packages. The disadvantage of this approach is that you need to release packages to be available remotely.</p><p>*Solution 3: The recommended and optimal solution is to leverage the workspace and directly import packages into your files, like this: import { multiply } from &quot;@ts-workspace/module-b&quot;. It&#39;s important to ensure that an index.ts file exists at the root of your module; otherwise, you may encounter issues. Additionally, note that there&#39;s no need to add dependencies in your package.json file under the dependencies section. Simply importing the modules within your files suffices.</p><p>Usually, when working with typescript you need to compile your files into the dist folder this make the package more compatible with third party packages. The following configuration is needed.</p><pre>// File structure<br>package-b/<br>|-- dist // auto generated folder<br>|-- index.ts // Make sure your index.ts exists<br>|-- tsconfig.json<br>|-- package.json<br><br><br>// package.json<br>{<br>    &quot;main&quot;: &quot;dist&quot;<br>}<br><br><br>// tsconfig.json<br>{<br>    &quot;compilerOptions&quot;: {<br>        &quot;outDir&quot;: &quot;dist&quot;,<br>    }<br>}</pre><p>So you can import a function from thepackage-b in your file out of the workspace like this:</p><pre>import { multiply } from &quot;@ts-workspace/module-b&quot;;<br><br>console.log(multiply(2, 9));</pre><p>Check <a href="https://github.com/isidroamv/ts-workspace">this repository</a> as an example.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=758cae972833" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Letters from Thailand: Quick Analysis]]></title>
            <link>https://medium.com/@Isidro/letters-from-thailand-quick-analysis-6f6cb54c278d?source=rss-396512e58904------2</link>
            <guid isPermaLink="false">https://medium.com/p/6f6cb54c278d</guid>
            <category><![CDATA[book-review]]></category>
            <category><![CDATA[thai]]></category>
            <category><![CDATA[books]]></category>
            <category><![CDATA[thailand]]></category>
            <dc:creator><![CDATA[Isidro Martínez]]></dc:creator>
            <pubDate>Wed, 21 Jun 2023 16:47:17 GMT</pubDate>
            <atom:updated>2023-06-21T16:47:17.832Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gAqBugZ24hfIiQD5CwlV2A.png" /></figure><p>I recently finished reading the book <a href="https://www.goodreads.com/book/show/234388.Letters_from_Thailand">“Letters from Thailand”</a> from Botan, it is an old novel written in 1969 about a Chinese guy who moved to Bangkok Thailand looking for better opportunities. This is not a happy story nor a sad story I felt it more like a raw reality. This book was recommended by a Thai person with Chinese ascendance who confirmed some facts about the book.</p><p>I have decided to write a quick analysis because few books grab my attention like this one and it touches on interesting topics such of values, raising a family, racism, immigration, temptations, modernization. The way the the book is written is even more interesting since these are only letters that Suang U wrote to his mother during 20 years, so reading the letters feels like entering to the author’s mind and feel the same feeling he has. It makes me remember the <a href="https://www.goodreads.com/book/show/48855.The_Diary_of_a_Young_Girl">“The Diary of a Young Girl” </a>by Anne Frank which also made me feel like reading the mind of a young girl.</p><p>Spoiler Alert ⚠️ ⚠️ ⚠️. Don’t continue reading if you don’t want to know details about the book.</p><p>The story starts with a disclaimer saying the book you will read has sensitive details, since the book was written in the form of letters by a normal human you must read the book from an open mind perspective. Also, it mentioned that these letters were never delivered to Suang’s mother, it is supposed that the letters were written in Chinese and translated to Thai by the Author, Botan. However, when reading the book you can notice these are not simple letters written by a normal person because it has many details that make you imagine the scenario where the characters interact, and when Suang U writes about another person’s behavior, he is so detailed most of the time that you can notice that his writing is not misled by his mental bias.</p><p>In the firsts letters, Suang mentioned that he left his home in Po Leng Village because he didn’t want a life on a farm for the rest of his life, he was bored with a monotonous life and didn’t earn much money there. The difference between him and the rest of the guys was that his mother taught him to read and write Chinese it and his good behavior is adopted by a prosperous Chinese merchant (Yong Chua).</p><p>In this first part I felt the feelings of a rebel boy thinking to do something meaning for his life, taking with him family values and the teachings from his mother (writing) but and the same time really regretted about living his family, maybe that is the reason he writes the letters for so long. His “father”, Yong Chua, lost their family in a big flood years ago so he wanted to meaningful for someone and have descendants, not the ones that have that same blood but the ones that remembers you when your are death. In this section I saw the importance of family links and the importance about the things even when your are dead, so that people venerate your death which is the opposite to some school of thought that says <a href="https://www.youtube.com/watch?v=BEE6pmXNnL4">live your life now because there is nothing after the death.</a></p><p>When Suang arrived to Thailand the author describes really detailed the environment, the weather, the sun, the people, the food, the clothes. Suang U started worked on as bookkeeper with Nguan Thong (Yong Chua’s friend and colleague). Nguan Thong had 2 daughters (Mui Eng and Ang Buai), Mui Eng was more beautiful and elder than Ang Bui which was not as much beautiful but she was really energetic. I believe the girls were around 12–14 years old and Suang U was around 16 or 17 years old. The girls were not thinking in getting married they wanted to continue studying and work in their father’s business. After some conflicts they ended up married and went to live together. Mui Eng’s father died but at least he was able to see his grandson (Suang’s son).</p><p>These first letters are really exciting to read because a lot of things happen in a short period, you see how they fall in love, got married, and had their first son.</p><h3>Suang U.</h3><p>In the letters, you can see how Suang’s “fathers” and Chinese society living in Bangkok influenced the mind of Suang U. They call their laborers coolies too and say that Thai people only like gambling, getting drunk, kids are half naked on the streets and don’t care about business and many other things that indirectly make you see how Chinese look down to Thai.</p><p>Suang U grew up in a place where Chinese looked down to Thais, he wanted to keep their values, believes and culture in a place that was not his country but a community there. He didn’t care about patrioty or war he was only thinking in business and his family. The most important thing for him was his sun that he tried to rise him in the best manner and Chinese way possible.</p><p>All the abundance he had in his life once vanished, his children got married and he can not live him them under different circumstances. I think the most disappointing thing in his life was that his son didn’t become the boy he wanted and the daughter that he hatted the most became the most important for him. At the end Suang U, starts accepting that Thais are not different than Chinese.</p><h3>Mui Eng</h3><p>Mui Eng was as not as energetic as her sister Ang Buai, and before meeting Suang he was thinking to continue with his father’s business. She didn’t want to have many children and she didn’t care about having a girl or a boy. At the begging and before of his marriage she didn’t get along with her sister her character became more dramatic (maybe from Suangs perspective). The love they had each other vanished the first years of marriage and she became more dependent on Suang’s decisions. I believe he became the woman she didn’t want to be and for that reason, she felt jealous about her sister that was running the business.</p><p>In the letters Suang doesn’t write too many things about her, he said that Mui believed in ghosts and spirits which to the point doubt of himself, he mentioned that she only wanted to expend money on glamorous things so society can see how her wealth. She died in a car accident.</p><h3>Ang Bui</h3><p>Mui’s sister, Ang Bui had the responsibility to take care of their parents at a younger age which made her an independent and intelligent woman. Besides her father didn’t believe a woman can run a business, Suang trusted in her and helped her to run his father’s business. Suang admired Ang Bui which makes me think that Suang fell in love with her those times or maybe they had sex a couple of times (people rumored about it). I think if it had happened he wouldn’t write this his mother since Mui Eng read the letters he had written. The jealousy Mui felt was for this reason.</p><p>Ang Bui grew up as an independent woman influenced by Western culture, she changed her hairstyle, bought an automobile, put on makeup, and wore heels like a “modern” girl. I think the influence of American television changed the young generation at those times and they loose of their traditions. Every body wanted her to be married but she didn’t find someone to marry. Maybe Suang will marry her.</p><h3>Weng Kim</h3><p>Weng Kim, Suang’s son, grew up with many expectations about his future, Suang pressured him to be the person he wanted to be, he took him out of school to continue with the business and sent him to a Chinese school. Same as his 3 sisters didn’t feel fit in Thai society, their family was teaching him Chinese traditions but in school, his mates make fun of them. Some of their sisters changed their name to be more Thai. Weng Kim didn’t have the character that Suang expected, this guy ran away from his home because didn’t want to marry Rose (Gim’s daughter) and fell in love with a prostitute who manipulated her so she can get some money from his family. The love of their parents was so big that they offered the prostitute (his girlfriend) to move to his house. Suang said that this was normal in old Chinese families whoever his real plan was to make Kim realize that she was not good for him. He ended up marrying Rose (Suang friend’s daughter).</p><h3>Meng Ju</h3><p>She is the youngest Suan’s child, Suang didn’t care about her because he wanted a second boy instead of another girl. So it seems Meng Ju grew up in an environment repressed by her father’s apathy maybe this same apathy motivated her to continue with his studies to be accepted by his father. She fell in love with a poor Thai boy in her school, Suang U didn’t like that because he was Thai but after meeting him he saw that his thoughts are different from the rest of the people. This Thai boy told to Suang many of his thoughts amount of them he mentioned that he didn’t like that Chinese people come to his country to make business a look down on the citizens. Suang U ended up accepting him because he was smart and hard-working.</p><p>I find it very interesting almost poetic that only at the very end of the last few pages after mentioning a lot of bad things about Thais (Suang’s mind) the last few letters mention good things about Thais. Meng Ju the girl the girl who he didn’t want and his husband a Thai man were the only that care about him when the rest of the children had gone away to make their own life. At those very few moments at the age of around 30, he saw things from a different perspective in a way he hasn’t though about.</p><p>During almost the entire book you can notice how Suang’s mind shows racist thoughts against Thais. You see that the same values that make him a good person also make him a racist person.</p><p>Suang’s children like the rest of the Chinese children born in Thailand faced an identity crisis since they grew up with Chinese and Thai culture and were influenced by western media.</p><p>When reading the letters regarding how hard working he was I thought about my culture too and made me to remember that I belong a family of hard working generations, my grands parents use to worked more than 16 hrs in farm and the thought the same to my parents that at their age of 60 they don’t stop working and I think they never will, I think in my sisters and all of them work really hard and makes fell I have the same values.</p><p>During the story it feels Suang’s happiness, sadness, emptiness, worries, and other feelings. You might think that life is like a balance, he was very lucky at the beginning but things turned out bad in the last pages. In the same way he ran away from his mother in Po Leng his children were different from what he expected. It only makes me think how life is like a cycle as if the situations that happen before will happen later and so on and so on…</p><blockquote>“Confucius taught that the world progresses only toward calamity when children do not follow the ways of parents and ancestors. Weng Kim weeps like a child and asks me how he is to survive between two worlds... what about me? Does he realize that I studied all the years of my childhood for a kind of manhood I was never permitted to have?”</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6f6cb54c278d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simple collective decision-making system on Ethereum — Part 2]]></title>
            <link>https://medium.com/@Isidro/simple-collective-decision-making-system-on-ethereum-part-2-e4534da819d5?source=rss-396512e58904------2</link>
            <guid isPermaLink="false">https://medium.com/p/e4534da819d5</guid>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[solidity]]></category>
            <dc:creator><![CDATA[Isidro Martínez]]></dc:creator>
            <pubDate>Wed, 24 May 2023 09:08:25 GMT</pubDate>
            <atom:updated>2023-06-07T09:45:47.504Z</atom:updated>
            <content:encoded><![CDATA[<h3>Simple collective decision-making system on Ethereum — Part 2</h3><p>In this section, we will cover the following topics:</p><ol><li>Develop the UI for the the application in React</li><li>Deploy the contract to ganache (local blockchain for Ethereum development.)</li><li>Integrate web3 to our application</li></ol><h3>Develop the UI for the the application in React</h3><p>The application is designed to be simple and uncomplicated. The intention of this tutorial is not to cover the react development so I won’t include too much details of it. I have decided to utilize React as our frontend framework because it is currently the most widely used framework among developers. You can check the details on of the UI in this commit <a href="https://github.com/isidroamv/voting-app/commit/e9e92120628855734fce8d26747879bd24a3b31f">https://github.com/isidroamv/voting-app/commit/e9e92120628855734fce8d26747879bd24a3b31f</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pad_oG96uv8kdJ_JgusbVA.png" /></figure><p>At the end, the application should look like the image above. The hash array is a list of accounts we can use to test our application.</p><h3>Deploy the contract to ganache</h3><p>To deploy our contract we need a Ethereum network. Sepolia is the most popular test network for development. Here are some sites you can use to deploy your contract.</p><ul><li><a href="https://www.infura.io/">https://www.infura.io</a></li><li><a href="https://sepoliafaucet.com/">https://sepoliafaucet.com</a></li></ul><p>However for this tutorial we will be using Ganache, a local test network, since it is a quickest way to work with the Ethereum blockchain and it is not needed to register to a third party website.</p><p>To install Ganache globally, run:</p><pre>npm install ganache --global</pre><p>Then, run the following command on the console to start the ganache local test network.</p><pre>ganache</pre><p>Finally, run the script to deploy the contract:</p><pre>node Ethereum/deploy-local.js </pre><pre>Contract deployed at address: 0x277D272ef0b6B0bF5d13B51DCe2c0DaF8f78485E</pre><h3>Integrate web3 to our application</h3><p>Now you can run the following command to generate the <a href="https://www.blockchain-council.org/solidity/solidity-abi-application-binary-interface">ABI</a> (Application Binary Interface)</p><pre> npx solc contracts/VotingSystem.sol -o build --abi</pre><p>Copy the ABI file to react to the react application. For example: voting-app/src/VotingSystem.json. This file will be use to interact with our contract.</p><p>Use the web3.js file to connect with the local Ethereum network.</p><pre>const Web3 = require(&quot;web3&quot;);<br>const web3 = new Web3(&#39;ws://localhost:8545&#39;);<br>export default web3;</pre><p>Use the the contract.js to connect with the contract.</p><pre>import web3 from &#39;./web3&#39;;<br>const address = &#39;0x277D272ef0b6B0bF5d13B51DCe2c0DaF8f78485E&#39;;<br>const abi = require(&#39;./VotingSystem.json&#39;)<br>export default new web3.eth.Contract(abi, address);</pre><p>In this example you can see how the 2 files generated can be used to get test accounts from the test network and call the method organizationCount() from the</p><pre>import { useEffect } from &#39;react&#39;;<br>import web3 from &quot;./web3&quot;;<br>import Contract from &quot;./Contract.js&quot;;<br><br>function App() {<br>  useEffect(() =&gt; {<br>    async function getProposalCount() {<br>      const accounts = await web3.eth.getAccounts();<br>      const organizationCount = await Contract.methods.organizationCount().call();<br><br>      console.log(&quot;accounts&quot;, accounts)<br>      console.log(&quot;organizationCount&quot;, organizationCount)<br>    }<br>    getProposalCount();<br>  }, []);<br>  return (&lt;&gt;<br>    ....<br>  &lt;/&gt;);<br>}<br>export default App;</pre><p>Check all files in the following repository: <a href="https://github.com/isidroamv/voting-app/tree/part-2">https://github.com/isidroamv/voting-app/tree/part-2</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FoyE7NgLIPa4%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DoyE7NgLIPa4&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FoyE7NgLIPa4%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/1c3c8875177d36a82496200c35ed11cc/href">https://medium.com/media/1c3c8875177d36a82496200c35ed11cc/href</a></iframe><p>The complete code is in this repository: <a href="https://github.com/isidroamv/voting-app/">https://github.com/isidroamv/voting-app/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e4534da819d5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>