当前位置:网站首页>理解ADT与OOP
理解ADT与OOP
2022-06-23 12:56:00 【静静子*】
目录
ADT
1.概念
指一个数学模型及定义在该模型上的一组操作,抽象数据类型的定义仅取决于它的一组逻辑特性,而与其在计算机内部如何表示和实现无关
2.组成
一个抽象数据类型定义了:一个数据对象、数据对象中各数据元素之间的关系及对数据元素的操作
3.意义
抽象数据类型体现了程序设计中问题分解、抽象和信息隐藏的特性。抽象数据类型把实际生活中的问题分解为多个规模小且容易处理的问题,然后建立一个计算机能处理的数据模型,并把每个功能模块的实现细节作为一个独立的单元,从而使具体实现过程隐藏起来
OOP
1.概念
面向对象的编程方法/语言应该具有类的概念作为中心概念。语言应该能够为类和它的特征提供断言(即规范:前置条件,后置条件和不变量)和异常处理,依靠工具生成这些断言中的文档,并且可选地在运行时监视它们 时间。
2.核心概念
①静态类型:一个定义良好的类型系统应该通过强制执行一些类型声明和兼容性规则来保证它接受的系统的运行时类型安全。
②泛型(Genericity):用于“准备改变”和“为/重用设计”:应该可以编写具有表示任意类型的正式泛型参数的类。
③继承(Inheritance):应该可以将一个类定义为从另一个继承,以控制潜在的复杂性。
④多态(Polymorphism):在基于继承的类型系统的控制下,应该可以将实体(表示运行时对象的软件文本中的名称)附加到各种可能类型的运行时对象。
⑤动态分派/绑定(Dynamic dispatch / binding):在一个实体上调用一个特性应该总是触发与所附加的运行时对象的类型相对应的特性,这在调用的不同执行过程中不一定是相同的。
ADT与OOP的关系
面向对象程序设计的四大思想:封装、继承、多态、抽象
ADT刚好也体现了封装和抽象两个编程思想。想要实现ADT和具体实现语言无关(不管你用什么语言都可以体现某种编程思想)。因此你问题中“实现了面向对象编程中的封装”这种说法本身就有问题,不能说“实现”某种思想,只能说“体现”。此外,ADT(抽象数据类型)只是一种数据类型,这种数据类型是一种数学模型和定义在该模型上的一组操作。封装、继承、多态、抽象是面向对象编程所使用的思想,ADT根本不是一门语言,只是一种模型,二者不能相提并论
边栏推荐
- OS的常见用法(图片示例)
- . Net how to use log framework NLog
- R language dplyr package arrange function sorts dataframe data and sorts dataframe data through multiple data columns (ascending sort by default)
- AssetBundle resource management
- 4-way telephone +1-way Gigabit Ethernet 4-way PCM telephone optical transceiver
- [website architecture] the unique skill of 10-year database design, practical design steps and specifications
- What is the principle of live CDN in the process of building the source code of live streaming apps with goods?
- MySQL single database and table splitting using MYCAT
- Packaging and unpacking process of ESP message under IPSec transmission mode
- LM05丨曾经的VIX(二代产品)
猜你喜欢

What is the principle of live CDN in the process of building the source code of live streaming apps with goods?

Configure SSH Remote Login for H3C switch

AGCO AI frontier promotion (6.23)

Stick to five things to get you out of your confusion!

Analyse et résolution des défaillances de connexion causées par MySQL utilisant replicationconnection

Loss, duplication and backlog of message queues

windows 安装 MySQL

4-way telephone +1-way Gigabit Ethernet 4-way PCM telephone optical transceiver

MySQL single database and table splitting using MYCAT

Technology sharing | wvp+zlmediakit realizes streaming playback of camera gb28181
随机推荐
服务稳定性治理
在线文本过滤小于指定长度工具
What is the reason why maxcompute is sometimes particularly slow to execute SQL queries
[deeply understand tcapulusdb technology] transaction execution of document acceptance
Online text filter less than specified length tool
AAIG看全球6月刊(上)发布|AI人格真的觉醒了吗?NLP哪个细分方向最具社会价值?Get新观点新启发~
Windows install MySQL
Hanyuan high tech USB3.0 optical transceiver USB industrial touch screen optical transceiver USB3.0 optical fiber extender USB3.0 optical fiber transmitter
Getting started with reverse debugging - learn about PE structure files
R language uses matchit package for propensity matching analysis (set the matching method as nearest, match the control group and case group with the closest propensity score, 1:1 ratio), and use matc
618的省钱技术攻略 来啦 -体验场景 领取10元猫超卡!
Dataset之GermanCreditData:GermanCreditData数据集的简介、下载、使用方法之详细攻略
Common usage of OS (picture example)
Js: get the maximum zindex (Z-index) value of the page
Analysis and solution of connection failure caused by MySQL using replicationconnection
js: 获取页面最大的zIndex(z-index)值
Is there any discount for opening an account now? Is it safe to open a mobile account?
Hanyuan high tech new generation green energy-saving Ethernet access industrial switch high efficiency energy-saving Gigabit Industrial Ethernet switch
R语言使用nnet包的multinom函数构建无序多分类logistic回归模型、使用回归系数及其标准误计算每个系数对应的Z统计量的值、使用pnorm函数计算Z统计量对应的p值判断变量的显著性
火绒安全与英特尔vPro平台合作 共筑软硬件协同安全新格局