https://note.com/erukiti/n/n67b323d1f7c5

  • Taking notes based on this article.

    • S: Single Responsibility Principle
      • Code that spans multiple actors should be minimized.
      • In other words, it is not good to combine things other than common parts into one class.
      • However, blindly dividing everything also leads to development difficulties.
        • Trade-off.
        • The simple criterion is that if there is a “reason to change,” then it should be divided.
    • O: Open/Closed Principle
      • When making modifications, ensure that the responsibilities of the class, etc. do not change.
      • When adding something, instead of modifying what is already exposed knowledge, create an extension = new knowledge.
    • L: Liskov Substitution Principle
      • If S is a subtype of T, then all instances of T can be replaced with instances of S in the program.
    • I: Interface Segregation Principle
    • D: Dependency Inversion Principle
  • Ultimately, one should rely on abstractions that have been made.