Writing JavaScript according to SOLID

fredrik picture fredrik · Jan 17, 2011 · Viewed 17.1k times · Source

Have any one used the SOLID programming principle (or any of it's parts) while developing JavaScript?

I've just started up on reading on it but can't seem to find anyone that used it for JS. The only part I find easy to implement/use is the "Single responsibility principle".

What I'm looking for is articles or example where these principles are used. And are there any argument's why one shouldn't use some parts?

For example the "Interface segregation principle" says that "the notion that many client specific interfaces are better than one general purpose interface."

But from my knowledge there's no such thing as interfaces in JS (nice if it would be).

Answer

Ryan Ransford picture Ryan Ransford · Dec 16, 2011

It looks like Derek Greer is attempting to take a stab at this with his article series on SOLID JavaScript at Fresh Brewed Code:

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