What are the main object-oriented ideas? What are the benefits of object-oriented technology?

Source: Internet
Author: User

What are the main object-oriented ideas? What are the benefits of object-oriented technology?

Inherited polymorphism Encapsulation
● Encapsulation: the data and data-based operations are encapsulated with abstract data types, and the data is protected within the abstract data type.
● Inheritance: subclass has all data and operations of the parent class.
● Polymorphism: the coexistence of different methods with the same name in a program.
There are two forms of polymorphism-overloading and rewriting.

Benefits and Costs of object-oriented
Object-oriented users need to adopt them because they have their advantages. So some people do not like them because they also have their disadvantages.

The following are my opinions on the extension of object-oriented features:
First, the category is "independent ".
Because of this independent existence, it can be used with other "processes, objects, and objects" without mutual traction. This avoids the situation of "connecting the whole body", which is conducive to maintenance and debugging.
Second, the category has "versatility ".
This versatility is achieved through abstraction. abstraction is to extract and generalize the common features of things. it is precisely because of this "universal" implementation that the possibility of "re-use" is created.
Third, the class has "flexibility ".
Due to the existence of the second feature and the particularity of objective things, it is possible that some member methods in a common class become "not universal". In this case, through inheritance and overload mechanisms, it enables it to cope with certain special circumstances, thus achieving "flexibility ".

To achieve these benefits, you must think about them systematically. thinking may not always be pleasant. therefore, you have to pay an "extra" thought cost (including the number of codes) for these benefits. haha interesting ...)


The benefits of object-oriented technology are at the analytical design level. object-oriented technology provides more advanced abstract capabilities and more methods and tools, such as design patterns. at the maintenance level, the object-oriented technology makes code reuse easier, and the code is scalable, facilitating software maintenance and upgrading and updating.

Object-oriented is a very popular term recently, but what is object-oriented technology? What are the benefits of adopting object-oriented technology? Is it true that we use an object-oriented language to design the class? Let's talk about my own understanding.


1) The software industry has developed rapidly in modern times, but there has been a crisis that has made software developers increasingly unable to ignore, for example, software development costs, especially large software development costs, software maintenance upgrades, etc.
It is very expensive. In response to the crisis, people have proposed object-oriented technologies that can improve code reuse, etc, the introduction of object-oriented technology enables communication between software developers and software developers.
The reason is: first, object-oriented technology usually abstracts objects in the real world. This abstraction allows non-professional personnel to understand what the software is going to do, allows customers to communicate with professional software developers
It makes development easier and saves development costs. Second, object-oriented technology usually uses encapsulation, inheritance, and other technologies that reduce the correlation between different program modules, allows developers to focus on the process
Instead of putting a lot of energy into the coordination of various modules.

2) It doesn't mean that we use object-oriented languages, such as C ++ and Java, and the benefits of object-oriented technology will emerge. In fact, in small program design
. For real large-scale software development, appropriate technical methods need to be used for continuous optimization, such as Waterfall Model Method and quick prototyping method. The waterfall model mainly divides software
In each phase, the customer is fully engaged in communication. The quick model method is to first submit a general model to the customer, and then continuously modify the model, this method is usually only applicable to small projects. Regardless
In this way, we can follow the principle of constantly refining large software projects, refining them to small functions, and then encapsulating them based on the relationship between them.

Object-Oriented Technology (OOT) is a software development and programming technology. The developed programs are object-oriented programs that directly describe objects in the objective world and their interconnectivity.
System. For example, a bank manager, a secretary, a clerk, a customer, a ledger, or a printer is directly used as an object in a program. They communicate with each other to complete services such as deposit and withdrawal, accounting and settlement, and printing reports. Previous Programming
The technology only uses data structures and algorithms to simulate the business to be completed. Although it can obtain the required calculations, it cannot be modified. If you add a business, such as a stock agency, the program will almost re-compile it. Now, you only need to add
Business can be added to customers, books, employees, and printers.

An object is a program block that encapsulates data and operations. The so-called encapsulation is to create a display interface for this program block. Other objects can only send messages to this interface and cannot access internal private data and operations. For example
A person "sit down" (send a message). After receiving the message, a person adjusts his muscles and nerves so that he can sit down (operate) and change his status (the data describing his posture has changed ). The outside world does not have to ask questions to disturb a few gods.
Which of the following muscles have been contracted. Therefore, any changes to internal data and algorithms used to implement operations will not affect other program objects.

Encapsulation makes programs localized, easy to modify, and well maintained. However, many objects have identical functions, so object-oriented technology has an inherited mechanism. For example, we describe the object "person. Person name, year
Age, occupation, address, and other data and operations such as meals, transportation, and work. When we design a new object "Chinese", it will inherit all the data and operations of "people", plus "speaking Chinese", "Writing Chinese characters","
ID card number and other unique data and operations of "Chinese. In this way, when designing a new object, as long as the original object is less derived, if the operation is correct, the new object will be stored in the database, and the next time you can continue to derive. For example
Chinese are derived from "Chinese men" and "Chinese Women. As a result, various objects in the library can form an inverted tree based on the inheritance relationship, and the branches are constantly increasing. To a certain time, all objects in the object class library to be used by a new program
Yes, you can use it directly as long as it is extracted, and almost no programming is required. Therefore, inheritance supports high degree of software reuse.

In addition, because the object operates its own data. Different objects of the same message all respond in their own way, so that a message can have multiple response methods. This is called polymorphism. For example, the message "eat", "China
People and Russians have different responses (using chopsticks and knives and forks). According to the past programming method, we need to compile their respective programs separately. polymorphism will simplify the program addition, deletion, and simplification.

Encapsulation, inheritance, and polymorphism are the main features of object-oriented programs. These features make the program secure, reliable, reusable, and easy to maintain. Apply these ideas to hardware, databases, artificial intelligence, distributed computing, and networks
Networks and operating systems all show their advantages. Therefore, it has become an emerging computer technology. In particular, only when multimedia data is associated with the corresponding operations can the plot, sound, and image be displayed, and data and operations can be encapsulated.
And effectively promote the development of multimedia application technology.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.