How computers run - Become a programmer who can use object-oriented programming (7)

1. Object is translated into Chinese as "object".
2. OOP is the abbreviation of Object Oriented Programming, which can also be referred to as OO.
3. The C++ language adds support for OOP based on the C language.
4. Object-oriented programming is a method of writing programs that aims to improve the efficiency of developing large programs and make programs easy to maintain.
5. The components of an object include the behavior and operations of the object.
6. The main programming techniques of OOP include inheritance, encapsulation, and polymorphism.
7. In OOP, an element called "class" is used to smell the components of the program.
8. The content of the written program will eventually be expressed as a list of values. Each value represents either an "instruction" or the "data" that is the object of the instruction operation.
9. In order to improve programming efficiency, most level classes have been built into object-oriented programming languages.
10. In object-oriented programming, the real world that is about to be converted into a program can be analyzed from the perspective of "What kind of objects is this made of?" This method is called "modeling".
11. In the modeling process, there are two steps of "componentization" and "omission".
Componentization: Divide the real world, which can be viewed as a collection of several types of objects, into components.
Omission: It is not necessary to transfer 100% of the real world to the program, so part of it can be omitted.
12. In order to express the results of real-world modeling in graphical form, the notation method of UML (Unified Modeling Language) is often used.
13. Nine types of diagrams specified in UML
Insert image description here

Name Main purpose Use case diagram (Use Case Diagram) represents the way users use the program. Class diagram (Class Diagram) represents classes and the relationships between multiple classes. Object Diagram (Object Diagram) represents objects. Sequence Diagram (Sequence Diagram) focuses on time. It also expresses the interaction between each object. The Collaboration Diagram pays attention to and expresses the interaction between multiple objects from the cooperative relationship. The Statechart Diagram expresses the changes in the object state. The Activity Diagram expresses the processing flow and other components. Diagram (Component Diagram) represents files and the relationship between multiple files. Configuration Diagram (Deployment Diagram) represents the deployment configuration relationship of computers or programs. 14.
Non-object-oriented languages ​​are called "procedural languages".
15. Inheritance: A new class is generated by inheriting the members of an existing class.
Encapsulation: Among the members owned by a class, hide those members that are not necessary to be exposed to the caller of the class.
Polymorphism: For the same message, different objects can perform different operations.
16. A class is the definition of an object, and an object is an instance of a class. It can be understood that a class is a mold for making cookies, and the cookies made from this mold are objects.
17. Three ways to use classes:
(1) Call only individual members (functions and variables) held by the class
(2) Include other classes in the definition of the class (this method is called composition)
(3) Define new classes by inheriting existing classes.
18. Java and .NET are actually assemblies that are located on top of the operating system and are designed to improve development efficiency by hiding the complexity of the operating system. This is also called a "framework" and consists of two parts. One part is responsible for safely executing programs. The "execution engine" is the "execution engine", and the other part is the "class library" which is a collection of program components.

Supongo que te gusta

Origin blog.csdn.net/weixin_46504000/article/details/131745326
Recomendado
Clasificación