E
E
Eugene2016-10-05 15:38:36
Programming
Eugene, 2016-10-05 15:38:36

How many principles are there really in OOP?

I noticed that different resources list a different number of basic OOP principles. Somewhere they talk about only three principles (polymorphism, encapsulation, inheritance), and somewhere they talk about the fourth - abstraction. Tried to find the answer myself in Google, but the results are in vain. So I would like to know if abstraction is the (fourth) main principle of OOP? If - yes, why?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Saboteur, 2016-10-05
@haintass

OOP itself is an abstraction, and was not originally related to programming.
If you are for life - you just need to learn how to write good objects, and understand what it is.
If you are academically for the exam, then look for the source that your teacher is guided by, otherwise you will not get 100%.
If you just for yourself - the truth is somewhere nearby. OOP, as it was defined in the original source, and how it looks now are very different things, because the principle is one thing, the implementation is another.
All these inheritances, polyformisms are attempts to remove code duplication, which was easier to solve in functional programming (due to a simpler approach).
The main essence of OOP is that an object is primarily data.
And methods that manipulate this data and provide an external interface.

T
trevoga_su, 2016-10-05
@trevoga_su

https://ru.wikipedia.org/wiki/SOLID_(%D0%BE%D0%B1%...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question