Skip to content

Latest commit

 

History

History
33 lines (22 loc) · 891 Bytes

principles.md

File metadata and controls

33 lines (22 loc) · 891 Bytes

Rails principles

  • Convention over Configuration (Coc)
  • Don’t Repeat Yourself (DRY)

SOLID principles

  • Single Responsibility Principle (SRP)

    An object should have only a single responsibility.

  • Open/Closed Principle (OCP)

    Classes or methods should be open for extension, but closed for modification.

  • Liskov Substitution Principle

  • Interface Segregation Principle

  • Dependency Inversion Principle (DIP)

    • Has to do with ‘high-level’ objects not depending on ‘low-level’ details.
    • This can be achieved with duck typing.
    • ‘high-level’ : think business logic
    • ‘low-level’ : think database querying and IO

Other principles

  • Fat model, skinny controller
  • KISS - "Keep it simple, stupid"
  • Composition over inheritance

Resources: