当前位置:网站首页>Understand ADT and OOP
Understand ADT and OOP
2022-06-23 13:38:00 【Jingjingzi*】
Catalog
ADT And OOP The relationship between
ADT
1. Concept
A mathematical model and a set of operations defined on it , The definition of an abstract data type depends on only one set of its logical characteristics , It has nothing to do with how it is represented and implemented inside the computer
2. form
An abstract data type defines : A data object 、 The relationship between the data elements in the data object and the operation on the data elements
3. significance
Abstract data types embody problem decomposition in programming 、 The characteristics of abstraction and information hiding . Abstract data types decompose real-life problems into many small-scale and easy to deal with problems , Then build a data model that can be processed by computer , And the implementation details of each functional module as an independent unit , So that the specific implementation process can be hidden
OOP
1. Concept
Object oriented programming methods / Languages should have the concept of classes as the central concept . A language should be able to provide assertions for a class and its characteristics ( Namely specification : precondition , Post conditions and invariants ) And exception handling , Rely on tools to generate documents in these assertions , And optionally monitor them at run time Time .
2. The core concept
① Static type : A well-defined type system should ensure the runtime type safety of the system it accepts by enforcing some type declarations and compatibility rules .
② Generic (Genericity): be used for “ Prepare for change ” and “ by / Reuse design ”: It should be possible to write classes with formal generic parameters that represent any type .
③ Inherit (Inheritance): It should be possible to define a class as inheriting from another , To control the potential complexity .
④ polymorphic (Polymorphism): Under the control of an inheritance based type system , It should be possible to ( The name in the software text that represents the runtime object ) Attach to various possible types of runtime objects .
⑤ Dynamic dispatch / binding (Dynamic dispatch / binding): Calling a feature on an entity should always trigger the feature corresponding to the type of the attached runtime object , This is not necessarily the same in the different execution of the call .
ADT And OOP The relationship between
Four ideas of object-oriented programming : encapsulation 、 Inherit 、 polymorphic 、 abstract
ADT It just reflects the two programming ideas of encapsulation and abstraction . Want to achieve ADT It has nothing to do with the implementation language ( No matter what language you use, you can embody a certain programming idea ). So in your question “ Realize the encapsulation in object-oriented programming ” This statement has its own problems , Can't say “ Realization ” A certain idea , It can only be said “ reflect ”.Besides ,ADT( Abstract data types ) Just a data type , This data type is a mathematical model and a set of operations defined on it . encapsulation 、 Inherit 、 polymorphic 、 Abstraction is the idea used in object-oriented programming ,ADT Not a language at all , It's just a model , The two can not be compared
边栏推荐
- 【深入理解TcaplusDB技术】单据受理之事务执行
- Cifar announces the second stage pan Canadian AI strategy
- 64 channel PCM telephone optical transceiver 64 channel telephone +2-channel 100M Ethernet telephone optical transceiver 64 channel telephone PCM voice optical transceiver
- 能把SAP系统玩成鸡肋的公司,太有才了!
- Hanyuan high tech new generation green energy-saving Ethernet access industrial switch high efficiency energy-saving Gigabit Industrial Ethernet switch
- Gary Marcus wrote: three perspectives from linguists that AI researchers need to know
- Develop a powerful tool for increasing efficiency - vscode plug-in sharing in 2022
- R language uses the polR function of mass package to build an ordered multi classification logistic regression model, and uses the summary function to obtain the summary statistical information of the
- Gradle Build Cache引发的Task缓存编译问题怎么解决
- 实战监听Eureka client的缓存更新
猜你喜欢

Quickly understand the commonly used asymmetric encryption algorithm, and no longer have to worry about the interviewer's thorough inquiry

Hanyuan hi tech 8-way telephone +1-way 100M Ethernet RJ11 telephone optical transceiver 8-way PCM telephone optical transceiver

Overview of national parks in the United States

CRMEB 二开短信功能教程

快速了解常用的非对称加密算法,再也不用担心面试官的刨根问底

Quarkus+saas multi tenant dynamic data source switching is simple and perfect

智能数字看板解决方案

Can cold plate, submerged and spray liquid cooling lead the development of high-performance computing?

The two 985 universities share the same president! School: true

Best practices for auto plug-ins and automatic batch processing in openvinotm 2022.1
随机推荐
R language dplyr package mutate_ The all function multiplies all numeric columns (variables) in the dataframe by a fixed value to generate a new data column, and specifies a user-defined suffix name f
Go write file permission WriteFile (filename, data, 0644)?
Online text filter less than specified length tool
How to solve the task cache compilation problem caused by gradle build cache
利用XtraDiagram.DiagramControl进行流程图形的绘制和控制
In flinksql, the Kafka flow table and MySQL latitude flow table are left joined, and the association is made according to I'd. false
Develop a powerful tool for increasing efficiency - vscode plug-in sharing in 2022
Quartus II 13.1 detailed installation steps
Go寫文件的權限 WriteFile(filename, data, 0644)?
What is the principle of live CDN in the process of building the source code of live streaming apps with goods?
Gradle Build Cache引发的Task缓存编译问题怎么解决
火绒安全与英特尔vPro平台合作 共筑软硬件协同安全新格局
Strengthen the sense of responsibility and bottom line thinking to build a "safety dike" for flood fighting and rescue
Filtre de texte en ligne inférieur à l'outil de longueur spécifiée
ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked.
Digraph D and e
KDD 2022 | epileptic wave prediction based on hierarchical graph diffusion learning
How about stock online account opening and account opening process? Is it safe to open a mobile account?
Quickly understand the commonly used asymmetric encryption algorithm, and no longer have to worry about the interviewer's thorough inquiry
逆向调试入门-了解PE结构文件