Object-oriented and process-oriented concepts and differences

Article Directory

basic concept:

Object-oriented is a software development idea, which organizes the process of problem-solving into roles among various objects;

For example, a car, consider the car as a project, this project is composed of seats, steering wheels, tires and other objects.

Each object can be similar to Lego blocks, but connected through the interface between the objects.

This also leads to the characteristics of object-oriented: encapsulation, inheritance, polymorphism.

Process-oriented is the software development thought corresponding to object-oriented, mainly focusing on the method of solving problems, and paying more attention to how a problem is solved.

The object-oriented approach to problems is usually to see if there are suitable tools to complete a certain function, while process-oriented usually need to implement a certain function by itself.

the difference

Object-oriented is easy to maintain, expand, and reuse (think of it as a toolbox), and you can design a relatively low coupling system, making the system more flexible and convenient for maintenance. But correspondingly, object instantiation (from the toolbox to the specific scene) takes time, so its performance is often not as good as process-oriented .

Process-oriented performance is better, usually used in the development process of microcontroller, embedded development, Linux/Unix and so on.

Reference: JavaGuide interview assault

Supplement: The poor performance of Java is not entirely due to the need for instantiation of classes, but because Java is a semi-compiled language, and class files must be compiled in the JVM into machine code that can be recognized by the machine.

Guess you like

Origin blog.csdn.net/qq_52212721/article/details/112254810