Search code examples
oopdesign-patternssolid-principles

Difference between OOP basics vs SOLID?


I know of OOP (Object oriented programming) and SOLID.

  • OOP basics
    • Encapsulation
    • Abstraction
    • Inheritance
    • Polymorphism

and

  • SOLID
    • Single Responsibility Principle
    • Open / Closed Principle
    • Liskov Substitution Principle
    • Interface Segregation Principle
    • Dependency Inversion Principle)

However, I'm not sure what the exact differences are, and if SOLID is a subset of OOP. Can anyone help explain the differences?


Solution

  • the answer is simple:

    • languages or concepts which don't support Encapsulation, Abstraction, Inheritance and Poly are not object oriented. If you do something object oriented you can always apply these OO basics, because they are available. One doesn't call such things principles.
    • SOLID in return is optional. When developing an OO design you should strive to be SOLID, by applying the underlying basics. Solid only determines how "good" your design is, not if it is object oriented or not. They are principles.

    PS: I don't understand the downvotes to your question, since it's legitimate, can be answered clearly and is confusing to many OO newcomers. Upvote from me.