What is the true idea of object-oriented programming? The real idea of object-oriented programming is to forget everything about computers and consider problems in the field of problems, From question? My understanding: 1. Abstract The analysis process: Simply put, it is divided into multiple small problems (components) until it cannot be further subdivided; 2. Analyze, abstract, and extract common content (data member and operation method) for each object (minor problem ), 3. If there are similar objects, construct the base class; then the base class derives various determined objects (minor issues ); 4. The process of solving the problem is the process of operating these objects. My experience: 1. Create an object from now on, and gradually summarize and understand it. Do not wait until you see the last page of the teaching material. Just forget the language itself! Only logic! Reply to: qiuanhong (difficult to practice, easy to use) My understanding: It is associated with real life. The 'question 'to be processed is abstracted into one or more 'event' Find a place to use my wisdom The more you say, the more confused you are. It is the "natural language" that is generally used in teaching materials when learning the data structure ". It is based on actual objects, rather than using computer languages to consider issues. For example, a donkey: Starting from reality, this donkey has various attributes (high, fat, and thin )), there are also a variety of functions (you can ride, sell, and eat ); From the computer expert's perspective, he will think (what data structure can this donkey use) Implementation ?? How much space is required ?? Maybe I will write a ride () function ....) The emergence of object-oriented technology is due to the constant expansion of the scale and complexity of software, resulting in After the crisis of software development, people finally realized that the analysis and understanding capabilities of the human brain are limited. The emergence of Object-oriented thinking is a "back to nature" in the software development field, just like Jin Yong's novels. Similarly, zhongzhang Sanfeng taught Taijiquan, "if you forget everything, you will understand the true meaning of Taiji." Haha, It's a bit mysterious. In fact, object-oriented technology requires software developers to lean from the technical level to the management level, with a macro perspective View the system. To carry out System Analysis in an object-oriented way, I think: 1. Understand the functions of the system. List its external interfaces, that is, what functions it has for users. Take the entire system as an object. 2. Environment. The system is not running in a vacuum environment, and the operating system and other external environments may affect it. Therefore, the environment is also a large object. 3. Internal. In the system, it is generally complicated. The general practice is to specify a granularity and enumerate all objects at that granularity. For example, if a human body is in the particle size of an organ, it has a heart, a liver, and a lung. Objects smaller than this granularity (or called objects), such as blood cells, are ignored as other objects (or internal objects of subsystems ). 4. Subsystem. Step 1 ~ 3, until it cannot be abstracted. 5. Invisible objects. A complete interconnected system requires many intangible objects, such as messages. Generally, such objects are hard to be found. When you find that subsystems cannot cooperate correctly or straighten out the relationship, try to add some auxiliary objects. Everything is to make people understand, there are ideas that can make machines understand I think the level of analysis and abstraction capabilities is the key. First, we need to analyze and abstract accurate object models from the problem domain, and then process them based on these models, of course, there are some ideas and details mentioned by our predecessors in the process, but don't forget that our goal is to solve the problem and not to target the object! I think the ability to analyze and abstract is critical to this issue. First, you must carefully analyze and abstract the relevant object model in the problem domain, and then design the model accordingly. However, object-oriented is just an idea for us to solve the problem. We must not forget the problem itself, but become an object-oriented one! Of course, the process is indispensable to the ideas and details described by some predecessors. It is a programming model generated to solve the problem. You can skip it at all, and it may do better. However, as far as the current form is concerned, we still have a good grasp. In my opinion, object-oriented means converting an object into an object. My years of practice in farming tools: Object-oriented thinking includes two concepts: From big to small, from small to big From hard to easy to hard Agree with your opinion. You can be a beginner! The real idea of object-oriented programming is to forget everything about computers and consider problems in the field of problems, Abstract The problem from big to small into an object (pointers are only the form of object usage ), the Rational Arrangement and combination of the objects you design when designing and writing programs is object-oriented programming. Object-oriented is to face the reality; In reality, everything is an object. If they are classified, a "class" is generated "; They are different. Classes and classes are differentiated by classes; Different objects in the same class are distinguished by members. Therefore, the internal logic of object-oriented is classification. The real facial object idea is not practical either. For example: In a text editor, if it is completely designed according to the object-oriented idea, each character will be an object. This overhead is too large to form a program. (This is why there is a discussion about this in the design pattern. Note: not one pattern can solve this problem) The most suitable thing is a combination, just like all kinds of things in life. In fact, the program is actually serving life! A c ++ programming idea can help you solve all your problems. P.s. The deep dive into MFC is far from the real object-oriented ...... Mr. Hou should be a celebrity in the science field, not a programmer's idol! Also, the face object is not the only one. The current general programming technology is a good supplement to the object-oriented technology: a combination of various factors is our goal! The C ++ programming thought book actually has its limitations. If I have read it and no longer read other things, I will be unable to extricate myself from it, no book can "help you with all the difficulties". I believe you have gone beyond this stage, but you have never thought about it. Your sentence will make some incorrect impressions for beginners. In some ways, your words are correct, but they may be misleading! This is a good question. A low-handed person like me should summarize and summarize what kind of thinking is like an object. Let's see that everyone has their own answers, that's a good feeling! All in all, this is a good question. You can study and review it! Good! Even if you have a higher level, you feel that the code you write is not object-oriented! However, if the level is lower than yours, your code is very object-oriented, so there is no absolute object-oriented, there is only a relative, spiral rise! -- Yujian Cannot fully target objects, and cannot blindly pursue structures in design systems Object-oriented is a way of thinking. It uses computer languages to describe the real world. It uses entities you are interested in as objects and uses certain data structures and types to describe the objects, this type of data is a class in C ++. You can create a class for the entities you are interested in. In this way, all entities you are interested in have a class corresponding to it. We can also solve problems without using object-oriented methods, such as the DOS era. We can better solve problems with object-oriented methods. Windows is amazing. My opinion is: Object-Oriented Programming is like some mathematical concepts, such as space, group, ring, and domain. The original programming idea is like classical mathematics. People only discuss problems in one set, and there is no systematic method (that is, Operation) defined. So the benevolent and wise see wisdom, to a certain extent, this creates a chaotic theoretical situation, which is not conducive to scientific development. So what does modern mathematics mean when it develops towards the Internet? That is to say, in addition to the limited universe (that is, the above set, object-oriented also has this concept), people also add a set of general and recognized operations (methods) to this domain ); the computation defined on the set and the Set constitutes the space and group in mathematics. In the computer field, it is called a class ". This kind of set defines that the Operation stuff is much more convenient to use, which makes it easier for people to work on the computing power of a given set when discussing issues, that is, there is versatility that can get twice the result with half the effort. The idea of object-oriented programming requires an analysis of modern algebra. First, we need to determine the "Universe", that is, all the "objects" involved in the project, and then classify them, combine objects of the same category (to form a set) and define the computing properties and operations that can be performed between them. In this way, a class is constructed, of course, when using this class object in the future, all functions will be completed through the defined operations. This is the frequently required class "The member variables of the class should be operated through a common function ". Well, let's just talk about it. It's professional. Do you understand it? Generic programming is "horizontal" and object-oriented is "vertical". The two must be combined Who can say they do not use the template? (Of course, the use of templates cannot be called Generic programming, but when many templates are used, they will develop towards generic programming) Not to mention STL, The cstring in vc.net is now a template. The operating system is a good example! "How can this be regarded as a true object-oriented programming idea? I think it should not be a programming idea, it should be an object-oriented analysis method! My understanding in the vernacular is: analyze the things involved in solving the problem one by one, and find out the differences and commonalities between them. What about commonalities, it is defined as a parent class and analyzed based on the parent class until everything is described. Learning Darwin's evolution Hehe, or look at junior high school biology books, It is easy to understand the inheritance and polymorphism. Of course, the classes and objects in the actual project are a little more abstract than the Firebird worm. That's all. A simple look and a smile Agree to focus only on the logic. Language or development tools should be seldom considered, Object-oriented is the development object. Simply put, a program module does not need to be explained by the original programmer, Another programmer can perform two development operations, which means the object is encapsulated successfully. As for how to encapsulate it, How to divide the module line is a engineering problem, Not discussed Microsoft uses a variety of platforms to integrate various language programs and use the same controls, This is to apply the object to the program. I agree with the checkitout statement. There are too many languages. Just like building a house, with a good foundation, the above may be beautiful. That is, the program you compile can be put in your hands and put into the basket. It will not be broken when it falls into the ground, and other people can also eat it. OK !!!!!!!!!!!!!!!!! What is an object first? Then programming based on the characteristics of the object Inheritance is a key feature. Features such as encapsulation of polymorphism abstraction modularization are also oriented. The qualitative difference lies in OO's proposed Inheritance. Therefore, objects that are not inherited can only be called object-based. Only inheritance can be called object-oriented. The above are some of the messages I have seen on other websites. They are not continuous and may be messy. But let's look at what others are saying first. Which of the following is our opinion? [Em07] |