Basic principles of OOP and their use
OOP is the programming style that emerged in80 years of the 20th century. Unlike procedural languages, where data and instructions for their processing exist separately, in object-oriented programming this information is combined into a single entity.
Basic principles of OOP
Object-program programming hastheir postulates. The principles of the PLO are his main ideas. There are three most important of them: inheritance, polymorphism and encapsulation. Below, each will be discussed in more detail. The basics of programming in OOP languages consist in the use of objects and classes. When moving from the procedural style of writing source code to object-oriented, there are often complexities, but most developers find a lot of advantages in OOP.
Encapsulation is the use of a uniondata and instructions for their processing into a single entity-class. While writing programs in one of the OOP languages, a distinction is made between information inside the entity and outside. Thus, it is possible to ensure the security of data and methods of their implementation from external influences, for example, from other classes that are not related to this object. Inside the entity, the data successfully interacts with each other, but is reliably protected from unauthorized access from the outside.
The second principle of OOP is inheritance - this isthe ability of one class to use the methods of the other without repeating their actual implementation. Inheritance allows you to get rid of the redundancy of the source code.
Another principle of OOP is polymorphism. Its use means that to manipulate objects of varying complexity, you can create one interface that will react differently to events and simultaneously correctly implement the tasks.
The principles of OOP are used in suchpopular programming languages like C ++ and Java, on which a significant number of programs and applications are developed. There are also less used OOP languages - Delphi, Object Pascal, Ruby and many others.
Criticism of the PLO
Despite mostly positive statements towards this methodology, the principles of the PLO are often criticized. Like procedural programming, OOP has its drawbacks.
First, the complexity of the transition. To understand the principles of OOP, it will take quite a lot of time, especially for people who work closely only with procedural programming languages.
Secondly, a more complicated documentation is a disadvantage, since it will be necessary not only to describe classes and objects, but also specific cases of their implementation.
Third, the excessive universality of methods canlead to the fact that the source code and developed programs will be overloaded with functions and capabilities that are not required in this particular case. In addition, note the inefficiency in terms of memory allocation. However, regardless of the opinions of others, the number of OOP programmers is constantly growing, and the languages themselves are developing rapidly.