2

SOLID Principles in JavaScript: What Does the "I" Stand For?

 2 years ago
source link: https://hackernoon.com/solid-principles-in-javascript-what-does-the-i-stand-for
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

SOLID Principles in JavaScript: What Does the "I" Stand For?

This is the fourth part of SOLID Principles in JavaScript. In Javascript we have something similar to them, it's classes, but this principle could be applied to JS classes. It means that when we create a base class, we should declare all methods that will be used in subclasses and try to avoid methods, that some subclass will use, but some another subclass shouldn't use. This principle says: clients should not be forced to depend upon interfaces that they do not use. The "interface Segregation Principle" is about creating correct methods in the base class.

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK