Introduction to the SOLID Principles of Design

SOLID is a mnemonic acronym introduced by Michael Feathers for five of the principles named by Robert C. Martin, and when applied together, these intend to make it more likely that a programmer will create a system that is easy to maintain and extend over time.

  1. (++) Single responsibility principle (SRP)

    • Every class should have a single responsibility, and that responsibility should be entirely encapsulated by the class. All its services should be narrowly aligned with that responsibility. 

  2. Open Close Principle (OCP)

    • Open for extension, closed for modification. Our code should be open to change (or extension) and closed for modification to accommodate that change.

  3. (++) Liskov substitution principle

    • ​​Objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program.

  4. Interface segregation principle

    • Many client-specific interfaces are better than one general-purpose interface.

  5. Dependency inversion principle (DIP)

    • Depend upon abstractions. Do not depend upon concretions. Spring's frameworks popular dependency injection feature is based on this principle.

References: 

  1. https://en.wikipedia.org/wiki/SOLID_(object-oriented_design)
  2. Head First Design Patterns By Eric Freeman, Elisabeth Freeman, Bert Bates, Kathy Sierra

Contact

We learn together, do innovations and then document them.

Offline Contact
We connect physically only in Bengaluru currently, but most of our activities happen online. Please follow us here or in social media for more details.
WhatsApp (Primary): (+91) 7411174113
WhatsApp (Secondary): (+91) 7411174114

Business newsletter

Complete the form below, and we'll send you an e-mail every now and again with all the latest news.

About Cloudericks

Team Cloudericks is a community to learn about and master cloud computing. Current learning focus is on AWS cloud.

We believe that knowledge is useless unless you share it; the more you share, the more you learn. Visit Cloudericks.

Recent comments

Photo Stream