当前位置:网站首页>Self taught ADT and OOP
Self taught ADT and OOP
2022-06-27 12:16:00 【You're leaving when the wind blows】
1、ADT
Abstract Data Type, Abstract data types , It refers to the implementation of a data structure as a software component .ADT The interface of is defined by a type and a set of operations on that type , Each operation is defined by its inputs and outputs .
ADT It does not specify how the data type implements , These implementation details are important for ADT Is hidden from users , And through encapsulation (encapsulation) To prevent external access to him .
data structure (Data Structure) yes ADT The implementation of the , In such as c++ In object-oriented languages such as ,ADT And its implementation make up the class (class). Same as ADT Each operation that is linked together is represented by a member function (member function) To achieve . Data structure refers to the data stored in the computer memory , File structure refers to the organization of data in external storage .
For using the same ADT Two applications , There may be an application that uses ADT The case where there are more special methods than the other or where these two procedures are applicable to the ADT The operation of has different time requirements . It is because of the differences in the requirements of the application , To make a given ADT There are many possibilities for implementation .
problem : Intuitively , The problem is nothing more than a task to be completed , That is, a group of inputs has a group of corresponding outputs .
Algorithm : An algorithm is a method or process of solving a problem .
Program : A computer program is considered to be a concrete implementation of an algorithm using a programming language .
2、OOP
OOP:oop It's object-oriented programming , Object oriented programming is a kind of computer programming architecture ,OOP One of the basic principles is that a computer program is composed of a single unit or object that can play the role of a subprogram .
OOP characteristic :
1、 encapsulation : Also known as information hiding , That is to separate the use and implementation of a class , Only some interfaces and methods are kept in contact with the outside world , In other words, only some methods for developers are disclosed . So developers just You need to pay attention to how this class is used , Instead of caring about the specific implementation process , In this way... Can be achieved MVC work in cooperation with a due division of labour , It can also effectively avoid interdependence between programs , Realize loose coupling between code modules .
2、 inheritance : That is, a subclass automatically inherits the properties and methods of its parent class , And you can add new properties and methods or rewrite some properties and methods . Inheritance increases the reusability of code .PHP Only single inheritance is supported , That is to say, a subclass can only have one parent class .
3、 polymorphism : Subclasses inherit properties and methods from the parent class , And rewrite some of the methods . So although there is the same method in many subclasses , But the objects instantiated by these subclasses can get completely different results by calling these same methods , This technique is polymorphism . Polymorphism enhances the flexibility of software .
Use OOP The benefits of :
1、 Easy maintenance
Structure designed with object-oriented idea , High readability , Because of inheritance , Even if demand changes , Then maintenance is only in local modules , So maintenance is very convenient and low cost .
2、 High quality
In design , Reuse existing , The classes that have been tested in previous projects make the system meet business requirements and have high quality .
3、 Efficient
In software development , Abstract things in the real world according to the needs of design , Production class . Use this method to solve problems , Close to everyday life and natural way of thinking , It is bound to improve the efficiency and quality of software development .
4、 Easy to expand
By inheritance 、 encapsulation 、 Polymorphism , Naturally designed to be highly cohesive 、 Low coupling system structure , Make the system more flexible 、 It's easier to expand , And it costs less .
边栏推荐
- TiDB 6.0:让 TSO 更高效丨TiDB Book Rush
- Master formula
- R语言使用glm函数构建泊松对数线性回归模型处理三维列联表数据构建饱和模型、使用step函数基于AIC指标实现逐步回归筛选最佳模型、解读分析模型
- AI for Science:科研范式、开源平台和产业形态
- . Net6 access skywalking link tracking complete process
- Topic38——56. 合并区间
- 1. Mx6ull startup mode
- ACL 2022 | 中科院提出TAMT:TAMT:通过下游任务无关掩码训练搜索可迁移的BERT子网络
- AUTOCAD——三种修剪方式
- Dynamic programming [III] (interval DP) stone merging
猜你喜欢

Minimum editing distance (linear DP writing method)

动态规划【四】(计数类dp)例题:整数划分
![[tcapulusdb knowledge base] Introduction to tcapulusdb tcapsvrmgr tool (II)](/img/ce/b58e436e739a96b3ba6d2d33cf8675.png)
[tcapulusdb knowledge base] Introduction to tcapulusdb tcapsvrmgr tool (II)

Wechat applet realizes five-star evaluation

优博讯出席OpenHarmony技术日,全新打造下一代安全支付终端

Topic37——64. 最小路径和

MapReduce principle analysis (in-depth source code)

如何修改 node_modules 裏的文件

Drive to APasS! Use Mingdao cloud to manage F1 events

Interviewer: with the for loop, why do you need foreach?
随机推荐
How to modify a node_ Files in modules
R language uses GLM function to build Poisson logarithm linear regression model, processes three-dimensional contingency table data to build saturation model, uses step function to realize stepwise re
微服务拆分
聊聊 Go 语言与云原生技术
Wechat applet realizes five-star evaluation
解压 .log.gz 文件
c/s 架构
Take stock of some easy-to-use and niche markdown editors
Four memory areas (stack, heap, global, code area)
hibernate操作oracle数据库 主键自增
Wait, how do I use setmemorylimit?
MapReduce实战小案例(自定义排序、二次排序、分组、分区)
master公式
[high frequency interview questions] difficulty 1.5/5, LCS template questions
Salesforce 容器化 ISV 场景下的软件供应链安全落地实践
2022CISCN华中 Web
Summary of qstype class usage (II)
Detailed explanation of interprocess communication
The DBSCAN function of FPC package in R language performs density clustering analysis on data, and the plot function visualizes the clustering graph
R语言使用epiDisplay包的followup.plot函数可视化多个ID(病例)监测指标的纵向随访图、使用stress.labels参数在可视化图像中为强调线添加标签信息