Object-oriented programming and process-oriented programming differences summary

Today I decided to sum up the difference between the process-oriented programming and object-oriented programming.

Study at the University of the C language, there is no concept of the object, to get the functional design steps will write directly implement functionality, integration. And now I work using a php language, get the demand, will be classified, dismantling module, package type, and then call the function implemented by the class. In fact, in the early days, I've had the impact C language, it is difficult to change their thinking process-oriented, implementing logical functions, although using a php but write out the logic or C, can reduce the use of the class definition is reduced, or even feel the class definition in trouble, not necessary. Of course, after I slowly contact class, the object of these various properties of a variety of convenient, delicious.

There are a lot of documentation on process-oriented and object-oriented different, are a good summary on the network, summarized as follows
1, when the process-oriented problem solving, analyzes the steps to solve the problem, then use the function of these steps, step by step realization, in turn calls the function. The object-oriented in solving the problem, the problem will be split up into one object, the object was not intended to establish complete a step, but in order to describe the behavior of certain things throughout the problem-solving steps in. This comes from a different way of thinking.

2. Structurally, the process is a process-oriented and modular features, and characteristics of object-oriented classes is encapsulation, inheritance, and polymorphism (polymorphism: the same operation applied to different objects can have different interpretations, produce different execution result in operation, by a pointer to the base class, the derived class to invoke the method implementation).

3, different efficiency, no encapsulation is required for the process object instance of the class then calls, and function calls only defined, so the efficiency will be higher.

In general, the process for the implementation of more efficient and more direct, more flexible and process-oriented and more plentiful.

 

Guess you like

Origin www.cnblogs.com/smallzhen/p/11946181.html