Episode 14 – Solid Summary

Clean Code

Episode 14

This episode reiterates all five SOLID principles.

  • Requirement and Use Cases
    • Use Case List (action)
    • Entity List (subject)
    • Building the data dictionary to support the requirement
  • The Single Responsibility Principle
    • Looking at which module belong to which actors
  • Diagrams and YAGNI
    • Diagram is usually using by communicate thought process and become obsolete
    • YAGNI – You ain’t gonna need it.
    • Separate each module to only one actor.
  • The Open-Closed Principle
    • Controller should not depend on the details of the data structure
    • Using Builder, Factory, and Interface to decouple the controller from the data structure and use cases.
  • The Liskov Substitution Principle
    • Don’t put a method in an interface that does apply to all the derivatives.
    • Only ok when all the methods of a derivative do nothing, then you have an null object pattern.
  • The Interface Segregation Principle
    • Violation indicated by the growing fan in from the controllers to the use case and the builder.
    • Let the use case Factory makes the controller by passing the type of controller it will use. This is dynamically create the controller.
  • The Dependency Inversion Principle
    • High level policy should not depend on the low level details
    • The algorithms should be generic without the details
  • Conclusion
    • Use these principles but use engineering judgement.
  • References