Do our predecessors need process-oriented targeting? How can we quickly sort and locate the logical relationships between objects during object-oriented programming? What is the object-oriented flexibility? Object-oriented is suitable for heavy-duty development. for example, if normal js writes have little effect, such as carousel still needs to be object-oriented... do you need to first process object-oriented?
How can we quickly sort and locate the logical relationships between objects during object-oriented programming?
What is the object-oriented flexibility?
Object-oriented is suitable for heavy-duty development. does normal js require object-oriented writing, for example, for carousel?
What are the similarities and differences between object-oriented and componentized javascript and modular javascript?
Reply content:
Do our predecessors need process-oriented targeting?
How can we quickly sort and locate the logical relationships between objects during object-oriented programming?
What is the object-oriented flexibility?
Object-oriented is suitable for heavy-duty development. does normal js require object-oriented writing, for example, for carousel?
What are the similarities and differences between object-oriented and componentized javascript and modular javascript?
The problem is too big. let's talk about it as a trigger.
The process orientation is absolute in software development, and the program = orderly execution of the process. In fact, there was no process-oriented concept before, but after the emergence of object-oriented, in order to distinguish this method from the previous method of organizing code using functions, then the code that uses the function organization is process-oriented. (In my opinion)
Object-oriented is a code organization method. you can search for all the benefits by yourself.
As we can see above, process orientation or object orientation refers to the way code is organized, while componentization and modularization refer to the way functions are organized in the project, so they are irrelevant.
If the module is damaged during Microelectronics maintenance, you only need to replace the module. Therefore, it is extended to software development. modularization means that the code is clearly encapsulated and has a fixed scope, rather than affecting the entire project.
The various tools used in daily use are actually component ideas. components are often reused without being limited by the scope of the module.
As for your various questions, the answer remains the same: depending on your needs, it is good to meet your requirements.Note that code readability, elasticity, and maintainability are part of the requirement, which is very important.
Simple comparison:
// The simplest code is a line of alert ('Yeah'); // The simplest function requires four lines of function f () {alert ('Yeah ');} f (); // The simplest object requires 7 rows of function o () {this. f = function () {alert ('Yeah') ;}} var obj = new o (); obj. f ();
There are a lot of design content. object-oriented and process-oriented are two different ideas, but there must be a process in which the object can be extracted. process-oriented is analysis, and object-oriented is construction. Componentization and modularization are the products of object-oriented and process-oriented (in my opinion)
Process-oriented and modular are all necessary for writing programs.
Process-oriented. all programs are processes.
Modularization is also very easy to understand, that is, to ensure the readability of the program, whether it is a control error or a bug is more concise. I believe that anyone who learns C and then learns C ++ will think about a problem, that is, what is the difference between a struct and an object? they can all modularize the code, if you say the struct has no method, I can define a function pointer for the Struct. you said The struct does not have the this pointer. in many cases, this pointer is no different from the syntactic sugar, the constructor is simpler than the Struct.
What I want to talk about is that the most important thing for object orientation is inheritance.
When I go to school, the teacher will give an example. for example, if a person acts as the parent class, then the teacher and student classes can be derived, and the student class can also be derived from the boys' and female classes.
However, this example is very boring and poor. students do not derive such a large number of useless classes when doing their course assignments.
In fact, the vast majority of developers will not be able to derive strange classes out of chaos, which will lead to poor program readability.
The inheritance of classes is usually used.
An actual example
I recently wrote a React statement, which starts with each stateful component. class XXX extends React. Component {}
Here, I only need to inherit React. component, My component has the render method, which can display class content on the webpage; My component also has the componentWillReceiveProps method, it can execute the desired process when component receives new data. I don't have to worry about how he triggers these things, but I know that he will trigger them. this is the ability to inherit a class.
Similarly, if you use VS to develop a WPF window program or something, your form will also inherit a class from the Microsoft Basic Library, so that your form has a basic click response, drag and drop functions, so you don't have to write them yourself.
There are also various frameworks. you inherit the basic classes of the framework to obtain the functions provided by the framework.
When it comes to object orientation in textbooks, software engineering, Man-Month myth, software engineering, object-oriented is what programmers summarize when developing software on a large scale. it is similar to building a house, laying the foundation first, and building more functions on it. Therefore, in the student age, if you only follow the textbooks to do some exercises, you cannot understand the many meanings of object-oriented.
Haha. This question is awesome. Mark first, wait for a moment to answer