{"@attributes":{"version":"2.0"},"channel":{"title":"Abe Estrada","description":"Abe Estrada","link":"https:\/\/feed.abeestrada.com","pubDate":"Fri, 27 Nov 2026 12:25:59 -0700","lastBuildDate":"Fri, 27 Nov 2026 12:25:59 -0700","item":[{"title":"Kindle Jailbreak","link":"https:\/\/abeestrada.com\/post\/kindle-jailbreak\/","pubDate":"Sat, 18 Jul 2026 23:00:00 -0600","guid":"https:\/\/abeestrada.com\/post\/kindle-jailbreak\/","description":"<p>All\u00e1 por el a\u00f1o 2003, tuve un lector de libros electr\u00f3nicos llamado Rocket eBook Reader. Cre\u00eda firmemente que ese dispositivo representaba el futuro de la lectura, y disfrut\u00e9 de muchos libros con \u00e9l durante mis viajes o en la sala de mi casa. En esa \u00e9poca tambi\u00e9n usaba varios dispositivos Palm, pero el Rocket superaba por mucho la experiencia de lectura. Su pantalla no era LCD como la de las PDA, sino de un nuevo tipo llamado \u201ctinta electr\u00f3nica\u201d (eink), que resultaba m\u00e1s c\u00f3moda a la vista, ten\u00eda mejor resoluci\u00f3n y era de mayor tama\u00f1o. Lo segu\u00ed utilizando hasta 2010, a\u00f1o en que sali\u00f3 el primer iPad y lleg\u00f3 el momento de reemplazarlo.<\/p>\n<figure >\n \n <picture>\n \n \n <img src=\"https:\/\/cdn.abeestrada.com\/images\/2026\/07\/rocket-ebook.jpg\" loading=\"lazy\">\n <\/picture>\n \n \n <\/figure>\n\n<p>Luego, Amazon lanz\u00f3 el Kindle, pero desde el primer d\u00eda sent\u00ed que ese dispositivo no reemplazar\u00eda mi forma de leer. No me agradaba que dependiera al cien por ciento de la tienda de Amazon, o tal vez no fue exactamente por eso, pero el caso es que nunca sent\u00ed la necesidad de adquirir uno. Al final, creo que prefer\u00ed seguir comprando libros f\u00edsicos.<\/p>\n<p>Con el paso del tiempo dej\u00e9 de leer en el iPad y descubr\u00ed los audiolibros. De alguna manera, estos reemplazaron mi forma de consumir libros, ya que pod\u00eda escucharlos mientras realizaba diferentes actividades que manten\u00edan mis manos ocupadas, permiti\u00e9ndome hacer varias cosas a la vez, como conducir. Todav\u00eda lo sigo haciendo, incluso mientras me preparo un caf\u00e9, aprovecho para escuchar un par de minutos de un libro.<\/p>\n<p>Todo cambi\u00f3 cuando encontr\u00e9 el <a href=\"https:\/\/abeestrada.com\/post\/xteink-x4\/\">Xteink X4<\/a>\n y quise empezar a leer de noche. La falta de luz integrada me decepcion\u00f3 mucho, pero lo segu\u00ed utilizando durante el d\u00eda, aunque por las noches sent\u00eda que me faltaba algo. Por eso tom\u00e9 la decisi\u00f3n de comprar un Kindle.<\/p>\n<p>Pero no eleg\u00ed cualquier modelo. Amazon anunci\u00f3 que dejar\u00eda de dar soporte y acceso a su tienda digital a ciertas generaciones antiguas, e incluso bloquear\u00eda la opci\u00f3n de enviar archivos PDF y TXT. Ah\u00ed vi la oportunidad de comprar un Kindle usado y sin soporte para hacerle un jailbreak. As\u00ed pude devolverlo a la vida y, mejor a\u00fan, a\u00f1adirle funciones que ni los dispositivos de f\u00e1brica traen, como el soporte para libros en formato EPUB.<\/p>\n<p>Este no es un tutorial sobre c\u00f3mo hacerle jailbreak, solo quiero contarles mi experiencia y decirles que, si buscan en internet, es f\u00e1cil encontrar c\u00f3mo hacerlo.<\/p>\n<figure >\n \n <picture>\n \n \n <img src=\"https:\/\/cdn.abeestrada.com\/images\/2026\/07\/kindle-jailbreak.jpg\" loading=\"lazy\">\n <\/picture>\n \n \n <\/figure>\n\n<figure >\n \n <picture>\n \n \n <img src=\"https:\/\/cdn.abeestrada.com\/images\/2026\/07\/kindle-hotfix.jpg\" loading=\"lazy\">\n <\/picture>\n \n \n <\/figure>\n\n<p>En mi caso, instal\u00e9 <a href=\"https:\/\/koreader.rocks\" target=\"_blank\" rel=\"noopener\">KOReader<\/a>\n con <a href=\"https:\/\/github.com\/doctorhetfield-cmd\/simpleui.koplugin\" target=\"_blank\" rel=\"noopener\">SimpleUI<\/a>\n. La verdad es que el tama\u00f1o s\u00ed importa. Aunque el Kindle de 6\u201d tiene luz integrada, no me resulta tan c\u00f3modo como el Xteink X4. Sigo prefiriendo el X4, pero por ahora el Kindle es mi \u00fanica opci\u00f3n para leer de noche, ya que intent\u00e9 usar una l\u00e1mpara de lectura con el X4 y el reflejo degrada bastante la experiencia.<\/p>\n<figure >\n \n <picture>\n \n \n <img src=\"https:\/\/cdn.abeestrada.com\/images\/2026\/07\/kindle-koreader-simpleui.jpg\" loading=\"lazy\">\n <\/picture>\n \n \n <\/figure>\n\n"},{"title":"Xteink X4","link":"https:\/\/abeestrada.com\/post\/xteink-x4\/","pubDate":"Sat, 06 Jun 2026 20:00:00 -0600","guid":"https:\/\/abeestrada.com\/post\/xteink-x4\/","description":"<p>TL;DR: El <a href=\"https:\/\/www.amazon.com\/dp\/B0GR4BCJK3\" target=\"_blank\" rel=\"noopener\">Xteink X4<\/a>\n es un lector compacto y eficiente. Es pr\u00e1ctico para leer cuando no puedo usar audiolibros.<\/p>\n<p>Hace tiempo que no me emocionaba con un gadget. Todo parece igual: pantallas rectangulares, millones de colores, software que se actualiza cada a\u00f1o, aplicaciones de suscripci\u00f3n.<\/p>\n<p>Hab\u00eda le\u00eddo sobre lectores de libros electr\u00f3nicos como el BOOX Palma, pero su precio me parec\u00eda excesivo para el uso que le dar\u00eda. El Kindle estaba descartado por estar atado al ecosistema de Amazon y porque, despu\u00e9s de algunos a\u00f1os, el hardware deja de funcionar por decisi\u00f3n de la empresa. Tambi\u00e9n vi el Kobo, pero segu\u00eda sin convencerme la idea de un dispositivo dedicado solo a leer. Cuando pod\u00eda, usaba el iPad, porque cre\u00eda que ese era el tama\u00f1o ideal, y nunca intent\u00e9 leer en el tel\u00e9fono.<\/p>\n<p>Hasta que el precio me convenci\u00f3 de darle una oportunidad al Xtreink X4. Y qu\u00e9 equivocado estaba.<\/p>\n<p>Esto no es un an\u00e1lisis completo, son mis impresiones sobre la utilidad del dispositivo. Empecemos por el tama\u00f1o: dudaba que, al ser m\u00e1s peque\u00f1o que la pantalla de mi tel\u00e9fono, fuera realmente \u00fatil. Pero la combinaci\u00f3n de la pantalla de tinta electr\u00f3nica con los botones f\u00edsicos lo hace sumamente eficiente para lo que fue dise\u00f1ado: leer. El texto es n\u00edtido y el tama\u00f1o de letra es ajustable. Puedo cargarlo a cualquier lado sin que estorbe, y eso ha sido una grata sorpresa. Lo \u00fanico que le falta para ser perfecto es contar con luz integrada para leer de noche y eso lo volver\u00eda \u00e9pico.<\/p>\n<p>Soy fan de los audiolibros, pero a veces prefiero no usar aud\u00edfonos para mantener el sentido de alerta. Leer en este dispositivo me da esa alternativa sin sacrificar comodidad. No reemplaza los audiolibros, pero los complementa dependiendo del contexto.<\/p>\n<p>Desde los a\u00f1os en que coleccionaba Palms, no me sent\u00eda tan satisfecho con un dispositivo de este tipo.<\/p>\n<figure >\n \n <picture>\n \n \n <img src=\"https:\/\/cdn.abeestrada.com\/images\/2026\/06\/xteinkx4.jpg\" loading=\"lazy\">\n <\/picture>\n \n \n <\/figure>\n\n"},{"title":"Books","link":"https:\/\/abeestrada.com\/books\/","pubDate":"Fri, 20 Feb 2026 08:00:00 -0600","guid":"https:\/\/abeestrada.com\/books\/","description":"<h4 id=\"2026\">2026<\/h4>\n<ol>\n<li><a href=\"https:\/\/a.co\/d\/itraz3W\" target=\"_blank\" rel=\"noopener\">Scrum<\/a>\n - Jeff Sutherland<\/li>\n<li><a href=\"https:\/\/a.co\/d\/00RSJ1c0\" target=\"_blank\" rel=\"noopener\">High Output Management<\/a>\n - Andrew S. Grove<\/li>\n<li><a href=\"https:\/\/a.co\/d\/05GvqsXv\" target=\"_blank\" rel=\"noopener\">Staff Engineer<\/a>\n - Will Larson<\/li>\n<li><a href=\"https:\/\/a.co\/d\/0gdJQbGh\" target=\"_blank\" rel=\"noopener\">The Greatest Sentence Ever Written<\/a>\n - Walter Isaacson<\/li>\n<li><a href=\"https:\/\/a.co\/d\/08MtLymI\" target=\"_blank\" rel=\"noopener\">Hands-On Large Language Models<\/a>\n - Jay Alammar<\/li>\n<li><a href=\"https:\/\/a.co\/d\/0f7s05b6\" target=\"_blank\" rel=\"noopener\">How to Win Friends &amp; Influence People<\/a>\n - Dale Carnegie<\/li>\n<li><a href=\"https:\/\/a.co\/d\/083cZtRw\" target=\"_blank\" rel=\"noopener\">&ldquo;You Are Not Expected to Understand This&rdquo;<\/a>\n - Torie Bosch<\/li>\n<li><a href=\"https:\/\/a.co\/d\/0dTL38yE\" target=\"_blank\" rel=\"noopener\">This Is for Everyone<\/a>\n - Tim Berners-Lee<\/li>\n<li><a href=\"https:\/\/a.co\/d\/07vmE18N\" target=\"_blank\" rel=\"noopener\">UNIX: A History and a Memoir<\/a>\n - Brian W Kernighan<\/li>\n<li><a href=\"https:\/\/a.co\/d\/0gZXjWom\" target=\"_blank\" rel=\"noopener\">Project Hail Mary<\/a>\n - Andy Weir<\/li>\n<li><a href=\"https:\/\/a.co\/d\/0gXAvtHQ\" target=\"_blank\" rel=\"noopener\">CYBERPUNK<\/a>\n - Katie Hafner<\/li>\n<li><a href=\"https:\/\/a.co\/d\/07mvEltb\" target=\"_blank\" rel=\"noopener\">Where Wizards Stay Up Late<\/a>\n - Katie Hafner<\/li>\n<li><a href=\"https:\/\/a.co\/d\/0d7juI3Z\" target=\"_blank\" rel=\"noopener\">The Cathedral &amp; the Bazaar<\/a>\n - Eric S. Raymond<\/li>\n<li><a href=\"https:\/\/a.co\/d\/0ct9PDtn\" target=\"_blank\" rel=\"noopener\">Free as in Freedom<\/a>\n - Sam Williams<\/li>\n<li><a href=\"https:\/\/a.co\/d\/0bUawGkj\" target=\"_blank\" rel=\"noopener\">The Story of Cybernetics<\/a>\n - Maurice Trask<\/li>\n<li><a href=\"https:\/\/a.co\/d\/0ijr8M32\" target=\"_blank\" rel=\"noopener\">The Idea Factory<\/a>\n - Jon Gertner<\/li>\n<li><a href=\"https:\/\/a.co\/d\/0aAz45bo\" target=\"_blank\" rel=\"noopener\">Simulacra and Simulation<\/a>\n - Jean Baudrillard<\/li>\n<li><a href=\"https:\/\/eprints.bbk.ac.uk\/id\/eprint\/30956\/\" target=\"_blank\" rel=\"noopener\">Warez<\/a>\n - Martin Paul Eve<\/li>\n<li><a href=\"https:\/\/a.co\/d\/0j9C9sUe\" target=\"_blank\" rel=\"noopener\">The Design of the UNIX Operating System<\/a>\n - Maurice Bach<\/li>\n<li><a href=\"https:\/\/a.co\/d\/0iuidszg\" target=\"_blank\" rel=\"noopener\">A Mind at Play<\/a>\n - Rob Goodman<\/li>\n<li><a href=\"https:\/\/a.co\/d\/00kIc4wp\" target=\"_blank\" rel=\"noopener\">Insanely Great<\/a>\n - Steven Levy<\/li>\n<\/ol>\n<h4 id=\"2025\">2025<\/h4>\n<ol>\n<li><a href=\"https:\/\/a.co\/d\/fVMxisK\" target=\"_blank\" rel=\"noopener\">The Coming Wave<\/a>\n - Mustafa Suleyman<\/li>\n<li><a href=\"https:\/\/a.co\/d\/2SfznF6\" target=\"_blank\" rel=\"noopener\">The Hackers Ethic<\/a>\n - Pekka Himanen<\/li>\n<li><a href=\"https:\/\/a.co\/d\/4rQ4cSw\" target=\"_blank\" rel=\"noopener\">The Elements of Marie Curie<\/a>\n - Dava Sobel<\/li>\n<li><a href=\"https:\/\/a.co\/d\/2kTtQVU\" target=\"_blank\" rel=\"noopener\">Source Code<\/a>\n - Bill Gates<\/li>\n<li><a href=\"https:\/\/a.co\/d\/a3bgBE4\" target=\"_blank\" rel=\"noopener\">Quantum Computing<\/a>\n - Brian Clegg<\/li>\n<li><a href=\"https:\/\/a.co\/d\/84Dk4T8\" target=\"_blank\" rel=\"noopener\">Nexus<\/a>\n - Yuval Noah Harari<\/li>\n<li><a href=\"https:\/\/a.co\/d\/0tljzsg\" target=\"_blank\" rel=\"noopener\">A Vulnerable System<\/a>\n - Andrew J. Stewart<\/li>\n<li><a href=\"https:\/\/a.co\/d\/cgilxzJ\" target=\"_blank\" rel=\"noopener\">Idea Man<\/a>\n - Paul Allen<\/li>\n<li><a href=\"https:\/\/a.co\/d\/8RC6uHd\" target=\"_blank\" rel=\"noopener\">Revolutionary Algorithms<\/a>\n - Torey Akers<\/li>\n<li><a href=\"https:\/\/a.co\/d\/dghDXXj\" target=\"_blank\" rel=\"noopener\">Free Software, Free Society<\/a>\n - Richard M. Stallman<\/li>\n<li><a href=\"https:\/\/a.co\/d\/8FDwcDr\" target=\"_blank\" rel=\"noopener\">Spam Nation<\/a>\n - Brian Krebs<\/li>\n<li><a href=\"https:\/\/a.co\/d\/gabEA28\" target=\"_blank\" rel=\"noopener\">Stealth<\/a>\n - Peter Westwick<\/li>\n<li><a href=\"https:\/\/a.co\/d\/0J1uPZu\" target=\"_blank\" rel=\"noopener\">The Quantum Labyrinth<\/a>\n - Paul Halpern<\/li>\n<li><a href=\"https:\/\/a.co\/d\/cQYNAoI\" target=\"_blank\" rel=\"noopener\">Careless People<\/a>\n - Sarah Wynn-Williams<\/li>\n<li><a href=\"https:\/\/a.co\/d\/3I863CL\" target=\"_blank\" rel=\"noopener\">Quantum Supremacy<\/a>\n - Michio Kaku<\/li>\n<li><a href=\"https:\/\/a.co\/d\/bAHPCjK\" target=\"_blank\" rel=\"noopener\">Quantum Entanglement<\/a>\n - Jed Brody<\/li>\n<li><a href=\"https:\/\/a.co\/d\/dacngzK\" target=\"_blank\" rel=\"noopener\">When the Moon Hits Your Eye<\/a>\n - John Scalzi<\/li>\n<li><a href=\"https:\/\/a.co\/d\/aNKg0OO\" target=\"_blank\" rel=\"noopener\">The Vegetarian<\/a>\n - Han Kang<\/li>\n<li><a href=\"https:\/\/a.co\/d\/7lrMtsv\" target=\"_blank\" rel=\"noopener\">Rare Tongues<\/a>\n - Lorna Gibb<\/li>\n<li><a href=\"https:\/\/a.co\/d\/cP85ZFn\" target=\"_blank\" rel=\"noopener\">Heretic<\/a>\n - Catherine Nixey<\/li>\n<li><a href=\"https:\/\/a.co\/d\/9N0VWtz\" target=\"_blank\" rel=\"noopener\">Crucial Conversations<\/a>\n - Joseph Grenny<\/li>\n<li><a href=\"https:\/\/a.co\/d\/2FoJtOQ\" target=\"_blank\" rel=\"noopener\">Between Two Rivers<\/a>\n - Moudhy Al-Rashid<\/li>\n<li><a href=\"https:\/\/a.co\/d\/3F4JdPw\" target=\"_blank\" rel=\"noopener\">Constituent Service<\/a>\n - John Scalzi<\/li>\n<li><a href=\"https:\/\/a.co\/d\/0lcLbz2\" target=\"_blank\" rel=\"noopener\">Buddhism for Beginners<\/a>\n - Thubten Chodron<\/li>\n<li><a href=\"https:\/\/a.co\/d\/doSsEUD\" target=\"_blank\" rel=\"noopener\">No Better Time<\/a>\n - Molly Knight Raskin<\/li>\n<li><a href=\"https:\/\/a.co\/d\/0pHhXC9\" target=\"_blank\" rel=\"noopener\">La civilizaci\u00f3n del espect\u00e1culo<\/a>\n - Mario Vargas Llosa<\/li>\n<li><a href=\"https:\/\/a.co\/d\/gSZcOmi\" target=\"_blank\" rel=\"noopener\">Jurassic Park<\/a>\n - Michael Crichton<\/li>\n<li><a href=\"https:\/\/a.co\/d\/38aA1VI\" target=\"_blank\" rel=\"noopener\">Pancho Villa<\/a>\n - Paco Ignacio Taibo II<\/li>\n<li><a href=\"https:\/\/a.co\/d\/dQDGGp5\" target=\"_blank\" rel=\"noopener\">Armada<\/a>\n - Ernest Cline<\/li>\n<li><a href=\"https:\/\/a.co\/d\/hD6InYl\" target=\"_blank\" rel=\"noopener\">Never Lost Again<\/a>\n - Bill Kilday<\/li>\n<li><a href=\"https:\/\/a.co\/d\/2fiZ7Cb\" target=\"_blank\" rel=\"noopener\">Empire of AI<\/a>\n - Karen Hao<\/li>\n<li><a href=\"https:\/\/a.co\/d\/bWUQOdT\" target=\"_blank\" rel=\"noopener\">Fundamentals of Software Architecture<\/a>\n - Mark Richards, Neal Ford<\/li>\n<li><a href=\"https:\/\/a.co\/d\/3QZZvjq\" target=\"_blank\" rel=\"noopener\">Software Architecture: The Hard Parts<\/a>\n - Pramod Sadalage, Zhamak Dehghani<\/li>\n<li><a href=\"https:\/\/a.co\/d\/deVUvPo\" target=\"_blank\" rel=\"noopener\">Digital Dharma<\/a>\n - Deepak Chopra MD<\/li>\n<li><a href=\"https:\/\/a.co\/d\/3rHYd8U\" target=\"_blank\" rel=\"noopener\">Engineering Management for the Rest of Us<\/a>\n - Sarah Drasner<\/li>\n<li><a href=\"https:\/\/a.co\/d\/gIIhsbA\" target=\"_blank\" rel=\"noopener\">Accelerate<\/a>\n - Nicole Forsgren PhD<\/li>\n<li><a href=\"https:\/\/a.co\/d\/5POheB9\" target=\"_blank\" rel=\"noopener\">Hell Yeah or No<\/a>\n - Derek Sivers<\/li>\n<li><a href=\"https:\/\/a.co\/d\/e5IkMcR\" target=\"_blank\" rel=\"noopener\">The Manager&rsquo;s Path<\/a>\n - Camille Fournier<\/li>\n<li><a href=\"https:\/\/a.co\/d\/iW8I3Zd\" target=\"_blank\" rel=\"noopener\">An Elegant Puzzle<\/a>\n - Will Larson<\/li>\n<li><a href=\"https:\/\/a.co\/d\/4Lw0HIK\" target=\"_blank\" rel=\"noopener\">Thinking in Systems<\/a>\n - Donella H. Meadows<\/li>\n<li><a href=\"https:\/\/a.co\/d\/bZ2YR5b\" target=\"_blank\" rel=\"noopener\">Fundamentals of Data Engineering<\/a>\n - Joe Reis<\/li>\n<li><a href=\"https:\/\/a.co\/d\/bA9OXOX\" target=\"_blank\" rel=\"noopener\">The Staff Engineer&rsquo;s Path<\/a>\n - Tanya Reilly<\/li>\n<\/ol>\n<h4 id=\"2024\">2024<\/h4>\n<ol>\n<li><a href=\"https:\/\/a.co\/d\/0d0wKqj\" target=\"_blank\" rel=\"noopener\">Artificial Unintelligence<\/a>\n \u2014 Meredith Broussard<\/li>\n<li><a href=\"https:\/\/a.co\/d\/dQsPSOO\" target=\"_blank\" rel=\"noopener\">Surfear el espacio-tiempo<\/a>\n \u2014 Sergio de R\u00e9gules &amp; Miguel Alcubierre<\/li>\n<li><a href=\"https:\/\/a.co\/d\/c7J7fz1\" target=\"_blank\" rel=\"noopener\">En agosto nos vemos<\/a>\n \u2014 Gabriel Garc\u00eda M\u00e1rquez<\/li>\n<li><a href=\"https:\/\/a.co\/d\/7pYtf0h\" target=\"_blank\" rel=\"noopener\">Filterworld<\/a>\n \u2014 Kyle Chayka<\/li>\n<li><a href=\"https:\/\/a.co\/d\/8vQbvA7\" target=\"_blank\" rel=\"noopener\">Airbus A320 Filosof\u00eda operacional<\/a>\n \u2014 Facundo Conforti<\/li>\n<li><a href=\"https:\/\/a.co\/d\/a3KvCKb\" target=\"_blank\" rel=\"noopener\">Burn Book<\/a>\n \u2014 Kara Swisher<\/li>\n<li><a href=\"https:\/\/a.co\/d\/cY0Dwd3\" target=\"_blank\" rel=\"noopener\">How to Make the Best Coffee at Home<\/a>\n \u2014 James Hoffmann<\/li>\n<li><a href=\"https:\/\/a.co\/d\/8Wbfo71\" target=\"_blank\" rel=\"noopener\">Starter Villain<\/a>\n \u2014 John Scalzi<\/li>\n<li><a href=\"https:\/\/a.co\/d\/eUZXLVh\" target=\"_blank\" rel=\"noopener\">The 37th Parallel<\/a>\n \u2014 Ben Mezrich<\/li>\n<li><a href=\"https:\/\/a.co\/d\/fSmRZSp\" target=\"_blank\" rel=\"noopener\">The Great Bridge<\/a>\n \u2014 David McCullough<\/li>\n<li><a href=\"https:\/\/a.co\/d\/elXWIZx\" target=\"_blank\" rel=\"noopener\">Dark Wire<\/a>\n \u2014 Joseph Cox<\/li>\n<li><a href=\"https:\/\/a.co\/d\/3HLiFIW\" target=\"_blank\" rel=\"noopener\">Pegasus<\/a>\n \u2014 Laurent Richard &amp; Sandrine Rigaud<\/li>\n<li><a href=\"https:\/\/a.co\/d\/00NKBcP0\" target=\"_blank\" rel=\"noopener\">The Wright Brothers<\/a>\n \u2014 David McCullough<\/li>\n<li><a href=\"https:\/\/a.co\/d\/ae8q6Qc\" target=\"_blank\" rel=\"noopener\">The Singularity Is Nearer<\/a>\n \u2014 Ray Kurzweil<\/li>\n<li><a href=\"https:\/\/a.co\/d\/6YlBc1B\" target=\"_blank\" rel=\"noopener\">Gravitational Waves<\/a>\n \u2014 Brian Clegg<\/li>\n<li><a href=\"https:\/\/a.co\/d\/3NmECYQ\" target=\"_blank\" rel=\"noopener\">Token Supremacy<\/a>\n \u2014 Zachary Small<\/li>\n<li><a href=\"https:\/\/a.co\/d\/eXaNomN\" target=\"_blank\" rel=\"noopener\">Just for Fun<\/a>\n \u2014 Linus Torvalds &amp; David Diamond<\/li>\n<li><a href=\"https:\/\/a.co\/d\/6bTJawl\" target=\"_blank\" rel=\"noopener\">Fuego y Sangre<\/a>\n \u2014 George R.R. Martin<\/li>\n<li><a href=\"https:\/\/a.co\/d\/1S74n7a\" target=\"_blank\" rel=\"noopener\">Chip War<\/a>\n - Chris Miller<\/li>\n<li><a href=\"https:\/\/a.co\/d\/5el0fb2\" target=\"_blank\" rel=\"noopener\">Tracers in the Dark<\/a>\n - Andy Greenberg<\/li>\n<li><a href=\"https:\/\/a.co\/d\/9XiLoCH\" target=\"_blank\" rel=\"noopener\">Cypherpunks<\/a>\n - Julian Assange<\/li>\n<li><a href=\"https:\/\/a.co\/d\/ajmshG5\" target=\"_blank\" rel=\"noopener\">We Were Yahoo!<\/a>\n - Jeremy Ring<\/li>\n<li><a href=\"https:\/\/a.co\/d\/73oSqbb\" target=\"_blank\" rel=\"noopener\">Mindf*ck<\/a>\n - Christopher Wylie<\/li>\n<li><a href=\"https:\/\/a.co\/d\/cKoVzDI\" target=\"_blank\" rel=\"noopener\">How the Internet Happened<\/a>\n - Brian McCullough<\/li>\n<\/ol>\n<h4 id=\"2023\">2023<\/h4>\n<ol>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/B01AYL8VYQ\/\" target=\"_blank\" rel=\"noopener\">Cinco Esquinas<\/a>\n \u2014 Mario Vargas Llosa<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/B003LSTK8G\/\" target=\"_blank\" rel=\"noopener\">The Big Short<\/a>\n \u2014 Michael Lewis<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/B07P1NNTSD\/\" target=\"_blank\" rel=\"noopener\">The Man Who Solved the Market<\/a>\n \u2014 Gregory Zuckerman<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/B09RXQRKTF\" target=\"_blank\" rel=\"noopener\">Like, Comment, Subscribe<\/a>\n \u2014 Mark Bergen<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/B09WJLY9JP\" target=\"_blank\" rel=\"noopener\">The Woman Who Split the Atom<\/a>\n \u2014 Marissa Moss<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/B000OZ0J0W\" target=\"_blank\" rel=\"noopener\">American Prometheus<\/a>\n \u2014 Kai Bird &amp; Martin J. Sherwin<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/B07WHKQWN2\" target=\"_blank\" rel=\"noopener\">And or Not<\/a>\n \u2014 George Boole<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/B0B6YDQJW2\" target=\"_blank\" rel=\"noopener\">Androids<\/a>\n \u2014 Chet Haase<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/B00M284HDO\" target=\"_blank\" rel=\"noopener\">Dataclysm<\/a>\n \u2014 Christian Rudder<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/B0BX4S57GM\" target=\"_blank\" rel=\"noopener\">Elon Musk<\/a>\n \u2014 Walter Isaacson<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/B07VTQT95V\" target=\"_blank\" rel=\"noopener\">Infinite Powers<\/a>\n \u2014 Steven Strogatz<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/B0BWSL6BFL\" target=\"_blank\" rel=\"noopener\">Your Face Belongs to Us<\/a>\n \u2014 Kashmir Hill<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/B0CD8V9SHD\" target=\"_blank\" rel=\"noopener\">Going Infinite<\/a>\n \u2014 Michael Lewis<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/B0C1PQ7MZC\" target=\"_blank\" rel=\"noopener\">Extremely Online<\/a>\n \u2014 Taylor Lorenz<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/B0BTZ51JVH\" target=\"_blank\" rel=\"noopener\">Breaking Twitter<\/a>\n \u2014 Ben Mezrich<\/li>\n<\/ol>\n<h4 id=\"2022\">2022<\/h4>\n<ol>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/1627790365\/\" target=\"_blank\" rel=\"noopener\">Algorithms to Live By<\/a>\n \u2014 Tom Griffiths<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/B08SH41ZJ9\/\" target=\"_blank\" rel=\"noopener\">Quantum Physics for Beginners<\/a>\n \u2014 Darrell Ason<\/li>\n<li><a href=\"https:\/\/www.packtpub.com\/product\/dancing%e2%80%94with%e2%80%94qubits\/9781838827366\" target=\"_blank\" rel=\"noopener\">Dancing with Qubits<\/a>\n \u2014 Robert S. Sutor<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/0063076098\/\" target=\"_blank\" rel=\"noopener\">The Storyteller<\/a>\n \u2014 Dave Grohl<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/B0833FBNHV\/\" target=\"_blank\" rel=\"noopener\">The Pragmatic Programmer<\/a>\n \u2014 David Thomas and Andrew Hunt<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/1647823196\/\" target=\"_blank\" rel=\"noopener\">The Messenger<\/a>\n \u2014 Peter Loftus<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/B09CZF2Z1G\/\" target=\"_blank\" rel=\"noopener\">The Antisocial Network<\/a>\n \u2014 Ben Mezrich<\/li>\n<li><a href=\"https:\/\/www.amazon.com.mx\/gp\/product\/6073818181\/\" target=\"_blank\" rel=\"noopener\">M\u00e9xico, manual de usuario<\/a>\n \u2014 Chumel Torres<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/B003PDMKIY\/\" target=\"_blank\" rel=\"noopener\">Hackers<\/a>\n \u2014 Steven Levy<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/1690029994\/\" target=\"_blank\" rel=\"noopener\">Tao Te Ching<\/a>\n \u2014 Lao Tzu<\/li>\n<li><a href=\"https:\/\/www.amazon.com.mx\/dp\/6073820658\/\" target=\"_blank\" rel=\"noopener\">El Rey del Cash<\/a>\n \u2014 Elena Ch\u00e1vez<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/0008305706\/\" target=\"_blank\" rel=\"noopener\">Ultralearning<\/a>\n \u2014 Scott Young<\/li>\n<\/ol>\n<h4 id=\"2021\">2021<\/h4>\n<ol>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/1982115858\/\" target=\"_blank\" rel=\"noopener\">The Code Breaker<\/a>\n \u2014 Walter Isaacson<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/1524763160\/\" target=\"_blank\" rel=\"noopener\">A Promised Land<\/a>\n \u2014 Barack Obama<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/0385546130\/\" target=\"_blank\" rel=\"noopener\">How to Avoid a Climate Disaster<\/a>\n \u2014 Bill Gates<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/B083MYJXZT\/\" target=\"_blank\" rel=\"noopener\">Caffeine<\/a>\n \u2014 Michael Pollan<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/B096HD4Y8M\/\" target=\"_blank\" rel=\"noopener\">Epidemiology<\/a>\n \u2014 Rodolfo Saracci<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/B08KWR85F8\/\" target=\"_blank\" rel=\"noopener\">Working in Public<\/a>\n \u2014 Nadia Eghbal<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/B071S8BNDP\/\" target=\"_blank\" rel=\"noopener\">Leonardo da Vinci<\/a>\n \u2014 Walter Isaacson<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/B07Y3TJ163\/\" target=\"_blank\" rel=\"noopener\">No Filter<\/a>\n \u2014 Sarah Frier<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/B08VWV2WDK\/\" target=\"_blank\" rel=\"noopener\">A Thousand Brains<\/a>\n \u2014 Jeff Hawkins<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/B01IW9TM5O\/\" target=\"_blank\" rel=\"noopener\">Born a Crime<\/a>\n \u2014 Trevor Noah<\/li>\n<li><a href=\"https:\/\/www.amazon.com.mx\/dp\/6074383987\/\" target=\"_blank\" rel=\"noopener\">El Mundo de Sof\u00eda<\/a>\n \u2014 Jostein Gaarder<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/1599869772\/\" target=\"_blank\" rel=\"noopener\">The Art Of War<\/a>\n \u2014 Sun Tzu<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/B01558MH02\/\" target=\"_blank\" rel=\"noopener\">The Science of Everyday Life<\/a>\n \u2014 Marty Jopson<\/li>\n<\/ol>\n<h4 id=\"2019\">2019<\/h4>\n<ol>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/1501119923\/\" target=\"_blank\" rel=\"noopener\">Thanks a Thousand<\/a>\n \u2014 A. J. Jacobs<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/0525536515\/\" target=\"_blank\" rel=\"noopener\">Digital Minimalism<\/a>\n \u2014 Cal Newport<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/1784759481\/\" target=\"_blank\" rel=\"noopener\">Ask an Astronaut<\/a>\n \u2014 Tim Peake<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/154176238X\/\" target=\"_blank\" rel=\"noopener\">Cult of Dead Cow<\/a>\n \u2014 Joseph Menn<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/1416505210\/\" target=\"_blank\" rel=\"noopener\">Hunt for the Skinwalker<\/a>\n \u2014 Colm A. Kelleher &amp; George Knapp<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/0062464396\/\" target=\"_blank\" rel=\"noopener\">The Flight<\/a>\n \u2014 Dan Hampton<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/0399592091\/\" target=\"_blank\" rel=\"noopener\">The Ride of a Lifetime<\/a>\n \u2014 Robert Iger<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/1250237238\/\" target=\"_blank\" rel=\"noopener\">Permanent Record<\/a>\n \u2014 Edward Snowden<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/1517709075\/\" target=\"_blank\" rel=\"noopener\">El Principe<\/a>\n \u2014 Nicolas Maquiavelo<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/0307745171\/\" target=\"_blank\" rel=\"noopener\">Slim<\/a>\n \u2014 Osorno Diego Enrique<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/1781688133\/\" target=\"_blank\" rel=\"noopener\">Four Futures<\/a>\n \u2014 Peter Frase<\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/B00TP07B0I\" target=\"_blank\" rel=\"noopener\">The Plane That Wasn&rsquo;t There<\/a>\n \u2014 Jeff Wise<\/li>\n<\/ol>\n"},{"title":"Windows Terminal & Nushell","link":"https:\/\/abeestrada.com\/post\/windows-terminal-nushell\/","pubDate":"Sun, 08 Feb 2026 22:00:00 -0700","guid":"https:\/\/abeestrada.com\/post\/windows-terminal-nushell\/","description":"<figure class=\"w-full\" >\n \n <picture>\n \n \n <img src=\"https:\/\/cdn.abeestrada.com\/images\/2026\/windows-terminal.jpg\" loading=\"lazy\">\n <\/picture>\n \n \n <\/figure>\n\n<p>Les voy a contar c\u00f3mo termin\u00e9 usando <a href=\"https:\/\/www.nushell.sh\/\" target=\"_blank\" rel=\"noopener\">Nushell<\/a>\n.<\/p>\n<p>Por causas ajenas a m\u00ed, tengo que trabajar en este entorno:<\/p>\n<ul>\n<li>256 GB de espacio en disco<\/li>\n<li>16 GB de RAM<\/li>\n<li>Windows 11<\/li>\n<\/ul>\n<p>Solo necesito mis aplicaciones en la terminal y un navegador. Eso es todo para trabajar.<\/p>\n<p>Empec\u00e9 usando WSL 2 con Debian. Funcionaba muy bien: ZSH era r\u00e1pido y c\u00f3modo. Pero el espacio en disco se volvi\u00f3 un problema, as\u00ed que decid\u00ed desinstalarlo.<\/p>\n<p>Despu\u00e9s descargu\u00e9 <a href=\"https:\/\/alacritty.org\/\" target=\"_blank\" rel=\"noopener\">Alacritty<\/a>\n, pensando que la terminal de Windows era la lenta\u2026 pero no. El verdadero cuello de botella era PowerShell.<\/p>\n<figure class=\"w-full\" >\n \n <picture>\n \n \n <img src=\"https:\/\/cdn.abeestrada.com\/images\/2026\/powershell.jpg\" loading=\"lazy\">\n <\/picture>\n \n \n <\/figure>\n\n<p>As\u00ed fue como prob\u00e9 Nushell. Para mi sorpresa (hasta ahora), es lo \u00fanico que me ha funcionado bien dentro de mis limitaciones. Luego descubr\u00ed que no es POSIX-compliant y que fue creada por una <a href=\"https:\/\/www.sophiajt.com\/introducing-nushell\/\" target=\"_blank\" rel=\"noopener\">ex empleada de Microsoft<\/a>\n. Ahora tiene sentido que sea tan r\u00e1pida en Windows.<\/p>\n<figure class=\"w-full\" >\n \n <picture>\n \n \n <img src=\"https:\/\/cdn.abeestrada.com\/images\/2026\/nushell.jpg\" loading=\"lazy\">\n <\/picture>\n \n \n <\/figure>\n\n<p>La diferencia de incluso un segundo es muy notable. Adem\u00e1s, incluye todas las herramientas b\u00e1sicas que uso, as\u00ed que no creo que me cueste acostumbrarme.<\/p>\n<p>En macOS y Linux seguir\u00e9 usando ZSH, pero si no fuera por esta situaci\u00f3n particular, nunca le habr\u00eda dado una oportunidad a Nushell.<\/p>\n"},{"title":"Minimal Arch Linux","link":"https:\/\/abeestrada.com\/post\/minimal-arch-linux\/","pubDate":"Sun, 28 Dec 2025 00:00:00 -0700","guid":"https:\/\/abeestrada.com\/post\/minimal-arch-linux\/","description":"<p>Desde que repar\u00e9 mi vieja <a href=\"https:\/\/abeestrada.com\/post\/macbook-pro-mid-2010-330uf-capacitor-c9560\/\">MacBook Pro<\/a>\n, se ha convertido en mi m\u00e1quina principal con Linux. Todo comenz\u00f3 cuando descubr\u00ed los <em>tiling window managers<\/em> con <a href=\"https:\/\/i3wm.org\/\" target=\"_blank\" rel=\"noopener\">i3<\/a>\n, del que me hice r\u00e1pidamente fan. Luego, al migrar a <a href=\"https:\/\/wayland.freedesktop.org\/\" target=\"_blank\" rel=\"noopener\">Wayland<\/a>\n, empec\u00e9 a usar <a href=\"https:\/\/swaywm.org\/\" target=\"_blank\" rel=\"noopener\">Sway<\/a>\n, y ahora, gracias a una reciente actualizaci\u00f3n de <a href=\"https:\/\/yalter.github.io\/niri\/\" target=\"_blank\" rel=\"noopener\">Niri<\/a>\n, este gestor de ventanas ya funciona en mi viejo equipo.<\/p>\n<p>Actualmente, considero que esta es la configuraci\u00f3n que m\u00e1s me ha gustado hasta la fecha.<\/p>\n<figure class=\"w-full\" >\n \n <picture>\n \n \n <img src=\"https:\/\/cdn.abeestrada.com\/images\/2025\/minimal-arch-linux.png\" loading=\"lazy\">\n <\/picture>\n \n \n <\/figure>\n\n<p>Es una instalaci\u00f3n base de Arch Linux con los siguientes paquetes:<\/p>\n<ul>\n<li><code>niri<\/code><\/li>\n<li><code>brightnessctl<\/code><\/li>\n<li><code>firefox<\/code><\/li>\n<li><code>fuzzel<\/code><\/li>\n<li><code>kitty<\/code><\/li>\n<li><code>mako<\/code><\/li>\n<li><code>playerctl<\/code><\/li>\n<li><code>swaylock<\/code><\/li>\n<li><code>udiskie<\/code><\/li>\n<li><code>xdg-utils<\/code><\/li>\n<\/ul>\n<p>En mi b\u00fasqueda le\u00ed que varias personas recomiendan <a href=\"https:\/\/noctalia.dev\/\" target=\"_blank\" rel=\"noopener\">Noctalia<\/a>\n como un <em>shell<\/em> para Wayland, pero la verdad es que no lo he visto necesario hasta ahora. Todo lo que necesito lo consigo directamente desde la terminal: uso <a href=\"https:\/\/yazi-rs.github.io\/\" target=\"_blank\" rel=\"noopener\">Yazi<\/a>\n como explorador de archivos, <a href=\"https:\/\/github.com\/itsjunetime\/tdf\" target=\"_blank\" rel=\"noopener\">tdf<\/a>\n o el navegador para ver archivos PDF, Kitty incluye un visualizador de im\u00e1genes mediante el comando <code>kitten icat<\/code>, y <a href=\"https:\/\/mpv.io\/\" target=\"_blank\" rel=\"noopener\">mpv<\/a>\n para reproducir video y audio.<\/p>\n<p>Escuchando m\u00fasica desde YouTube con mpv, navegando por algunas p\u00e1ginas de noticias y editando texto en la terminal, no he superado los 2 GB de uso de memoria RAM.<\/p>\n<p>Despu\u00e9s de muchos intentos, ajustes y experimentos, esta es, sin duda, la instalaci\u00f3n m\u00ednima de Arch Linux que m\u00e1s me ha gustado. Es ligera, funcional y se adapta perfectamente a lo que realmente uso: la terminal, un buen gestor de ventanas y unas pocas herramientas bien elegidas. A veces, menos es m\u00e1s.<\/p>\n"},{"title":"Nuevo M\u00e9todo HTTP Query \u2192","link":"https:\/\/www.ietf.org\/archive\/id\/draft-ietf-httpbis-safe-method-w-body-14.html","pubDate":"Thu, 20 Nov 2025 19:00:00 -0700","guid":"https:\/\/abeestrada.com\/post\/nuevo-m%C3%A9todo-http-query\/","description":"<p>TL;DR Es GET con &ldquo;body&rdquo;<\/p>\n<p>El m\u00e9todo HTTP QUERY es un m\u00e9todo de solicitud seguro e idempotente que permite enviar consultas complejas como contenido de la solicitud en lugar de codificarlas en la URI. Este m\u00e9todo proporciona una soluci\u00f3n entre GET y POST, ofreciendo las ventajas de ambos y garantizando al mismo tiempo que la solicitud sea segura e idempotente. El m\u00e9todo QUERY tambi\u00e9n permite a los servidores asignar URI a las consultas o a los resultados de las consultas para su posterior uso.<\/p>\n<p><a href=\"https:\/\/abeestrada.com\/post\/nuevo-m%C3%A9todo-http-query\/\" target=\"_blank\" title=\"permalink\">#<\/a><\/p>"},{"title":"How Complex Systems Fail \u2192","link":"https:\/\/how.complexsystems.fail\/","pubDate":"Thu, 23 Oct 2025 15:40:00 -0600","guid":"https:\/\/abeestrada.com\/post\/how-complex-systems-fail\/","description":"<p>Excelente ensayo del <a href=\"https:\/\/en.wikipedia.org\/wiki\/Richard_Cook_%28safety_researcher%29\" target=\"_blank\" rel=\"noopener\">Dr. Richard I. Cook<\/a>\n sobre como las fallas en sistemas complejos son inherentes a la naturaleza de estos y sobre como nunca hay una \u00fanica falla, sino una reacci\u00f3n en cadena de m\u00faltiples fallas, que desencadenan en la cat\u00e1strofe de estos sistemas.<\/p>\n<p>Todo esto con relaci\u00f3n sobre la pasada falla que tuvieron los servicios de AWS en la regi\u00f3n <code>us-east-1<\/code> y la explicaci\u00f3n en su <a href=\"https:\/\/aws.amazon.com\/message\/101925\/\" target=\"_blank\" rel=\"noopener\">postmortem<\/a>\n.<\/p>\n<p><a href=\"https:\/\/abeestrada.com\/post\/how-complex-systems-fail\/\" target=\"_blank\" title=\"permalink\">#<\/a><\/p>"},{"title":"Principios SOLID y React","link":"https:\/\/abeestrada.com\/post\/principios-solid-y-react\/","pubDate":"Wed, 15 Oct 2025 11:00:00 -0600","guid":"https:\/\/abeestrada.com\/post\/principios-solid-y-react\/","description":"<p>La aplicaci\u00f3n de los principios <a href=\"https:\/\/en.wikipedia.org\/wiki\/SOLID\" target=\"_blank\" rel=\"noopener\">SOLID<\/a>\n en React ayuda a escribir c\u00f3digo f\u00e1cil de mantener, escalable y comprobable. Aunque SOLID se dise\u00f1\u00f3 originalmente para la programaci\u00f3n orientada a objetos, muchas de sus ideas se adaptan bien a la arquitectura basada en componentes de React.<\/p>\n<h4 id=\"1-single-responsibility-principle-srp\">1. Single Responsibility Principle (SRP)<\/h4>\n<blockquote>\n<p>Un componente (o funci\u00f3n\/clase) solo debe tener una raz\u00f3n para cambiar.<\/p>\n<\/blockquote>\n<p>Modo incorrecto:<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#abb2bf;background-color:#282c34;-moz-tab-size:2;-o-tab-size:2;tab-size:2;-webkit-text-size-adjust:none;\"><code class=\"language-ts\" data-lang=\"ts\"><span style=\"display:flex;\"><span><span style=\"color:#c678dd\">const<\/span> <span style=\"color:#e06c75\">UserProfile<\/span> <span style=\"color:#56b6c2\">=<\/span> () <span style=\"color:#56b6c2\">=&gt;<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#c678dd\">const<\/span> [<span style=\"color:#e06c75\">user<\/span>, <span style=\"color:#e06c75\">setUser<\/span>] <span style=\"color:#56b6c2\">=<\/span> <span style=\"color:#e06c75\">useState<\/span>&lt;<span style=\"color:#e06c75\">User<\/span> | <span style=\"color:#e06c75\">null<\/span>&gt;(<span style=\"color:#e5c07b\">null<\/span>);\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#c678dd\">const<\/span> [<span style=\"color:#e06c75\">name<\/span>, <span style=\"color:#e06c75\">setName<\/span>] <span style=\"color:#56b6c2\">=<\/span> <span style=\"color:#e06c75\">useState<\/span>(<span style=\"color:#98c379\">&#34;&#34;<\/span>);\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#c678dd\">const<\/span> [<span style=\"color:#e06c75\">email<\/span>, <span style=\"color:#e06c75\">setEmail<\/span>] <span style=\"color:#56b6c2\">=<\/span> <span style=\"color:#e06c75\">useState<\/span>(<span style=\"color:#98c379\">&#34;&#34;<\/span>);\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#e06c75\">useEffect<\/span>(() <span style=\"color:#56b6c2\">=&gt;<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#e06c75\">fetchUser<\/span>().<span style=\"color:#e06c75\">then<\/span>(<span style=\"color:#e06c75\">setUser<\/span>);\n<\/span><\/span><span style=\"display:flex;\"><span> }, []);\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#c678dd\">const<\/span> <span style=\"color:#e06c75\">validateEmail<\/span> <span style=\"color:#56b6c2\">=<\/span> (<span style=\"color:#e06c75\">email<\/span>: <span style=\"color:#e5c07b\">string<\/span>) <span style=\"color:#56b6c2\">=&gt;<\/span> <span style=\"color:#98c379\">\/\\S+@\\S+\\.\\S+\/<\/span>.<span style=\"color:#e06c75\">test<\/span>(<span style=\"color:#e06c75\">email<\/span>);\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#c678dd\">const<\/span> <span style=\"color:#e06c75\">handleSubmit<\/span> <span style=\"color:#56b6c2\">=<\/span> () <span style=\"color:#56b6c2\">=&gt;<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#c678dd\">if<\/span> (<span style=\"color:#56b6c2\">!<\/span><span style=\"color:#e06c75\">validateEmail<\/span>(<span style=\"color:#e06c75\">email<\/span>)) {\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#e06c75\">alert<\/span>(<span style=\"color:#98c379\">&#34;Invalid email&#34;<\/span>);\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#c678dd\">return<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span> }\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#e06c75\">updateUser<\/span>({ <span style=\"color:#e06c75\">name<\/span>, <span style=\"color:#e06c75\">email<\/span> });\n<\/span><\/span><span style=\"display:flex;\"><span> };\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#c678dd\">return<\/span> (\n<\/span><\/span><span style=\"display:flex;\"><span> &lt;<span style=\"color:#e06c75\">div<\/span>&gt;\n<\/span><\/span><span style=\"display:flex;\"><span> &lt;<span style=\"color:#e06c75\">h1<\/span>&gt;{<span style=\"color:#e06c75\">user<\/span><span style=\"color:#56b6c2\">?<\/span>.<span style=\"color:#e06c75\">name<\/span>}&lt;\/<span style=\"color:#e06c75\">h1<\/span>&gt;\n<\/span><\/span><span style=\"display:flex;\"><span> &lt;<span style=\"color:#e06c75\">input<\/span> <span style=\"color:#e06c75\">value<\/span><span style=\"color:#56b6c2\">=<\/span>{<span style=\"color:#e06c75\">name<\/span>} <span style=\"color:#e06c75\">onChange<\/span><span style=\"color:#56b6c2\">=<\/span>{<span style=\"color:#e06c75\">e<\/span> <span style=\"color:#56b6c2\">=&gt;<\/span> <span style=\"color:#e06c75\">setName<\/span>(<span style=\"color:#e06c75\">e<\/span>.<span style=\"color:#e06c75\">target<\/span>.<span style=\"color:#e06c75\">value<\/span>)} \/&gt;\n<\/span><\/span><span style=\"display:flex;\"><span> &lt;<span style=\"color:#e06c75\">input<\/span> <span style=\"color:#e06c75\">value<\/span><span style=\"color:#56b6c2\">=<\/span>{<span style=\"color:#e06c75\">email<\/span>} <span style=\"color:#e06c75\">onChange<\/span><span style=\"color:#56b6c2\">=<\/span>{<span style=\"color:#e06c75\">e<\/span> <span style=\"color:#56b6c2\">=&gt;<\/span> <span style=\"color:#e06c75\">setEmail<\/span>(<span style=\"color:#e06c75\">e<\/span>.<span style=\"color:#e06c75\">target<\/span>.<span style=\"color:#e06c75\">value<\/span>)} \/&gt;\n<\/span><\/span><span style=\"display:flex;\"><span> &lt;<span style=\"color:#e06c75\">button<\/span> <span style=\"color:#e06c75\">onClick<\/span><span style=\"color:#56b6c2\">=<\/span>{<span style=\"color:#e06c75\">handleSubmit<\/span>}&gt;<span style=\"color:#e06c75\">Save<\/span>&lt;\/<span style=\"color:#e06c75\">button<\/span>&gt;\n<\/span><\/span><span style=\"display:flex;\"><span> &lt;\/<span style=\"color:#e06c75\">div<\/span>&gt;\n<\/span><\/span><span style=\"display:flex;\"><span> );\n<\/span><\/span><span style=\"display:flex;\"><span>};\n<\/span><\/span><\/code><\/pre><\/div><p>Soluci\u00f3n: Dividir responsabilidades<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#abb2bf;background-color:#282c34;-moz-tab-size:2;-o-tab-size:2;tab-size:2;-webkit-text-size-adjust:none;\"><code class=\"language-ts\" data-lang=\"ts\"><span style=\"display:flex;\"><span><span style=\"color:#7f848e\">\/\/ 1. Data fetching\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#c678dd\">const<\/span> <span style=\"color:#e06c75\">useUser<\/span> <span style=\"color:#56b6c2\">=<\/span> () <span style=\"color:#56b6c2\">=&gt;<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#c678dd\">const<\/span> [<span style=\"color:#e06c75\">user<\/span>, <span style=\"color:#e06c75\">setUser<\/span>] <span style=\"color:#56b6c2\">=<\/span> <span style=\"color:#e06c75\">useState<\/span>&lt;<span style=\"color:#e06c75\">User<\/span> | <span style=\"color:#e06c75\">null<\/span>&gt;(<span style=\"color:#e5c07b\">null<\/span>);\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#e06c75\">useEffect<\/span>(() <span style=\"color:#56b6c2\">=&gt;<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#e06c75\">fetchUser<\/span>().<span style=\"color:#e06c75\">then<\/span>(<span style=\"color:#e06c75\">setUser<\/span>);\n<\/span><\/span><span style=\"display:flex;\"><span> }, []);\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#c678dd\">return<\/span> <span style=\"color:#e06c75\">user<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span>};\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#7f848e\">\/\/ 2. Validation logic\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#c678dd\">const<\/span> <span style=\"color:#e06c75\">useEmailValidation<\/span> <span style=\"color:#56b6c2\">=<\/span> () <span style=\"color:#56b6c2\">=&gt;<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#c678dd\">const<\/span> <span style=\"color:#e06c75\">validate<\/span> <span style=\"color:#56b6c2\">=<\/span> (<span style=\"color:#e06c75\">email<\/span>: <span style=\"color:#e5c07b\">string<\/span>) <span style=\"color:#56b6c2\">=&gt;<\/span> <span style=\"color:#98c379\">\/\\S+@\\S+\\.\\S+\/<\/span>.<span style=\"color:#e06c75\">test<\/span>(<span style=\"color:#e06c75\">email<\/span>);\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#c678dd\">return<\/span> { <span style=\"color:#e06c75\">validate<\/span> };\n<\/span><\/span><span style=\"display:flex;\"><span>};\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#7f848e\">\/\/ 3. UI Component\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#c678dd\">interface<\/span> <span style=\"color:#e06c75\">UserProfileFormProps<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#e06c75\">onSave<\/span><span style=\"color:#56b6c2\">:<\/span> (<span style=\"color:#e06c75\">data<\/span><span style=\"color:#56b6c2\">:<\/span> { <span style=\"color:#e06c75\">name<\/span>: <span style=\"color:#e5c07b\">string<\/span>; <span style=\"color:#e06c75\">email<\/span>: <span style=\"color:#e5c07b\">string<\/span> }) <span style=\"color:#56b6c2\">=&gt;<\/span> <span style=\"color:#c678dd\">void<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span>}\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#c678dd\">const<\/span> <span style=\"color:#e06c75\">UserProfileForm<\/span>: <span style=\"color:#e5c07b\">React.FC<\/span>&lt;<span style=\"color:#e06c75\">UserProfileFormProps<\/span>&gt; <span style=\"color:#56b6c2\">=<\/span> ({ <span style=\"color:#e06c75\">onSave<\/span> }) <span style=\"color:#56b6c2\">=&gt;<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#c678dd\">const<\/span> [<span style=\"color:#e06c75\">name<\/span>, <span style=\"color:#e06c75\">setName<\/span>] <span style=\"color:#56b6c2\">=<\/span> <span style=\"color:#e06c75\">useState<\/span>(<span style=\"color:#98c379\">&#34;&#34;<\/span>);\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#c678dd\">const<\/span> [<span style=\"color:#e06c75\">email<\/span>, <span style=\"color:#e06c75\">setEmail<\/span>] <span style=\"color:#56b6c2\">=<\/span> <span style=\"color:#e06c75\">useState<\/span>(<span style=\"color:#98c379\">&#34;&#34;<\/span>);\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#c678dd\">const<\/span> { <span style=\"color:#e06c75\">validate<\/span> } <span style=\"color:#56b6c2\">=<\/span> <span style=\"color:#e06c75\">useEmailValidation<\/span>();\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#c678dd\">const<\/span> <span style=\"color:#e06c75\">handleSubmit<\/span> <span style=\"color:#56b6c2\">=<\/span> () <span style=\"color:#56b6c2\">=&gt;<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#c678dd\">if<\/span> (<span style=\"color:#56b6c2\">!<\/span><span style=\"color:#e06c75\">validate<\/span>(<span style=\"color:#e06c75\">email<\/span>)) {\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#e06c75\">alert<\/span>(<span style=\"color:#98c379\">&#34;Invalid email&#34;<\/span>);\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#c678dd\">return<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span> }\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#e06c75\">onSave<\/span>({ <span style=\"color:#e06c75\">name<\/span>, <span style=\"color:#e06c75\">email<\/span> });\n<\/span><\/span><span style=\"display:flex;\"><span> };\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#c678dd\">return<\/span> (\n<\/span><\/span><span style=\"display:flex;\"><span> &lt;<span style=\"color:#e06c75\">div<\/span>&gt;\n<\/span><\/span><span style=\"display:flex;\"><span> &lt;<span style=\"color:#e06c75\">input<\/span> <span style=\"color:#e06c75\">value<\/span><span style=\"color:#56b6c2\">=<\/span>{<span style=\"color:#e06c75\">name<\/span>} <span style=\"color:#e06c75\">onChange<\/span><span style=\"color:#56b6c2\">=<\/span>{<span style=\"color:#e06c75\">e<\/span> <span style=\"color:#56b6c2\">=&gt;<\/span> <span style=\"color:#e06c75\">setName<\/span>(<span style=\"color:#e06c75\">e<\/span>.<span style=\"color:#e06c75\">target<\/span>.<span style=\"color:#e06c75\">value<\/span>)} \/&gt;\n<\/span><\/span><span style=\"display:flex;\"><span> &lt;<span style=\"color:#e06c75\">input<\/span> <span style=\"color:#e06c75\">value<\/span><span style=\"color:#56b6c2\">=<\/span>{<span style=\"color:#e06c75\">email<\/span>} <span style=\"color:#e06c75\">onChange<\/span><span style=\"color:#56b6c2\">=<\/span>{<span style=\"color:#e06c75\">e<\/span> <span style=\"color:#56b6c2\">=&gt;<\/span> <span style=\"color:#e06c75\">setEmail<\/span>(<span style=\"color:#e06c75\">e<\/span>.<span style=\"color:#e06c75\">target<\/span>.<span style=\"color:#e06c75\">value<\/span>)} \/&gt;\n<\/span><\/span><span style=\"display:flex;\"><span> &lt;<span style=\"color:#e06c75\">button<\/span> <span style=\"color:#e06c75\">onClick<\/span><span style=\"color:#56b6c2\">=<\/span>{<span style=\"color:#e06c75\">handleSubmit<\/span>}&gt;<span style=\"color:#e06c75\">Save<\/span>&lt;\/<span style=\"color:#e06c75\">button<\/span>&gt;\n<\/span><\/span><span style=\"display:flex;\"><span> &lt;\/<span style=\"color:#e06c75\">div<\/span>&gt;\n<\/span><\/span><span style=\"display:flex;\"><span> );\n<\/span><\/span><span style=\"display:flex;\"><span>};\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#7f848e\">\/\/ 4. Main container\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#c678dd\">const<\/span> <span style=\"color:#e06c75\">UserProfile<\/span> <span style=\"color:#56b6c2\">=<\/span> () <span style=\"color:#56b6c2\">=&gt;<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#c678dd\">const<\/span> <span style=\"color:#e06c75\">user<\/span> <span style=\"color:#56b6c2\">=<\/span> <span style=\"color:#e06c75\">useUser<\/span>();\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#c678dd\">const<\/span> <span style=\"color:#e06c75\">handleSave<\/span> <span style=\"color:#56b6c2\">=<\/span> (<span style=\"color:#e06c75\">data<\/span><span style=\"color:#56b6c2\">:<\/span> { <span style=\"color:#e06c75\">name<\/span>: <span style=\"color:#e5c07b\">string<\/span>; <span style=\"color:#e06c75\">email<\/span>: <span style=\"color:#e5c07b\">string<\/span> }) <span style=\"color:#56b6c2\">=&gt;<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#e06c75\">updateUser<\/span>(<span style=\"color:#e06c75\">data<\/span>);\n<\/span><\/span><span style=\"display:flex;\"><span> };\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#c678dd\">if<\/span> (<span style=\"color:#56b6c2\">!<\/span><span style=\"color:#e06c75\">user<\/span>) <span style=\"color:#c678dd\">return<\/span> &lt;<span style=\"color:#e06c75\">div<\/span>&gt;<span style=\"color:#e06c75\">Loading<\/span>...&lt;\/<span style=\"color:#e06c75\">div<\/span>&gt;;\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#c678dd\">return<\/span> (\n<\/span><\/span><span style=\"display:flex;\"><span> &lt;<span style=\"color:#e06c75\">div<\/span>&gt;\n<\/span><\/span><span style=\"display:flex;\"><span> &lt;<span style=\"color:#e06c75\">h1<\/span>&gt;{<span style=\"color:#e06c75\">user<\/span>.<span style=\"color:#e06c75\">name<\/span>}&lt;\/<span style=\"color:#e06c75\">h1<\/span>&gt;\n<\/span><\/span><span style=\"display:flex;\"><span> &lt;<span style=\"color:#e06c75\">UserProfileForm<\/span> <span style=\"color:#e06c75\">onSave<\/span><span style=\"color:#56b6c2\">=<\/span>{<span style=\"color:#e06c75\">handleSave<\/span>} \/&gt;\n<\/span><\/span><span style=\"display:flex;\"><span> &lt;\/<span style=\"color:#e06c75\">div<\/span>&gt;\n<\/span><\/span><span style=\"display:flex;\"><span> );\n<\/span><\/span><span style=\"display:flex;\"><span>};\n<\/span><\/span><\/code><\/pre><\/div><p>Cada parte tiene una responsabilidad: obtenci\u00f3n de datos, validaci\u00f3n, interfaz de usuario u orquestaci\u00f3n.<\/p>\n<hr>\n<h4 id=\"2-openclosed-principle-ocp\">2. Open\/Closed Principle (OCP)<\/h4>\n<blockquote>\n<p>Los componentes deben estar abiertos a la ampliaci\u00f3n, pero cerrados a la modificaci\u00f3n.<\/p>\n<\/blockquote>\n<p>Modo incorrecto:<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#abb2bf;background-color:#282c34;-moz-tab-size:2;-o-tab-size:2;tab-size:2;-webkit-text-size-adjust:none;\"><code class=\"language-ts\" data-lang=\"ts\"><span style=\"display:flex;\"><span><span style=\"color:#c678dd\">const<\/span> <span style=\"color:#e06c75\">Notification<\/span> <span style=\"color:#56b6c2\">=<\/span> ({ <span style=\"color:#c678dd\">type<\/span> }<span style=\"color:#56b6c2\">:<\/span> { <span style=\"color:#c678dd\">type<\/span><span style=\"color:#56b6c2\">:<\/span> <span style=\"color:#98c379\">&#34;success&#34;<\/span> <span style=\"color:#56b6c2\">|<\/span> <span style=\"color:#98c379\">&#34;error&#34;<\/span> <span style=\"color:#56b6c2\">|<\/span> <span style=\"color:#98c379\">&#34;warning&#34;<\/span> }) <span style=\"color:#56b6c2\">=&gt;<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#c678dd\">let<\/span> <span style=\"color:#e06c75\">color<\/span> <span style=\"color:#56b6c2\">=<\/span> <span style=\"color:#98c379\">&#34;gray&#34;<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#c678dd\">if<\/span> (<span style=\"color:#c678dd\">type<\/span> <span style=\"color:#56b6c2\">===<\/span> <span style=\"color:#98c379\">&#34;success&#34;<\/span>) <span style=\"color:#e06c75\">color<\/span> <span style=\"color:#56b6c2\">=<\/span> <span style=\"color:#98c379\">&#34;green&#34;<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#c678dd\">else<\/span> <span style=\"color:#c678dd\">if<\/span> (<span style=\"color:#c678dd\">type<\/span> <span style=\"color:#56b6c2\">===<\/span> <span style=\"color:#98c379\">&#34;error&#34;<\/span>) <span style=\"color:#e06c75\">color<\/span> <span style=\"color:#56b6c2\">=<\/span> <span style=\"color:#98c379\">&#34;red&#34;<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#c678dd\">else<\/span> <span style=\"color:#c678dd\">if<\/span> (<span style=\"color:#c678dd\">type<\/span> <span style=\"color:#56b6c2\">===<\/span> <span style=\"color:#98c379\">&#34;warning&#34;<\/span>) <span style=\"color:#e06c75\">color<\/span> <span style=\"color:#56b6c2\">=<\/span> <span style=\"color:#98c379\">&#34;orange&#34;<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#c678dd\">return<\/span> &lt;<span style=\"color:#e06c75\">div<\/span> <span style=\"color:#e06c75\">style<\/span><span style=\"color:#56b6c2\">=<\/span>{{ <span style=\"color:#e06c75\">color<\/span> }}&gt;{<span style=\"color:#c678dd\">type<\/span>} <span style=\"color:#e06c75\">message<\/span>&lt;\/<span style=\"color:#e06c75\">div<\/span>&gt;;\n<\/span><\/span><span style=\"display:flex;\"><span>};\n<\/span><\/span><\/code><\/pre><\/div><p>Para a\u00f1adir un nuevo tipo es necesario modificar este componente.<\/p>\n<p>Soluci\u00f3n: Utilizar estrategia o configuraci\u00f3n<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#abb2bf;background-color:#282c34;-moz-tab-size:2;-o-tab-size:2;tab-size:2;-webkit-text-size-adjust:none;\"><code class=\"language-ts\" data-lang=\"ts\"><span style=\"display:flex;\"><span><span style=\"color:#c678dd\">const<\/span> <span style=\"color:#e06c75\">notificationStyles<\/span>: <span style=\"color:#e5c07b\">Record<\/span>&lt;<span style=\"color:#e06c75\">string<\/span>, <span style=\"color:#e06c75\">React.CSSProperties<\/span>&gt; <span style=\"color:#56b6c2\">=<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#e06c75\">success<\/span><span style=\"color:#56b6c2\">:<\/span> { <span style=\"color:#e06c75\">color<\/span><span style=\"color:#56b6c2\">:<\/span> <span style=\"color:#98c379\">&#34;green&#34;<\/span> },\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#e06c75\">error<\/span><span style=\"color:#56b6c2\">:<\/span> { <span style=\"color:#e06c75\">color<\/span><span style=\"color:#56b6c2\">:<\/span> <span style=\"color:#98c379\">&#34;red&#34;<\/span> },\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#e06c75\">warning<\/span><span style=\"color:#56b6c2\">:<\/span> { <span style=\"color:#e06c75\">color<\/span><span style=\"color:#56b6c2\">:<\/span> <span style=\"color:#98c379\">&#34;orange&#34;<\/span> },\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#e06c75\">info<\/span><span style=\"color:#56b6c2\">:<\/span> { <span style=\"color:#e06c75\">color<\/span><span style=\"color:#56b6c2\">:<\/span> <span style=\"color:#98c379\">&#34;blue&#34;<\/span> }, <span style=\"color:#7f848e\">\/\/ easily extensible\n<\/span><\/span><\/span><span style=\"display:flex;\"><span>};\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#c678dd\">interface<\/span> <span style=\"color:#e06c75\">NotificationProps<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#c678dd\">type<\/span><span style=\"color:#56b6c2\">:<\/span> <span style=\"color:#c678dd\">keyof<\/span> <span style=\"color:#c678dd\">typeof<\/span> <span style=\"color:#e06c75\">notificationStyles<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span>}\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#c678dd\">const<\/span> <span style=\"color:#e06c75\">Notification<\/span>: <span style=\"color:#e5c07b\">React.FC<\/span>&lt;<span style=\"color:#e06c75\">NotificationProps<\/span>&gt; <span style=\"color:#56b6c2\">=<\/span> ({ <span style=\"color:#c678dd\">type<\/span> }) <span style=\"color:#56b6c2\">=&gt;<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#c678dd\">return<\/span> &lt;<span style=\"color:#e06c75\">div<\/span> <span style=\"color:#e06c75\">style<\/span><span style=\"color:#56b6c2\">=<\/span>{<span style=\"color:#e06c75\">notificationStyles<\/span>[<span style=\"color:#c678dd\">type<\/span>]}&gt;{<span style=\"color:#c678dd\">type<\/span>} <span style=\"color:#e06c75\">message<\/span>&lt;\/<span style=\"color:#e06c75\">div<\/span>&gt;;\n<\/span><\/span><span style=\"display:flex;\"><span>};\n<\/span><\/span><\/code><\/pre><\/div><p>Se puede ampliar el comportamiento sin cambiar el componente.<\/p>\n<hr>\n<h4 id=\"3-liskov-substitution-principle-lsp\">3. Liskov Substitution Principle (LSP)<\/h4>\n<blockquote>\n<p>Los subtipos (por ejemplo, componentes o hooks) deben ser sustituibles por sus tipos base.<\/p>\n<\/blockquote>\n<p>En React, esto suele aplicarse a los props de los componentes o a los hooks personalizados.<\/p>\n<p>Modo incorrecto:<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#abb2bf;background-color:#282c34;-moz-tab-size:2;-o-tab-size:2;tab-size:2;-webkit-text-size-adjust:none;\"><code class=\"language-ts\" data-lang=\"ts\"><span style=\"display:flex;\"><span><span style=\"color:#c678dd\">interface<\/span> <span style=\"color:#e06c75\">ButtonProps<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#e06c75\">variant<\/span><span style=\"color:#56b6c2\">:<\/span> <span style=\"color:#98c379\">&#34;primary&#34;<\/span> <span style=\"color:#56b6c2\">|<\/span> <span style=\"color:#98c379\">&#34;secondary&#34;<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#e06c75\">onClick<\/span><span style=\"color:#56b6c2\">:<\/span> () <span style=\"color:#56b6c2\">=&gt;<\/span> <span style=\"color:#c678dd\">void<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span>}\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#c678dd\">const<\/span> <span style=\"color:#e06c75\">PrimaryButton<\/span>: <span style=\"color:#e5c07b\">React.FC<\/span>&lt;<span style=\"color:#e06c75\">ButtonProps<\/span>&gt; <span style=\"color:#56b6c2\">=<\/span> ({ <span style=\"color:#e06c75\">onClick<\/span> }) <span style=\"color:#56b6c2\">=&gt;<\/span> (\n<\/span><\/span><span style=\"display:flex;\"><span> &lt;<span style=\"color:#e06c75\">button<\/span> <span style=\"color:#e06c75\">className<\/span><span style=\"color:#56b6c2\">=<\/span><span style=\"color:#98c379\">&#34;primary&#34;<\/span> <span style=\"color:#e06c75\">onClick<\/span><span style=\"color:#56b6c2\">=<\/span>{<span style=\"color:#e06c75\">onClick<\/span>} \/&gt;\n<\/span><\/span><span style=\"display:flex;\"><span>);\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#c678dd\">const<\/span> <span style=\"color:#e06c75\">DestructiveButton<\/span>: <span style=\"color:#e5c07b\">React.FC<\/span>&lt;<span style=\"color:#e06c75\">ButtonProps<\/span>&gt; <span style=\"color:#56b6c2\">=<\/span> ({ <span style=\"color:#e06c75\">onClick<\/span> }) <span style=\"color:#56b6c2\">=&gt;<\/span> (\n<\/span><\/span><span style=\"display:flex;\"><span> &lt;<span style=\"color:#e06c75\">button<\/span> <span style=\"color:#e06c75\">className<\/span><span style=\"color:#56b6c2\">=<\/span><span style=\"color:#98c379\">&#34;danger&#34;<\/span> <span style=\"color:#e06c75\">onClick<\/span><span style=\"color:#56b6c2\">=<\/span>{<span style=\"color:#e06c75\">onClick<\/span>} \/&gt; <span style=\"color:#7f848e\">\/\/ ignores variant!\n<\/span><\/span><\/span><span style=\"display:flex;\"><span>);\n<\/span><\/span><\/code><\/pre><\/div><p>Si se sustituye <code>PrimaryButton<\/code> por <code>DestructiveButton<\/code>, el comportamiento cambia de forma inesperada.<\/p>\n<p>Soluci\u00f3n: Respetar el contrato.<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#abb2bf;background-color:#282c34;-moz-tab-size:2;-o-tab-size:2;tab-size:2;-webkit-text-size-adjust:none;\"><code class=\"language-ts\" data-lang=\"ts\"><span style=\"display:flex;\"><span><span style=\"color:#c678dd\">const<\/span> <span style=\"color:#e06c75\">ThemedButton<\/span>: <span style=\"color:#e5c07b\">React.FC<\/span>&lt;<span style=\"color:#e06c75\">ButtonProps<\/span>&gt; <span style=\"color:#56b6c2\">=<\/span> ({ <span style=\"color:#e06c75\">variant<\/span>, <span style=\"color:#e06c75\">onClick<\/span> }) <span style=\"color:#56b6c2\">=&gt;<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#c678dd\">const<\/span> <span style=\"color:#e06c75\">className<\/span> <span style=\"color:#56b6c2\">=<\/span> <span style=\"color:#e06c75\">variant<\/span> <span style=\"color:#56b6c2\">===<\/span> <span style=\"color:#98c379\">&#34;primary&#34;<\/span> <span style=\"color:#56b6c2\">?<\/span> <span style=\"color:#98c379\">&#34;primary&#34;<\/span> <span style=\"color:#56b6c2\">:<\/span> <span style=\"color:#98c379\">&#34;secondary&#34;<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#c678dd\">return<\/span> &lt;<span style=\"color:#e06c75\">button<\/span> <span style=\"color:#e06c75\">className<\/span><span style=\"color:#56b6c2\">=<\/span>{<span style=\"color:#e06c75\">className<\/span>} <span style=\"color:#e06c75\">onClick<\/span><span style=\"color:#56b6c2\">=<\/span>{<span style=\"color:#e06c75\">onClick<\/span>} \/&gt;;\n<\/span><\/span><span style=\"display:flex;\"><span>};\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#7f848e\">\/\/ Or a more flexible interface\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#c678dd\">interface<\/span> <span style=\"color:#e06c75\">FlexibleButtonProps<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#e06c75\">theme<\/span><span style=\"color:#56b6c2\">:<\/span> <span style=\"color:#98c379\">&#34;primary&#34;<\/span> <span style=\"color:#56b6c2\">|<\/span> <span style=\"color:#98c379\">&#34;secondary&#34;<\/span> <span style=\"color:#56b6c2\">|<\/span> <span style=\"color:#98c379\">&#34;danger&#34;<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#e06c75\">onClick<\/span><span style=\"color:#56b6c2\">:<\/span> () <span style=\"color:#56b6c2\">=&gt;<\/span> <span style=\"color:#c678dd\">void<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span>}\n<\/span><\/span><\/code><\/pre><\/div><p>Cualquier componente que implemente la misma interfaz se comporta de manera coherente.<\/p>\n<hr>\n<h4 id=\"4-interface-segregation-principle-isp\">4. Interface Segregation Principle (ISP)<\/h4>\n<blockquote>\n<p>No obligues a los clientes a depender de interfaces que no utilizan.<\/p>\n<\/blockquote>\n<p>En React, esto significa evitar los props excesivos.<\/p>\n<p>Modo incorrecto:<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#abb2bf;background-color:#282c34;-moz-tab-size:2;-o-tab-size:2;tab-size:2;-webkit-text-size-adjust:none;\"><code class=\"language-ts\" data-lang=\"ts\"><span style=\"display:flex;\"><span><span style=\"color:#c678dd\">interface<\/span> <span style=\"color:#e06c75\">UserCardProps<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#e06c75\">user<\/span>: <span style=\"color:#e5c07b\">User<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#e06c75\">onEdit<\/span><span style=\"color:#56b6c2\">?:<\/span> () <span style=\"color:#56b6c2\">=&gt;<\/span> <span style=\"color:#c678dd\">void<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#e06c75\">onDelete<\/span><span style=\"color:#56b6c2\">?:<\/span> () <span style=\"color:#56b6c2\">=&gt;<\/span> <span style=\"color:#c678dd\">void<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#e06c75\">showActions?<\/span>: <span style=\"color:#e5c07b\">boolean<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#e06c75\">isEditable?<\/span>: <span style=\"color:#e5c07b\">boolean<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#e06c75\">isAdminView?<\/span>: <span style=\"color:#e5c07b\">boolean<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#7f848e\">\/\/ ... 10 more optional props\n<\/span><\/span><\/span><span style=\"display:flex;\"><span>}\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#c678dd\">const<\/span> <span style=\"color:#e06c75\">UserCard<\/span>: <span style=\"color:#e5c07b\">React.FC<\/span>&lt;<span style=\"color:#e06c75\">UserCardProps<\/span>&gt; <span style=\"color:#56b6c2\">=<\/span> (<span style=\"color:#e06c75\">props<\/span>) <span style=\"color:#56b6c2\">=&gt;<\/span> {<span style=\"color:#7f848e\">\/* complex logic *\/<\/span>};\n<\/span><\/span><\/code><\/pre><\/div><p>La mayor\u00eda de los usos solo necesitan <code>user<\/code>.<\/p>\n<p>Soluci\u00f3n: Dividir en componentes espec\u00edficos.<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#abb2bf;background-color:#282c34;-moz-tab-size:2;-o-tab-size:2;tab-size:2;-webkit-text-size-adjust:none;\"><code class=\"language-ts\" data-lang=\"ts\"><span style=\"display:flex;\"><span><span style=\"color:#7f848e\">\/\/ Minimal version\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#c678dd\">const<\/span> <span style=\"color:#e06c75\">SimpleUserCard<\/span>: <span style=\"color:#e5c07b\">React.FC<\/span><span style=\"color:#56b6c2\">&lt;<\/span>{ <span style=\"color:#e06c75\">user<\/span>: <span style=\"color:#e5c07b\">User<\/span> }<span style=\"color:#56b6c2\">&gt;<\/span> <span style=\"color:#56b6c2\">=<\/span> ({ <span style=\"color:#e06c75\">user<\/span> }) <span style=\"color:#56b6c2\">=&gt;<\/span> (\n<\/span><\/span><span style=\"display:flex;\"><span> &lt;<span style=\"color:#e06c75\">div<\/span>&gt;{<span style=\"color:#e06c75\">user<\/span>.<span style=\"color:#e06c75\">name<\/span>}&lt;\/<span style=\"color:#e06c75\">div<\/span>&gt;\n<\/span><\/span><span style=\"display:flex;\"><span>);\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#7f848e\">\/\/ With actions\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#c678dd\">const<\/span> <span style=\"color:#e06c75\">EditableUserCard<\/span>: <span style=\"color:#e5c07b\">React.FC<\/span><span style=\"color:#56b6c2\">&lt;<\/span>\n<\/span><\/span><span style=\"display:flex;\"><span> { <span style=\"color:#e06c75\">user<\/span>: <span style=\"color:#e5c07b\">User<\/span>; <span style=\"color:#e06c75\">onEdit<\/span><span style=\"color:#56b6c2\">:<\/span> () <span style=\"color:#56b6c2\">=&gt;<\/span> <span style=\"color:#c678dd\">void<\/span>; <span style=\"color:#e06c75\">onDelete<\/span><span style=\"color:#56b6c2\">:<\/span> () <span style=\"color:#56b6c2\">=&gt;<\/span> <span style=\"color:#c678dd\">void<\/span> }\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#56b6c2\">&gt;<\/span> <span style=\"color:#56b6c2\">=<\/span> ({ <span style=\"color:#e06c75\">user<\/span>, <span style=\"color:#e06c75\">onEdit<\/span>, <span style=\"color:#e06c75\">onDelete<\/span> }) <span style=\"color:#56b6c2\">=&gt;<\/span> (\n<\/span><\/span><span style=\"display:flex;\"><span> &lt;<span style=\"color:#e06c75\">div<\/span>&gt;\n<\/span><\/span><span style=\"display:flex;\"><span> &lt;<span style=\"color:#e06c75\">SimpleUserCard<\/span> <span style=\"color:#e06c75\">user<\/span><span style=\"color:#56b6c2\">=<\/span>{<span style=\"color:#e06c75\">user<\/span>} \/&gt;\n<\/span><\/span><span style=\"display:flex;\"><span> &lt;<span style=\"color:#e06c75\">button<\/span> <span style=\"color:#e06c75\">onClick<\/span><span style=\"color:#56b6c2\">=<\/span>{<span style=\"color:#e06c75\">onEdit<\/span>}&gt;<span style=\"color:#e06c75\">Edit<\/span>&lt;\/<span style=\"color:#e06c75\">button<\/span>&gt;\n<\/span><\/span><span style=\"display:flex;\"><span> &lt;<span style=\"color:#e06c75\">button<\/span> <span style=\"color:#e06c75\">onClick<\/span><span style=\"color:#56b6c2\">=<\/span>{<span style=\"color:#e06c75\">onDelete<\/span>}&gt;<span style=\"color:#e06c75\">Delete<\/span>&lt;\/<span style=\"color:#e06c75\">button<\/span>&gt;\n<\/span><\/span><span style=\"display:flex;\"><span> &lt;\/<span style=\"color:#e06c75\">div<\/span>&gt;\n<\/span><\/span><span style=\"display:flex;\"><span>);\n<\/span><\/span><\/code><\/pre><\/div><p>Los consumidores solo dependen de lo que necesitan.<\/p>\n<hr>\n<h4 id=\"5-dependency-inversion-principle-dip\">5. Dependency Inversion Principle (DIP)<\/h4>\n<blockquote>\n<p>Los m\u00f3dulos de alto nivel no deben depender de detalles de bajo nivel. Dependen de abstracciones.<\/p>\n<\/blockquote>\n<p>En React, esto significa desacoplar los componentes de los servicios concretos (por ejemplo, los clientes API).<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#abb2bf;background-color:#282c34;-moz-tab-size:2;-o-tab-size:2;tab-size:2;-webkit-text-size-adjust:none;\"><code class=\"language-ts\" data-lang=\"ts\"><span style=\"display:flex;\"><span><span style=\"color:#c678dd\">const<\/span> <span style=\"color:#e06c75\">UserProfile<\/span> <span style=\"color:#56b6c2\">=<\/span> () <span style=\"color:#56b6c2\">=&gt;<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#c678dd\">const<\/span> [<span style=\"color:#e06c75\">user<\/span>, <span style=\"color:#e06c75\">setUser<\/span>] <span style=\"color:#56b6c2\">=<\/span> <span style=\"color:#e06c75\">useState<\/span>&lt;<span style=\"color:#e06c75\">User<\/span> | <span style=\"color:#e06c75\">null<\/span>&gt;(<span style=\"color:#e5c07b\">null<\/span>);\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#e06c75\">useEffect<\/span>(() <span style=\"color:#56b6c2\">=&gt;<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#7f848e\">\/\/ Direct dependency on concrete implementation\n<\/span><\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#e06c75\">axios<\/span>.<span style=\"color:#c678dd\">get<\/span>(<span style=\"color:#98c379\">&#34;\/api\/user&#34;<\/span>).<span style=\"color:#e06c75\">then<\/span>(<span style=\"color:#e06c75\">res<\/span> <span style=\"color:#56b6c2\">=&gt;<\/span> <span style=\"color:#e06c75\">setUser<\/span>(<span style=\"color:#e06c75\">res<\/span>.<span style=\"color:#e06c75\">data<\/span>));\n<\/span><\/span><span style=\"display:flex;\"><span> }, []);\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#c678dd\">return<\/span> &lt;<span style=\"color:#e06c75\">div<\/span>&gt;{<span style=\"color:#e06c75\">user<\/span><span style=\"color:#56b6c2\">?<\/span>.<span style=\"color:#e06c75\">name<\/span>}&lt;\/<span style=\"color:#e06c75\">div<\/span>&gt;;\n<\/span><\/span><span style=\"display:flex;\"><span>};\n<\/span><\/span><\/code><\/pre><\/div><p>Es dif\u00edcil probar o cambiar la capa API.<\/p>\n<p>Soluci\u00f3n: Inyectar dependencias<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#abb2bf;background-color:#282c34;-moz-tab-size:2;-o-tab-size:2;tab-size:2;-webkit-text-size-adjust:none;\"><code class=\"language-ts\" data-lang=\"ts\"><span style=\"display:flex;\"><span><span style=\"color:#7f848e\">\/\/ Abstraction\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#c678dd\">interface<\/span> <span style=\"color:#e06c75\">UserService<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#e06c75\">getUser<\/span>()<span style=\"color:#56b6c2\">:<\/span> <span style=\"color:#e06c75\">Promise<\/span>&lt;<span style=\"color:#e06c75\">User<\/span>&gt;;\n<\/span><\/span><span style=\"display:flex;\"><span>}\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#7f848e\">\/\/ Concrete implementation\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#c678dd\">const<\/span> <span style=\"color:#e06c75\">ApiUserService<\/span>: <span style=\"color:#e5c07b\">UserService<\/span> <span style=\"color:#56b6c2\">=<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#e06c75\">getUser<\/span><span style=\"color:#56b6c2\">:<\/span> () <span style=\"color:#56b6c2\">=&gt;<\/span> <span style=\"color:#e06c75\">axios<\/span>.<span style=\"color:#c678dd\">get<\/span>(<span style=\"color:#98c379\">&#34;\/api\/user&#34;<\/span>).<span style=\"color:#e06c75\">then<\/span>(<span style=\"color:#e06c75\">res<\/span> <span style=\"color:#56b6c2\">=&gt;<\/span> <span style=\"color:#e06c75\">res<\/span>.<span style=\"color:#e06c75\">data<\/span>),\n<\/span><\/span><span style=\"display:flex;\"><span>};\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#7f848e\">\/\/ For testing\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#c678dd\">const<\/span> <span style=\"color:#e06c75\">MockUserService<\/span>: <span style=\"color:#e5c07b\">UserService<\/span> <span style=\"color:#56b6c2\">=<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#e06c75\">getUser<\/span><span style=\"color:#56b6c2\">:<\/span> () <span style=\"color:#56b6c2\">=&gt;<\/span> <span style=\"color:#e06c75\">Promise<\/span>.<span style=\"color:#e06c75\">resolve<\/span>({ <span style=\"color:#e06c75\">id<\/span>: <span style=\"color:#e5c07b\">1<\/span>, <span style=\"color:#e06c75\">name<\/span><span style=\"color:#56b6c2\">:<\/span> <span style=\"color:#98c379\">&#34;Test&#34;<\/span> }),\n<\/span><\/span><span style=\"display:flex;\"><span>};\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#7f848e\">\/\/ Component depends on abstraction\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#c678dd\">interface<\/span> <span style=\"color:#e06c75\">UserProfileProps<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#e06c75\">userService<\/span>: <span style=\"color:#e5c07b\">UserService<\/span>;\n<\/span><\/span><span style=\"display:flex;\"><span>}\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#c678dd\">const<\/span> <span style=\"color:#e06c75\">UserProfile<\/span>: <span style=\"color:#e5c07b\">React.FC<\/span>&lt;<span style=\"color:#e06c75\">UserProfileProps<\/span>&gt; <span style=\"color:#56b6c2\">=<\/span> ({ <span style=\"color:#e06c75\">userService<\/span> }) <span style=\"color:#56b6c2\">=&gt;<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#c678dd\">const<\/span> [<span style=\"color:#e06c75\">user<\/span>, <span style=\"color:#e06c75\">setUser<\/span>] <span style=\"color:#56b6c2\">=<\/span> <span style=\"color:#e06c75\">useState<\/span>&lt;<span style=\"color:#e06c75\">User<\/span> | <span style=\"color:#e06c75\">null<\/span>&gt;(<span style=\"color:#e5c07b\">null<\/span>);\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#e06c75\">useEffect<\/span>(() <span style=\"color:#56b6c2\">=&gt;<\/span> {\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#e06c75\">userService<\/span>.<span style=\"color:#e06c75\">getUser<\/span>().<span style=\"color:#e06c75\">then<\/span>(<span style=\"color:#e06c75\">setUser<\/span>);\n<\/span><\/span><span style=\"display:flex;\"><span> }, [<span style=\"color:#e06c75\">userService<\/span>]);\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span> <span style=\"color:#c678dd\">return<\/span> &lt;<span style=\"color:#e06c75\">div<\/span>&gt;{<span style=\"color:#e06c75\">user<\/span><span style=\"color:#56b6c2\">?<\/span>.<span style=\"color:#e06c75\">name<\/span>}&lt;\/<span style=\"color:#e06c75\">div<\/span>&gt;;\n<\/span><\/span><span style=\"display:flex;\"><span>};\n<\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#7f848e\">\/\/ Usage\n<\/span><\/span><\/span><span style=\"display:flex;\"><span>&lt;<span style=\"color:#e06c75\">UserProfile<\/span> <span style=\"color:#e06c75\">userService<\/span><span style=\"color:#56b6c2\">=<\/span>{<span style=\"color:#e06c75\">ApiUserService<\/span>} \/&gt;;\n<\/span><\/span><\/code><\/pre><\/div><p>Intercambiable, comprobable y desacoplado.<\/p>\n<hr>\n<p>En res\u00famen:<\/p>\n<ul>\n<li>SRP: Dividir componentes\/hooks por inter\u00e9s (interfaz de usuario, l\u00f3gica, datos)<\/li>\n<li>OCP: Dise\u00f1ar componentes que admitan extensiones (por ejemplo, mediante props u objetos de configuraci\u00f3n).<\/li>\n<li>LSP: Asegurarse de que los sustitutos de los componentes se comporten de manera coherente.<\/li>\n<li>ISP: Evita la sobrecarga de propiedades; crea API de componentes espec\u00edficas.<\/li>\n<li>DIP: Inyectar servicios (clientes API, etc.) en lugar de codificarlos directamente.<\/li>\n<\/ul>\n<hr>\n<p>Al aplicar SOLID en React, se crean aplicaciones m\u00e1s f\u00e1ciles de probar, refactorizar y escalar, incluso en un marco de interfaz de usuario declarativo y funcional.<\/p>\n"},{"title":"Astro Build Time","link":"https:\/\/abeestrada.com\/post\/astro-build-time\/","pubDate":"Thu, 02 Oct 2025 16:00:00 -0600","guid":"https:\/\/abeestrada.com\/post\/astro-build-time\/","description":"<p>Tengo una p\u00e1gina web construida con <a href=\"https:\/\/astro.build\/\" target=\"_blank\" rel=\"noopener\">Astro<\/a>\n y not\u00e9 que el tiempo de compilaci\u00f3n hab\u00eda aumentado a m\u00e1s de un minuto para generar aproximadamente 500 p\u00e1ginas est\u00e1ticas.<\/p>\n<p>Buscando optimizaciones, la recomendaci\u00f3n general era clara: evitar ejecutar cualquier operaci\u00f3n <code>fetch<\/code> dentro de las p\u00e1ginas que se generan din\u00e1micamente o que utilizan la funci\u00f3n <code>getStaticPaths<\/code>. Por ello, tom\u00e9 la decisi\u00f3n de migrar estas p\u00e1ginas a la nueva API de &ldquo;Content Collections&rdquo; de Astro, una funcionalidad que no estaba disponible cuando el sitio fue creado.<\/p>\n<p>El cambio realizado fue el siguiente:<\/p>\n<div class=\"highlight\"><pre tabindex=\"0\" style=\"color:#abb2bf;background-color:#282c34;-moz-tab-size:2;-o-tab-size:2;tab-size:2;-webkit-text-size-adjust:none;\"><code class=\"language-diff\" data-lang=\"diff\"><span style=\"display:flex;\"><span><span style=\"color:#e06c75\">-export const getStaticPaths = async () =&gt; {\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#e06c75\">- const res = await fetch(`${API_URL}\/podcasts`, {\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#e06c75\">- headers: {\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#e06c75\">- &#34;Content-Type&#34;: &#34;application\/json&#34;,\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#e06c75\">- },\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#e06c75\">- method: &#34;GET&#34;,\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#e06c75\">- });\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#e06c75\">- const { podcasts } = await res?.json();\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#e06c75\">- return podcasts.map((podcast) =&gt; ({\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#e06c75\">- params: { podcast: podcast.id },\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#e06c75\">- }));\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#e06c75\">-};\n<\/span><\/span><\/span><span style=\"display:flex;\"><span>\n<\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#98c379;font-weight:bold\">+import { getCollection } from &#34;astro:content&#34;;\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#98c379;font-weight:bold\">+export async function getStaticPaths() {\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#98c379;font-weight:bold\">+ const podcasts = await getCollection(&#34;podcasts&#34;);\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#98c379;font-weight:bold\">+ return podcasts.map((podcast) =&gt; ({\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#98c379;font-weight:bold\">+ params: { podcast: podcast.id },\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#98c379;font-weight:bold\">+ }));\n<\/span><\/span><\/span><span style=\"display:flex;\"><span><span style=\"color:#98c379;font-weight:bold\">+}\n<\/span><\/span><\/span><\/code><\/pre><\/div><p>Con esta migraci\u00f3n, logr\u00e9 que las 500 p\u00e1ginas dejen de hacer llamadas individuales a la API.<\/p>\n<p>Ahora, toda la informaci\u00f3n necesaria se captura una sola vez al inicio del proceso de <code>build<\/code> y se almacena en memoria. Esto garantiza que el tiempo de acceso sea casi inmediato y elimina los costos de latencia. El resultado fue una mejora dr\u00e1stica: el tiempo de carga pas\u00f3 de 100 ms a solo 1 ms por p\u00e1gina.<\/p>\n<p>Esta optimizaci\u00f3n se refleja directamente en una reducci\u00f3n significativa del tiempo total de generaci\u00f3n del sitio.<\/p>\n<figure class=\"w-1\/2\" >\n \n <picture>\n \n \n <img src=\"https:\/\/cdn.abeestrada.com\/images\/2025\/astro-build-time.jpg\" loading=\"lazy\">\n <\/picture>\n \n \n <\/figure>\n\n<p>Fuente:<\/p>\n<ul>\n<li><a href=\"https:\/\/docs.astro.build\/en\/guides\/content-collections\/\" target=\"_blank\" rel=\"noopener\">Content Collections<\/a>\n<\/li>\n<\/ul>\n"},{"title":"Protocolos para APIs","link":"https:\/\/abeestrada.com\/post\/protocolos-para-apis\/","pubDate":"Sun, 24 Aug 2025 22:55:00 -0600","guid":"https:\/\/abeestrada.com\/post\/protocolos-para-apis\/","description":"<p>En el mundo del desarrollo de software, las APIs (Interfaces de Programaci\u00f3n de Aplicaciones) son el puente que permite la comunicaci\u00f3n entre diferentes sistemas. Sin embargo, elegir el protocolo adecuado para una API no es solo una decisi\u00f3n t\u00e9cnica: puede marcar la diferencia entre un sistema r\u00e1pido, seguro y escalable, y uno que sufre de cuellos de botella y limitaciones funcionales.<\/p>\n<p>Estos son los protocolos m\u00e1s comunes utilizados en APIs, cons sus ventajas, limitaciones y cu\u00e1ndo usar cada uno, bas\u00e1ndonos en los fundamentos clave de una arquitectura eficiente.<\/p>\n<h4 id=\"http-y-https-la-base-de-las-apis-web\">HTTP y HTTPS: La base de las APIs web<\/h4>\n<p>HTTP (Hypertext Transfer Protocol) es el protocolo m\u00e1s utilizado en la web. Funciona bajo un modelo de solicitud respuesta: el cliente env\u00eda una solicitud y el servidor responde.<\/p>\n<p>Caracter\u00edsticas clave de HTTP:<\/p>\n<ul>\n<li>M\u00e9todos comunes: GET (leer), POST (crear), PUT\/PATCH (actualizar), DELETE (eliminar).<\/li>\n<li>C\u00f3digos de estado: 200 (\u00e9xito), 400 (error del cliente), 500 (error del servidor).<\/li>\n<li>Encabezados como <code>Content-Type<\/code>, <code>Authorization<\/code>, <code>Cache-Control<\/code>.<\/li>\n<li>Sin embargo, HTTP por s\u00ed solo no es seguro. Aqu\u00ed es donde entra HTTPS.<\/li>\n<\/ul>\n<p>HTTPS = HTTP + TLS\/SSL<\/p>\n<p>HTTPS a\u00f1ade una capa de cifrado que protege los datos en tr\u00e1nsito. Sus beneficios incluyen:<\/p>\n<ul>\n<li>Confidencialidad: los datos no pueden ser le\u00eddos por terceros.<\/li>\n<li>Integridad: los datos no pueden ser alterados.<\/li>\n<li>Autenticaci\u00f3n: el cliente puede verificar la identidad del servidor.<\/li>\n<li>Ventajas SEO: los motores de b\u00fasqueda favorecen sitios con HTTPS.<\/li>\n<\/ul>\n<h4 id=\"websockets-comunicaci\u00f3n-en-tiempo-real\">WebSockets: Comunicaci\u00f3n en tiempo real<\/h4>\n<p>HTTP es excelente para solicitudes puntuales, pero no es ideal para aplicaciones en tiempo real, como chats, notificaciones o paneles de monitoreo.<\/p>\n<p>Imagina un chat: si usas HTTP, el cliente debe hacer solicitudes constantes (&quot;\u00bfhay nuevos mensajes?&quot;) incluso cuando no hay novedades. Esto genera:<\/p>\n<ul>\n<li>Alta latencia.<\/li>\n<li>Uso innecesario de ancho de banda.<\/li>\n<li>Mayor carga en el servidor.<\/li>\n<\/ul>\n<p>WebSockets resuelve este problema estableciendo una conexi\u00f3n persistente y bidireccional entre cliente y servidor.<\/p>\n<p>C\u00f3mo funciona:<\/p>\n<ul>\n<li>El cliente inicia una &ldquo;mano de mano&rdquo; (handshake) con el servidor usando HTTP.<\/li>\n<li>Una vez establecida, la conexi\u00f3n se convierte en un canal bidireccional.<\/li>\n<li>El servidor puede enviar datos al cliente en cualquier momento, sin necesidad de que este lo solicite.<\/li>\n<\/ul>\n<p>Ventajas:<\/p>\n<ul>\n<li>Latencia m\u00ednima.<\/li>\n<li>Ahorro de ancho de banda.<\/li>\n<li>Ideal para aplicaciones en tiempo real.<\/li>\n<\/ul>\n<h4 id=\"amqp-mensajer\u00eda-confiable-entre-servicios\">AMQP: Mensajer\u00eda confiable entre servicios<\/h4>\n<p>AMQP (Advanced Message Queuing Protocol) es un protocolo orientado a mensajer\u00eda, com\u00fan en entornos empresariales.<\/p>\n<p>Funciona con un modelo de productor-consumidor y un broker de mensajes (como RabbitMQ):<\/p>\n<ul>\n<li>El productor (por ejemplo, un sistema de pedidos) env\u00eda un mensaje a una cola.<\/li>\n<li>El consumidor (por ejemplo, un sistema de notificaciones) lo procesa cuando est\u00e9 disponible.<\/li>\n<\/ul>\n<p>Beneficios de AMQP:<\/p>\n<ul>\n<li>Desacoplamiento: los servicios no necesitan estar activos al mismo tiempo.<\/li>\n<li>Garant\u00eda de entrega: los mensajes no se pierden si el consumidor est\u00e1 ca\u00eddo.<\/li>\n<li>Escalabilidad: puedes tener m\u00faltiples consumidores procesando mensajes en paralelo.<\/li>\n<\/ul>\n<h4 id=\"grpc-alto-performance-para-microservicios\">gRPC: Alto performance para microservicios<\/h4>\n<p>Desarrollado por Google, gRPC es un framework de comunicaci\u00f3n de alto performance que utiliza:<\/p>\n<ul>\n<li>HTTP\/2 como protocolo de transporte.<\/li>\n<li>Protocol Buffers (protobuf) para serializaci\u00f3n eficiente de datos.<\/li>\n<\/ul>\n<p>Ventajas de gRPC:<\/p>\n<ul>\n<li>Muy r\u00e1pido y eficiente en el uso de recursos.<\/li>\n<li>Soporta streaming bidireccional (cliente y servidor pueden enviar flujos de datos).<\/li>\n<li>Ideal para comunicaci\u00f3n entre microservicios en un entorno backend.<\/li>\n<\/ul>\n<h4 id=\"conclusi\u00f3n\">Conclusi\u00f3n<\/h4>\n<p>Los protocolos m\u00e1s comunes HTTP\/HTTPS, WebSockets, AMQP y gRPC cubren alrededor del 90% de los casos de uso en APIs modernas. La clave est\u00e1 en entender sus fortalezas y elegir el que mejor se adapte a tu escenario.<\/p>\n<ul>\n<li>Usa HTTP\/HTTPS como predeterminado para APIs web.<\/li>\n<li>Opta por WebSockets en aplicaciones en tiempo real.<\/li>\n<li>Implementa AMQP para mensajer\u00eda confiable y desacoplada.<\/li>\n<li>Considera gRPC para comunicaciones de alto rendimiento entre servicios.<\/li>\n<\/ul>\n"}]}}