Path to Architect (1)-process-oriented and object-oriented Wang zebin

Source: Internet
Author: User

1. Introduction
Computer science is an application science, and its knowledge system is a typical inverted triangle structure. It does not use much basic knowledge. It only produces many branches with different application fields and directions, therefore, programming is not a very difficult task. A high school student can do it after specific training. However, programming and programming are two different things. Some programmers have become architects several years later, while others are still coding, however, Ctrl-C and Ctrl-V are more skillful. In China, programmers have two final routes: one is to switch to technical management, and the other is to CTO; the other is to continue to deepen; the other is to lead architect, after all, there are few people who become CEOs. If you are still a common programmer and want to continue on the road of technology, I think you should first add some software engineering ideas and learn a little bit about the design model, only with these capabilities can you consider, analyze, and solve problems at the overall and macro level. I have been coding for many years and have made many detours in the middle. Although I have no great achievements in the end, I have some experiences and I am willing to share some of my experiences with you, this may be helpful for your development.

From programmers to architects, the concept that is the most difficult to get around is object-oriented (OO. I remember when I was in college, we held a major course called object-oriented programming. At that time, we just learned a C language, and we used Turbo C in the DOS development environment. We didn't have any experience in project development at any time. It was purely empty. Therefore, after one semester, I have been in a state of ignorance, neither understanding the difference between process-oriented and object-oriented, nor understanding the benefits of object-oriented.

2. process-oriented (OP) and object-oriented (OO)

2.1 fried rice with eggs and rice bowl
Some people describe the difference between op and OO: The program written using the process-oriented method is an egg fried rice, and the program written with the object-oriented method is a rice bowl. The so-called "Rice Bowl" is called "Rice Bowl bowl" in Beijing, "Rice Bowl" in Northeast China ", and" dish bowl "in Guangdong. A bowl of white rice is filled with a dish. If you like a dish, you can add it to it. I think this metaphor is more appropriate.
I am not very clear about the details of fried rice with eggs, because I have never been a cook or cook, but the last step is to mix rice and eggs and stir fry them together. The rice and the vegetable are prepared separately. If you want a braised pork bowl, you will be given a braised pork bowl. If you want a green pepper and potato rice bowl, just pour a copy of green peppers and potatoes.

The benefit of fried rice with eggs is that it tastes even and tastes delicious. If it happens that you don't like eggs, but you only love vegetables, the only way is to drop them all and cook a new fried rice with vegetables. You don't have to worry about it. You just need to drop the top course and change it. The disadvantage of the rice bowl is that the taste is uneven and may not be as sweet as the fried rice.
Is it good for fried eggs or rice? In fact, this type of question is difficult to answer. If you have to compare the upper and lower levels, you must set a scenario. Otherwise, you can only say that you have your own strengths. If everyone is not a fool, they are not so exquisite. From the restaurant perspective, it is obviously better to cook rice with a lid than fried rice with eggs. They can combine any number of combinations without waste.

2.2 Software Engineering
The advantage of "food" and "rice" separation improves the flexibility of Rice Bowl preparation. If you are not satisfied with the food, you can change the food. The term "maintainability" is better, and the coupling between "meal" and "Dish" is relatively low. Fried rice with eggs brings together "eggs" and "rice". It is very difficult to change any of the "eggs" and "rice". The coupling degree is so high that the "maintainability" is poor. One of the goals of software engineering is maintainability. maintainability is mainly manifested in three aspects: comprehensibility, testability, and modifyability. One of the benefits of object-oriented is that it significantly improves the maintainability of the software system.

Does process-oriented (OP) and object-oriented (OO) refer to two encoding methods? No! You get a user requirement. For example, if someone asks you to compile a software program, do you need to analyze the requirements, perform the overall/detailed design, and finally code the software to write it out, deliver to users. This process is in line with the basic ways of human behavior: first, what to do, then how to do, and finally to do things. Some people said, "I did not follow the steps you mentioned. I coded them directly ". In fact, you must have gone through these three stages, but you do not know clearly in your subconscious. For those who get the code they need, they may write the code and have to go back and rethink the process,

Taking oo as an example, corresponding to the software development process, oo derives three concepts: OOA, Ood, and OOP. OOA is called the method of object-oriented analysis, the method of designing with object-oriented is called Ood, and the method of coding with object-oriented is called oop. The essential difference between process-oriented (OP) and object-oriented (OO) lies in the different analysis methods, which leads to different encoding methods.

2.3 process-oriented (OP) and object-oriented (OO)
(To be continued)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.