/solid-in-golang

Learn more about SOLID Principle in Golang

Primary LanguageGo

SOLID Principle in Golang

SOLID is an object-oriented design (OOD) principles by Robert C. Martin (Uncle Bob), have 5 principles :

  1. Single Responsibility Principle
  2. Open / Closed Principle
  3. Liskov Substitution Principle
  4. Interface Segregation Principle
  5. Dependency Inversion Principle

Why

To make project easier to maintain and extend as project grows, with avoiding bad code that have some indicators :

  1. Rigidity (Difficult to change, even small pieces)
  • Dont aware of improvement of some feature
  1. Fragility (Easily crashed when code being changed)
  • Dont aware of unexpected condition
  1. Immobility (Hard to refactor, not reusable)
  • Write a whole busines rules in one function
  1. Viscosity (Like swim in syrup)
  • Bad written, pattern, or documentation.

Presentation

Stay in touch

Reference