What are the characteristics of an object-oriented approach?

What are the characteristics of the object-oriented approach?

The main features are as follows:

(1) The software system is constructed from the things that exist objectively in the problem domain, and the object is used as an abstract representation of these things and as the basic unit of the system.

(2) The static characteristics of things (i.e., the characteristics that may be expressed by some data) are expressed in terms of the properties of the object, and the dynamic characteristics of things (i.e., the behavior of things) are expressed in terms of the services of the object.

(3) The properties and services of an object are combined into a single entity, shielding its internal details from the outside world, i.e., encapsulation.

(4) Categorizing things. Objects with the same properties and services are grouped together in a class, the class is an abstract description of these objects, and each object is an example of its class.

(5) By applying the principle of abstraction in varying degrees, it is possible to obtain more general classes and more special classes. Special classes inherit the attributes and services of general classes, and object-oriented methods support the description and implementation of this inheritance relationship, thus simplifying the construction process of the system and its documentation.

(6) Complex objects can use simple objects as their building blocks, called aggregation.

(7) Objects communicate with each other through messages in order to realize dynamic connections between objects.

(8) Static relationships between objects are expressed through associations.

What characterizes the object-oriented approach

The object-oriented approach is characterized by encapsulation. Encapsulation is an information concealment technique that is embodied in class descriptions and is an important characteristic of objects. Encapsulation makes the data and the method of processing the data encapsulated into a whole, in order to realize a strong independence of the module, so that the user can only see the external characteristics of the object and the internal characteristics of the object is hidden from the user. The purpose of encapsulation is to separate the designer of the object and the use of the object, the user does not need to know the details of the implementation of the behavior, only with the designer to provide messages to access the object.

What are the characteristics of object-oriented

This tutorial operating environment: windows7 system, DellG3 computer.

Object-oriented is a method of understanding and abstraction of the real world, is the product of the development of computer programming technology to a certain stage, is a is a software development methodology

Object-oriented mainly has four major characteristics

1, abstract

Ignore the things in a subject that have nothing to do with the current goal, and pay focused attention to the current goal with the aspects that are relevant. (That is, a certain type of thing in the real world, extracted, represented by program code, abstracted generally called classes or interfaces). Abstraction does not intend to understand the whole problem, but to select a part of it and not use some of the details for the time being. Abstraction consists of two aspects, a data abstraction, but rather process abstraction.

Data abstraction – > represents the characteristics of a class of things in the world, that is, the properties of an object. For example, a bird has wings, feathers, etc. (attributes of a class)

Process abstraction – > represents the behavior of a class of things in the world, which is the behavior of an object. For example, a bird can fly and call (methods of a class)

2. Encapsulation

Encapsulation is one of the characteristics of object-oriented, the main characteristic of the concept of objects and classes. Encapsulation is to surround the process and data, access to the data can only be through the defined interface. Such as private variables, with set, get methods to get.

Encapsulation ensures that the module has a better independence, making it easier to maintain and modify the program. Modifications to the application are limited to the interior of the class, thus minimizing the impact of application modifications.

3. Inheritance

A hierarchical model that links classes and allows and encourages class reuse, providing a way to explicitly express commonality. A new class of an object can be derived from an existing class in a process called class inheritance. The new class inherits the characteristics of the original class; the new class is called a derived class (subclass) of the original class, and the original class is called the base class (parent class) of the new class. A derived class can inherit methods and instance variables from its parent, and the class can modify or add new methods to make it more suitable for particular needs. Thus it can be said that inheritance is done to reuse the parent class code and also to prepare for polymorphism.

4. Polymorphism

Polymorphism is the practice of allowing objects of different classes to respond to the same message. Polymorphism includes parameterized polymorphism and inclusion polymorphism. Polymorphic languages have the advantage of flexibility/abstraction/behavior sharing/code sharing, which is a good solution to the problem of application functions with the same name. In a nutshell, method overriding, overloading and dynamic linking constitute polymorphism. one of the reasons why java introduced the concept of polymorphism is to compensate for the lack of functionality brought about by single inheritance of a class.

Dynamic linking – > For a method defined in the parent class, if the method is overridden in the child class, then a reference to the type of the parent class will call the method in the child class, this is dynamic linking.

Object oriented programming has many advantages:

1. Development time is short, efficient, reliable, and the programs developed are stronger. Because of the reusability of object-oriented programming, you can use a large number of mature class libraries in the application, thus shortening the development time.

2. Applications are easier to maintain, update and upgrade. Inheritance and encapsulation make the impact of application modifications more localized.

(If you need basic knowledge related to computer programming, you can refer to the Programming Learning Channel)

Three short-answer questions (5 points per question, a total of 10 points) 1 What are the characteristics of object-oriented methods in Java?

Object-oriented methods in Java have the following characteristics:

Encapsulation: Object-oriented methods combine data and behavior by encapsulating the attributes and methods of a class, so that the internal state of the object will not be directly accessed and modified by the outside world, thus guaranteeing the security and reliability of the data.

Inheritance: Object-oriented methods allow the creation of subclasses that inherit the attributes and methods of the parent class and can override the methods of the parent class, thus realizing code reusability and extensibility.

Polymorphism: Object-oriented methods achieve polymorphism through method overloading and overriding, realizing that the same method handles different parameter types and numbers, thus increasing the flexibility and readability of the code.

Abstraction: Object-oriented methods abstract attributes and methods that have commonality through the definition of interfaces and abstract classes, thus realizing abstraction and reducing code coupling.

Reusability: Object-oriented methods can encapsulate the properties and methods of an object into separate modules that can be reused in multiple programs or applications, improving code reusability.

Extensibility: Object-oriented methods can add new functions and features without changing the existing code through the definition of inheritance and interfaces, improving the extensibility of the code.

Maintainability: The object-oriented approach divides the code into separate modules and reduces the coupling of the code through encapsulation, inheritance, polymorphism, and other features, which improves the readability and maintainability of the code.

What are the characteristics of object-oriented development methods?

The characteristics of object-oriented development methodology are mainly the following three points:

1, reusability

Reusability is a core idea of object-oriented software development, in fact, the four major features of the object-oriented program set up in front of the introduction, without exception, are more or less in the reusability of the core around and for the service.

We know that applications are composed of modules. Reusability means that the modules developed in a software project can be used not only in this project, but can be reused in other projects, and thus in many different systems.

Reusable modules must be structurally complete, logically rigorous, and functionally clear independent software structure; second, reusable modules must have good portability, can be used in a variety of different hardware and software environments and different program frameworks; and finally, the reusable modules should have the ability to interact with the outside world, communication.

2, scalability

Scalability is another important requirement for modern application software, that is, the application software can be easily and conveniently expanded and modified,

This expansion and modification of the scope of not only involves the content of the software, but also involves the shape of the software into the working mechanism. Modern application software modification and update frequency is getting faster and faster, the reason for this, that is, the user’s business development, caused by the change of

the corresponding software content of the modification and expansion, but also due to the development of computer technology itself caused by the upgrading of the software, such as the call is now very urgent to the original client / server mode of the application transplanted to the Internet

Work is one of such a software upgrades.

Applications developed using object-oriented technology have better scalability.

The scalability of object-oriented technology is demonstrated first and foremost by the fact that it is particularly well suited for use in the rapid prototyping approach to software development. Rapid prototyping is a development step proposed by researchers studying the software lifecycle that is somewhat more flexible and practical than

traditional waterfall development methods. The rapid prototyping process works like this (see Figure 4.9). First, after understanding the user’s requirements, the developer uses

development tools to create a prototype of the system, which, although rough, should be complete and workable. Developers with this prototype to seek the views of users, and then according to the user’s improved views in

the first prototype on the basis of modification and further development, the formation of a second prototype, and then take the second prototype to seek the views of the user …… so the cycle repeats itself, and constantly in the basis of the existing work of modification, refinement,

Until the initial crude prototype refined into the final functionality of the complete, rigorous structure of the application system.

3, manageability

The previous process-oriented development approach is to process or function as the basic unit to build the entire system, when the size of the development project becomes larger, the need for the process and function of the number of doubled, not conducive to the management and control. The object-oriented development approach uses the connotation than the process and function rich, complex class as a building system components, so that the organization of the entire project is more reasonable and convenient.

For example, a system, such as the use of process-oriented development methodology to achieve, may require 3,000 processes or functions, to manage the 3,000 processes or functions, they are in a variety of possible states of the system’s behavior,

the intricate relationship between them is obviously a very troublesome work, but also prone to errors and omissions. If this system is implemented using an object-oriented development approach, it may be possible to complete the same function with only 100 classes, each class

containing an average of 30 methods. 100 versus 3000, greatly reducing the management and control of the workload, from the development of various aspects of efficiency and quality assurance, there is a great deal of superiority.

In addition, the object-oriented development approach to the class, the data and base on the operations encapsulated together, so that only a limited number of methods of this class can manipulate, change this data. Thus, in the example above, when there is a

data error, you only need to check the 30 methods in the same class that are related to the data, whereas in a process-oriented development approach to deal with the same problem, you may need to check all 3,000 procedures or functions

all over again, and the difference between the two in terms of workload, efficiency, and ease of use is self-evident.

The difference in workload, efficiency, and ease of use is self-evident.