Go Design Patterns

SOLID Design priciples by Rober C. Martin

  1. Single Responsibility principle
  2. Open-Closed Principle
  3. Liskov Substitution Principle
  4. Interface segregation Principle
  5. Dependency Inversion Principle

Single Responsibility principle

A type should have one responisibility. Seperation of concerns. God object a terrible idea!

Open-Closed Principle

OCP Open for extenstion, Closed for modification. Specification pattern.

Liskov Substitution Priciple

Interface Segregation Principle

You shouldn’t put too much into interface. Smaller interface the better.

Dependency Inversion Principle

High level Module (HLM) should not depend on LLM. Both should depend on interfaces(abstractions).