Summary
The solution of OO is to first identify the commonalities and separation of things, then abstract the common behavior models of different things, and aggregate some things through actions, some mechanisms are used to simplify the association between things. This is the universality and abstraction in the OO methodology. This article briefly describes the universality and abstraction of OO.
KeywordsOo, abstract, specific, universal
Directory
Overview... 1
Basic Features of OO... 1
OO universality... 2
OO abstraction... 2
Conclusion... 2
Overview
When the software becomes more and more complex and the process-oriented methodology cannot afford this complexity, the object-oriented (OO) methodology emerged. The complexity of software can be manifested in two aspects: one is the diversity of things, and the other is the complexity of the links between things. The solution of OO is to first find out the commonalities and separation of things, then abstract the common behavior models of different things, and aggregate some things through actions, some mechanisms are used to simplify the association between things. This is the universality and abstraction in the OO methodology.
OO Basic Features
Oo is a methodology that regards things as objects in the program world. It uses generalization and aggregate actions to return and abstract the essential characteristics and common behaviors of things. OO has three basic features: encapsulation, inheritance, and polymorphism. Encapsulation is the encapsulation of changes in things. Such changes are the root cause of the complexity of software. inheritance is a mechanism for dealing with the universality and particularity of things, it focuses more on the processing of inherent properties of things; polymorphism is used to process different behavior characteristics of similar things.
OO Universality
Things in the world are universal and special. As mentioned in the philosophy, "the black horse and the white horse are both horses." In this sentence, the "horse" is more universal than the "Black Horse" or "White Horse, the "black horse" or/and "White Horse" are special. Therefore, when we use OO to analyze a system, we need to find out the common and special features. In general, the difference between special things and general things lies in the difference of essential features. For example, "a horse" has "color", and "A black horse" and "a white horse" are "color" Special horses. This is the inheritance in OO. Therefore, inheritance distinguishes between universal and special things through the essential features of things. Such essential features include the inherent attributes of things and the inherent behaviors of things. To some extent, this is also an abstraction. However, this abstraction is based on the essential features of things.
OO Abstraction
In the OO world, abstraction is essential and often manifested as abstraction of things. The abstraction of such behavior is mainly manifested in two aspects: Abstraction of different behaviors of similar things; abstraction of the same behavior of different things. We can easily differentiate the different behavioral characteristics of similar things, because people are always concerned about this. The same behavior of different things is often concealed, and we need to explore it. For example, egg animals generate "eggs" to breed future generations, this is the conclusion that zoicologists have come to after a long period of exploration and research.
Conclusion
Because the behavior of things may be changed due to such and such reasons. Therefore, we need to isolate this change through oo encapsulation. "Change" is an open Word. It can be modified by "adjectives" or "object ". Often, the changes we talk about when solving specific problems are specific. Such specific changes are common because they are all changes.
Therefore, we need to isolate these changes by abstracting different actions of things and through oo encapsulation. For the universality and particularity of changes, we can use the inheritance of OO for processing.