当前位置:高等教育资讯网  >  中国高校课件下载中心  >  大学文库  >  浏览文档

《C++程序设计》(英文版) Chapter 14 Topics

资源类别:文库,文档格式:PPT,文档页数:37,文件大小:3.01MB,团购合买
Chapter 14 Topics Structured Programming vS Object-Oriented Programming Using Inheritance to Create a New C++ class Type Using Composition( Containment) to Create a New C++ class Type Static vs Dynamic Binding of Operations to Objects
点击下载完整版文档(PPT)

Programming in c++ Object-Oriented Software Development Dale/eems/Headington

1 Object-Oriented Software Development

Programming in C++ Chapter 14 Topics o Structured Programming vS Object-Oriented Programming o Using Inheritance to Create a New C++ class Type o Using Composition(Containment) to Create a New C++ class Type x Static vS. Dynamic Binding of Operations to Objects Virtual Member Functions Object-Oriented Design Implementing the Design

2 Chapter 14 Topics ❖Structured Programming vs. Object-Oriented Programming ❖Using Inheritance to Create a New C++ class Type ❖Using Composition (Containment) to Create a New C++ class Type ❖Static vs. Dynamic Binding of Operations to Objects ❖Virtual Member Functions ❖Object-Oriented Design ❖Implementing the Design

Programming in C++ Structured Programming vs Object-Oriented programming Structured(procedural)programming: the construction of programs that are collections of interacting functions or procedures Object-oriented programming(ooP) the use of abstraction, inheritance, and dynamic binding to construct programs that are collections of interacting objects

3 Structured Programming vs. Object-Oriented programming ❖Structured(procedural)programming:the construction of programs that are collections of interacting functions or procedures. ❖Object-oriented programming(OOP):the use of abstraction, inheritance, and dynamic binding to construct programs that are collections of interacting objects

Programming in C++ Two Programming Paradigms Structural ( Procedural) Obiect-Oriented PROGRAM PROGRAM(OOP) FUNCTION OBJECT Operations FUNCTION Data OBJECT OBJECT Operations FUNCTION Operations Data Data

4 Two Programming Paradigms Structural (Procedural) Object-Oriented PROGRAM PROGRAM(OOP) FUNCTION FUNCTION FUNCTION OBJECT Operations Data OBJECT Operations Data OBJECT Operations Data

Programming in C++ Object-Oriented Programming Language Features 1. Data abstraction 2. Inheritance of properties 3. Dynamic binding of operations to objects

5 Object-Oriented Programming Language Features 1. Data abstraction 2. Inheritance of properties 3. Dynamic binding of operations to objects

Programming in C++ Obiects OOP Terms C++ Equivalents Object Class object or class instance Instance variable Private data member Method Public member function Message passing Function call( to a public member function

6 OOP Terms C++ Equivalents Object Class object or class instance Instance variable Private data member Method Public member function Message passing Function call ( to a public member function ) Objects

Programming in C++ What is an object? OBJECT set of methods Operations (public member functions) Data internal state (values of private data members)

7 What is an object? OBJECT Operations Data set of methods (public member functions) internal state (values of private data members)

Programming in C++ Relationship Between Two Classes In C++, we define the properties and behavior of objects by using the class mechanism The three most common relationships between two classes are as follows 1. Two classes are independent of each other and have nothing in common 2. Two classes are related by inheritance 3. Two classes are related by composition

8 Relationship Between Two Classes ❖In C++, we define the properties and behavior of objects by using the class mechanism. ❖The three most common relationships between two classes are as follows: 1. Two classes are independent of each other and have nothing in common. 2. Two classes are related by inheritance. 3. Two classes are related by composition

Programming in C++ Inheritance Hierarchy Among Vehicles vehicle wheeled vehicle boat car bicycle two-door four-door Every car is a wheeled vehicle 9

9 Inheritance Hierarchy Among Vehicles vehicle wheeled vehicle boat car bicycle two-door four-door Every car is a wheeled vehicle

Programming in C++ Inheritance is a mechanism by which one class acquires (inherits) the properties(both data and operations) of another class the class being inherited from is the Base class (Superclass) the class that inherits is the Derived class (Subclass) .g the derived class is then specialized by adding properties specific to it 10

10 Inheritance ❖ is a mechanism by which one class acquires (inherits) the properties (both data and operations) of another class ❖ the class being inherited from is the Base Class (Superclass) ❖ the class that inherits is the Derived Class (Subclass) ❖ the derived class is then specialized by adding properties specific to it

点击下载完整版文档(PPT)VIP每日下载上限内不扣除下载券和下载次数;
按次数下载不扣除下载券;
24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
共37页,可试读13页,点击继续阅读 ↓↓
相关文档

关于我们|帮助中心|下载说明|相关软件|意见反馈|联系我们

Copyright © 2008-现在 cucdc.com 高等教育资讯网 版权所有