Five principles for building software that is easy to understand, extend, and maintain. They reduce coupling, increase cohesion, and make code testable.
| SRP | One reason to change | "This class handles X and Y and Z" | | OCP | Add, don't modify | Growing if/else or switch chains for types | | LSP | Subtypes are substitutable | Type-checking or special-casing in calling code | | ISP | Small, focused interfaces | Empty method implementations or throw new Error("Not implemented") |
| DIP | Depend on abstractions | new ConcreteClass() inside business logic |
Aplique principios SOLID para escribir código flexible, mantenible y comprobable. Úselo al diseñar clases, interfaces y límites de módulos. Cubre Sencillo Responsabilidad, Abierto/Cerrado, Sustitución de Liskov, Segregación de Interfaz y Inversión de dependencia con ejemplos prácticos de TypeScript y heurísticas de detección. Fuente: fellipeutaka/leon.