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 |
Applica principi SOLID per scrivere codice flessibile, manutenibile e testabile. Da utilizzare durante la progettazione di classi, interfacce e limiti dei moduli. Copertine singole Responsabilità, Aperto/Chiuso, Sostituzione di Liskov, Segregazione delle interfacce e Inversione delle dipendenze con esempi pratici di TypeScript ed euristiche di rilevamento. Fonte: fellipeutaka/leon.