Interface Segregation Principle

The I in SOLID is for Interface Segregation Principle (ISP).

This is the fourth principle, and it’s a very easy one to understand, it’s all about decoupling your classes and extensions. The intent is that:

Clients should not be forced to depend upon interfaces that they don’t use.

Continue reading Interface Segregation Principle

Single Responsibility Principle

This is my first post of the SOLID principle series. SOLID stands for:

  • Single Responsibility Principle
  • Open and Close Principle
  • Liskov’s Substitution Principle
  • Interface Segregation Principle
  • Dependency Inversion Principle

So what’s a design principle and what do we use it for ?

Very roughly, they are guidelines that a developer can follow to avoid choosing a bad design. These principles allows us to write better code that avoid rigidity, fragility and immobility. Rigidity is when your code is too tied to other parts of the system. Fragility is when your code changes can break other parts of the system. Immobility occurs when the code is to hard to port to a different project because it lacks versatility and adaptability.

Continue reading Single Responsibility Principle