↓ Ir para o conteúdo principal

← todas as notas

📎 Webclip

Let's talk: SOLID Principles 🇬🇧

The page introduces SOLID as five architecture principles for assembling code well. It says clean code rules are not enough on their own, because code can still become messy if the pieces are not well put together.

Each principle is illustrated with a small example. The article shows SRP as one module serving one actor, OCP as extending behavior without changing existing code, LSP as subclasses fitting where the parent class is expected, ISP as splitting interfaces so clients only depend on what they use, and DIP as depending on abstractions instead of concrete implementations.

Fichamento
#

  • SOLID is presented as a set of five architecture principles meant to help with how code is assembled.
  • The Single Responsibility Principle says a module should have one responsibility tied to one actor.
  • The Open Closed Principle says code should accept extensions without requiring modification of existing parts.
  • The Liskov Substitution Principle says subclass objects should work in place of parent objects without breaking client code.
  • The Interface Segregation Principle says clients should not be forced to depend on methods they do not use.
  • The Dependency Inversion Principle says business logic should depend on abstractions rather than concrete classes.
  • The page links dependency inversion to easier unit testing and to swapping one notification channel for another, such as email or SMS.