Background
Programming is a method using instructions to manipulate data. Object is a kind of data structures that has attributes and behaviors. Attributes can be some data, such as variables, related to the object. Behaviors are methods/functions can be used by the object.
The Real World is made up of objects.
The purpose of OOP is to make programmers focus more on manipulating objects rather than the underlying logic required to manipulate them.
The method also benefits collaborative development where projects are large, complex and actively updated or maintained.
Pros and Cons
The advantages:
Re-usability
Code Maintenance.
Productivity
The disadvantages:
The thought process involved in OOP may not be natural for some people, and it will take the time to get used to it.
It is a confused concept, when getting into some scenarios, it’s very hard to get everyone to agree what it is exactly.
It limits your options about how you think about solutions to a problem.
Type systems are extremely useful in modern software engineering, but wrapping type systems into OOP systems is still not a good idea. The untyped OOP languages require 10x more testing to achieve comparable reliability and are extremely slow.
Most of the GoF design patterns are lack of functional programming.
The size of programmes developed with OOP is larger than the procedural approach.
Since larger in size, that means more instruction to be executed, which results in the slower execution of programmes.
Diamond inheritance problems (also happens in abstract/traits/interfaces)
The Real World is actually not made up of objects.
However, so far the advantages of OOP always dominate upon the limitations of it.
Features
- Abstraction
- Encapsulation
- Polymorphism
- Inheritance
- Association
- Aggregation
- Composition
- Reusability
- Objects and Classes
- Data Hiding
- Open recursion
Principles
SOLID
- Single-responsibility principle
- Open–closed principle
- Liskov substitution principle
- Interface segregation principle
- Dependency inversion principle
GRASP - General Responsibility Assignment Software Patterns
Pipline
The first step in OOP is to collect all of the objects a programmer wants to manipulate and identify how they relate to each other - an exercise often known as data modeling.
Once an object is known, it is labeled with a class of objects that defines the kind of data it contains and any logic sequences that can manipulate it. Each distinct logic sequence is known as a method.
Objects communicate with well-defined interfaces called messages.
References
https://en.wikipedia.org/wiki/Object-oriented_programming
https://en.wikipedia.org/wiki/Programming_paradigm
https://en.wikipedia.org/wiki/SOLID
https://en.wikipedia.org/wiki/GRASP_(object-oriented_design)
https://en.wikipedia.org/wiki/Multiple_inheritance
https://www.tutorialspoint.com/what-is-diamond-problem-in-case-of-multiple-inheritance-in-java
https://en.wikipedia.org/wiki/Data_modeling