Episodes
Ismar said almost 3 years ago on SOLID - Liskov Substitution Principle :
very great!

tanphan said 11 months ago on SOLID - Liskov Substitution Principle :
when will you finish SOLID series with I and D?

David Kimura PRO said 11 months ago on SOLID - Liskov Substitution Principle :
  tanphan

Interface Segregation Principle - ISP
(source - https://www.honeybadger.io/blog/ruby-solid-design-principles/)

The interface segregation principle is applicable to static languages, and since Ruby is a dynamic language, there is no concept of interfaces. Interfaces define the abstraction rules between classes.

The Principle states,

Clients should not be forced to depend upon interfaces that they don't use. - Robert C. Martin

What this means is that it is better to have many interfaces than a generalized interface that any class can use. If we define a generalized interface, the class has to depend on a definition that it does not use.

Dependency Inversion Principle - DIP

I think that Thoughtbot has the best explanation for this. https://thoughtbot.com/blog/back-to-basics-solid#dependency-inversion-principle

The Dependency Inversion Principle has to do with high-level (think business logic) objects not depending on low-level (think database querying and IO) implementation details. This can be achieved with duck typing and the Dependency Inversion Principle. Often this pattern is used to achieve the Open/Closed Principle...

Login to Comment