Philosophers said: What kind of world view is there, what kind of methodology! The debate home said: stand decide the point of view! The controversy between the world has technical ideas and views, is the same as the scene of the blind. There is only one truth, but it is very profound, no one can see all of her. Everyone who pursues truth can feel her existence, because after all, I can touch her part. So, people will find that they have touched it is real, nature is different from others, and it is inevitable. Truth is like a limit, we can only close her, and it is impossible to have her. The development of software ideas is also a process of constantly close to the truth. When you have a computer program, it is "algorithm", and people have designed various classic algorithms to give full play to a limited hardware resource, "Computer" is the machine used to calculate. However, with the improvement of hardware ability and the complexity of the program, people find complex code difficult to read and maintain. So, the idea of program "structured" begins to develop and mature. "Decompose big problems into small problems to solve" is the habit of human thinking. The lengthy code is divided into a number of sub-processes, each process is convenient, and the entire program is understood based on this. In fact, the "algorithm" and "structured procedures" are both code-centric worldview, or stand on "computer". When people began to put forward the "data structure" thinking, they really started to turn their thoughts to the problem to solve it! It is increasingly recognized that the model of the problem is to describe the model of the problem, and the code is only for data services. Since then, it is gradually formed by data-centric worldview. Of course, "data structure" is developed with the idea of "structured procedures", which has greatly improved the efficiency of the program, and has also improved software productivity. But this kind of thinking is still thinking about "data" and "code". In fact, before the "object-oriented" thought, experienced programmers have felt "data" and "code" should be integrated. They have become accustomed to dividing those complex problems into a number of relatively independent structures, write a bunch of subsections of this structure around each structure, and the first parameter of the process is a pointer of a structure, this pointer is known as people "Handle", English is called Handle. When "object-oriented" is presented, I believe they are a group of people who first understand this idea. It should be said that "object-oriented" is the first time to watch problems in the standpoint of the real world. This idea will think about the basic model of human thinking (such as "classification", "abstraction", "universality and speciality") Apply to software design. This kind of thinking is reflected in the program, is to unify "data" and "code" into an "object", "object" into the main method of implementing software. Software ideology has to be a little faint at this time: It can take into account complex software problems with such simple thinking! However, with the in-depth application of this idea, the new debate begins, but all the debates are already in the new height. I think, in software thinking, the most confused should be "inherited" and "combination" dispute. Because people are used to "object-oriented" approach, use base classes to achieve universal needs, derived subclasses to achieve special things. The hierarchy of the class is like a beautiful Christmas tree. It is really intuitive. Even many programming languages sacrificed the characteristics of multiple inheritance in order to construct this beautiful Christmas tree. But the problem is that once such a inheritance structure is fixed, the system's growth mode is specified: can only grow new branches! Although the system designed by the inheritance mode is good, this extension is unidirectional.
When you want to expand your point on the foundation, you will find the whole big tree! Some programmers try to solve this problem with multiple inheritance, but do not say that many languages do not support multiple inheritance, if you can really expand a base class, then you will face different branch points, what should you cut? ? To this end, a software thought called "interface" is born. "Interface" idea promotes respect for the privacy of the object, never checking an object of the ancestral three generations, as long as you can do things. Everything can be done is defined as a "interface", and an object-to-external ability is consisting of its "interface", as for how it doesn't matter. The programming idea of "Interface" is to stand on the "functional combination" position, not "function inheritance" from the parent class. Therefore, for the "interface" idea, whether it is an increase in basic functions or new features, it is expanded that an interface is no longer facing complicated branch and hierarchy. "Inherit" and "combination" are just two ways to see questions. If you like to see the world with vertical, you will find that the world is "inherited". If you like horizontal, you will find that the world is "combination". In fact, "aspect" ideas is to look at the world. "Aspect" is "object-oriented" continuation, is a theoretical summary of "interface" programming. It breaks down all the problems in the real world into the basic aspects that need to be resolved, that is, the so-called "horizontal concerns". These fundamentals have a relatively independent, while the combination can solve all problems. When you find that individual issues, there is a need to further resolve, you can solve this problem in individual local scope. When it is discovered to solve the problem, you can add another basic interface to all objects, but will not affect other aspects that have been resolved. Will there be a software idea that can unify "inheritance" and "combination"? I want to have it! And the new ideas and theories will definitely be understood by people, people will find that the world is so, this is this! Here to give you a interesting question: the inheritance perspective, the ancestors of all natural numbers are 1; then, 2 and 3 are inherited; but 2 and 3 are different; 4 has 2 characteristics, is from 2 inheritance 5 There is no 2 characteristics and there is no 3 characteristics. It is directly from 1; it is clear that inherits 2 and 3 characteristics ... combined views, any natural number contains 1 ingredient, number 2, 3 5, 7 is the basic aspect of forming natural numbers, and other natural numbers are combined by the number of prime numbers, so it is called a composite. Everyone knows that any natural number can be divided into 1 degree of multiplication. If the natural number B can be divided by another natural number A, it means that B must have a full feature of A (inheritance ideology), and the collection of the quality factor constituting A must be a subset of the mass consumption of B (combined ideology). This is the most basic common sense of the number, from here, the two kinds of thoughts are unified. It is worth noting that both views recognize the importance of 1, and 1 is the Object that exists almost all advanced object-oriented languages, whether you are willing to exist. This is the philosophical basis for Object! I hope that everything in the future is so easy to understand ...
Today is the first day of work in work in 2005. Before starting the new year's programs, only all programmers like me with me. Li Wan. Shenzhen 2005-1-4