Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between OOP basics vs SOLID? [closed]

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?

like image 932
Ashish Sharma Avatar asked Oct 20 '14 12:10

Ashish Sharma


People also ask

What are the 4 basics of OOP?

The four principles of object-oriented programming are encapsulation, abstraction, inheritance, and polymorphism.

What are the SOLID principles in OOP?

S - Single-responsiblity Principle. O - Open-closed Principle. L - Liskov Substitution Principle. I - Interface Segregation Principle.

What are the 5 SOLID principles?

SOLID is an acronym that stands for five key design principles: single responsibility principle, open-closed principle, Liskov substitution principle, interface segregation principle, and dependency inversion principle. All five are commonly used by software engineers and provide some important benefits for developers.

What are the 3 OOP principles?

Encapsulation, inheritance, and polymorphism are usually given as the three fundamental principles of object-oriented languages (OOLs) and object-oriented methodology. These principles depend somewhat on the type of the language.


1 Answers

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.

like image 71
Waog Avatar answered Oct 03 '22 13:10

Waog