Author: Chief Editor: Wang Yan
Publisher:
Publish Date: 2002-02-01
Features: p; This book primarily introduces the theory of object-oriented programming and how to use the C++ language tool to implement it. The book's features are a close integration of theory and practice, enabling readers to understand the theory while mastering its practical implementation. The book is divided into two parts: Theory and Practice. The theory part consists of six chapters, focusing on object-oriented theory. The practice part has eight chapters, primarily introducing how to implement object-oriented theory using C++. This part provides a comprehensive example throughout all chapters to connect the content of the entire book. Additionally, it briefly introduces the object-oriented implementation of Windows applications. This book can serve as a textbook for senior undergraduate students in computer science or graduate students in related fields. It can also be used as a reference book for software designers who have mastered C language to learn object-oriented programming.
Excerpt: bsp; "Object-oriented" is a new concept in software program design. Due to the introduction of this new concept, our program design can be more closely aligned with reality while requiring less effort. This chapter primarily introduces the origin of the "object-oriented" concept and the object-oriented programming methodology.
1.1 Origin of the Object-Oriented Concept
The term "object" is frequently encountered in real life, representing a specific entity in the real world. The continuous advancement of society and the development of computer science are mutually promoting. On one hand, the development of computer science has driven societal progress, and the widespread application of computers has brought vitality to the entire social productivity. On the other hand, societal development has also posed new demands on computer science. Computer science must continuously improve and refine itself to adapt to the needs of ever-evolving social productivity.
With the increasing popularity of computers, people increasingly hope to interact more directly with them without the need for specialized learning or prolonged training. This strong desire has placed a growing burden on software designers and has also raised new demands for the development of the computer field itself. Traditional programming concepts could not meet this requirement, leading people to seek a more natural method for solving problems that reflects human thinking. "Object-oriented" technology was born under such circumstances.
The goal of "object-oriented" technology is to directly simulate the real world in software systems, striving to map real-world entities as closely as possible into the solution space of the software system. It aims to allow users to solve problems with the least effort and to the greatest extent by utilizing the software system.
Real-world entities can be divided into two main parts: matter and consciousness. Matter represents concrete entities, while consciousness describes abstract concepts. For example, "bicycle" and "this white bicycle." "This white bicycle" is matter—it is a concrete, objective existence; "bicycle" is consciousness—an abstract concept that generalizes objective entities. These real-world entities can be directly mapped to the solution space of an object-oriented system. Matter in the real world corresponds to "objects" in the object-oriented system, while consciousness corresponds to abstract concepts—classes in the object-oriented system. A bicycle in an object-oriented system can be expressed using a "bicycle" class. A specific white bicycle in an object-oriented system is a concrete object, an instance of the bicycle class.
1.2 Object-Oriented Programming
Object-oriented programming is a new method for designing and implementing software systems. This new method improves and enhances programmer productivity by increasing software extensibility and reusability, while controlling the complexity and maintenance costs of software. But what exactly is object-oriented programming? Before explaining it, we need to first discuss structured programming.
1. What is Structured Programming (Structure Programming)?
Structured programming emerged in the 1960s and became widely adopted globally by the 1970s and 1980s, becoming a standard method in all software development and design fields and used by every programmer. Its emergence and development laid the foundation for modern software engineering. The design philosophy of structured programming is "top-down, stepwise refinement." Its program structure divides several basic modules based on functionality, forming a tree-like structure. The relationships between modules are kept as simple as possible, with relative functional independence. Each module internally consists of only three basic structures: sequence, selection, and loop. The specific implementation of modularity is achieved using subroutines.
Due to the use of module decomposition and functional abstraction, structured programming effectively breaks down the design task of a complex program system into many manageable subtasks. These subtasks are independently programmable modules. Each subroutine has a clear interface, making it very convenient to use.
Although structured programming has many advantages, it remains a data/process-oriented design method. It separates data and processes into independent entities. Programmers must always consider the format of the data they are processing when coding. Even if the same processing needs to be done for different data formats or different processing needs to be done for the same data format, different programs must be written. Therefore, the reusability of structured programming is poor.
On the other hand, when data and processes are independent, there is always a risk of using incorrect data to call the correct program module or using correct data to call the wrong program module. Thus, maintaining compatibility between data and programs has become a heavy burden for programmers.
The above issues cannot be resolved by structured programming alone. They require the solution provided by the object-oriented programming method we will discuss next.
2. What is Object-Oriented Programming (Object-Oriented Programming—abbreviated as OOP)?
Object-oriented programming incorporates all the advantages of structured programming while considering the mapping relationship between the real world and the object-oriented solution space. Its goal is to simplify problem-solving in the real world as much as possible.
Object-oriented programming treats data and operations on data as an interdependent, indivisible whole. It employs data abstraction and information hiding techniques. It abstracts objects and operations on objects into a new data type called a class and considers the relationships between different objects and the reusability of object classes.
For example, we can abstract various types of bicycles into a "bicycle" class. The data it contains includes frame size, wheel size, color, and raw materials, while the operations it performs include turning, moving, and repairing. Each specific bicycle is an object belonging to the bicycle class.
Object-Oriented Theory and C++ Practice
📌 Related Posts
Literature
Advances in Fine Chemical Technology and Market Analysis
2026-09-26
Literature
Pregnant and Postpartum Women's Comprehensive Guide to Food, Clothing, Housing, and Transportation
2026-09-20
Literature
National Public English Proficiency Test Sample Questions and Exercises Level 3
2026-09-14
Literature
Gu Zhengbiao teaches you how to read. Grade 8
2026-09-20
Literature
Chinese Easy to Read (II) Textbook (with Workbook)
2026-09-26
Literature
Biography of Historian Chen Yinque
2026-09-26
Literature
Examine Yourself: Classic, Contemporary, and Cross-Cultural Readings in Sociology (6th Edition)
2026-09-26
Literature
A Letter from a Stranger · Dim Night
2026-09-26