41

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?

EpicPandaForce
  • 79,669
  • 27
  • 256
  • 428
Ashish Sharma
  • 847
  • 1
  • 12
  • 23
  • 2
    All of these terms have very descriptive definitions available from a cursory Google search. Is there something specific you'd like to know? – David Oct 20 '14 at 12:26
  • 6
    Well, if you go ahead and look up these terms and read their definitions, you can see that different words and paragraphs are used to describe them. I'm afraid that telling you all there is to know about object oriented design (or even just these particular principles) is a *bit* too broad for a single Stack Overflow question. – David Oct 20 '14 at 12:29
  • 2
    You state to "know both" but you don't really understand them (otherwise you wouldn't post such a question). I suggest you read more about them and come back with specific questions about points you don't fully understand. – Patrice Gahide Oct 20 '14 at 12:54
  • 1
    This question is better suited for http://programmers.stackexchange.com/ – Jason Evans Oct 20 '14 at 14:34
  • OOPS Basics (Encapsulation, Inheritance, Abstraction, Polymorphism) are the features provided by Object Oriented programming style. As a programmer, we use these features to create best possible object oriented designs (This is where design patterns come into picture). These design patterns help us to achieve SOLID principles. – Kshitij Jain Oct 05 '17 at 07:05

2 Answers2

39

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.

Waog
  • 7,127
  • 5
  • 25
  • 37
5

Object-oriented programming is a programming form which is based on the idea of "objects". Rounded up pieces of code that describe properties (width, time, position...) and behavior (change width, display time, calculate position...) of required entities that work together to solve a specific problem. SOLID is a set of principles that help you design a solution for a specific problem in the object-oriented domain. Think of it as a set of rules that will help you visualize the most correct way to reach a solution for a problem.

Borden
  • 51
  • 2