当前位置:网站首页>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 .
边栏推荐
- 【TcaplusDB知识库】TcaplusDB-tcapsvrmgr工具介绍(二)
- alibaba jarslink
- 关于枚举类的两种用法
- AUTOCAD——三种修剪方式
- 剑指 Offer 04. 二维数组中的查找
- The GLM function of R language is used to build a binary logistic regression model (the family parameter is binomial), and the AIC function is used to compare the AIC values of the two models (simple
- C # WPF realizes undo redo function
- R语言dplyr包arrange函数排序dataframe数据、通过多个数据列排序dataframe数据、指定第一个字段降序排序,第二字段不指定(默认升序排序)
- Building crud applications in golang
- How histrix works
猜你喜欢

TiDB 6.0:让 TSO 更高效丨TiDB Book Rush

星际争霸的虫王IA退役2年搞AI,自叹不如了

In 2021, the global enhanced oil production surfactant revenue was about USD 202.3 million, and it is expected to reach USD 297.1 million in 2028
![[on Nacos] get started quickly](/img/cc/af4ab640952b880595a89f66688ff5.jpg)
[on Nacos] get started quickly

面试突击60:什么情况会导致 MySQL 索引失效?

57. The core principle of flutter - layout process

Drive to APasS!使用明道云管理F1赛事

56. Core principle of flutter - flutter startup process and rendering pipeline

2022CISCN华中 Web

私藏干货分享:关于企业架构中如何进行平台化
随机推荐
.NET6接入Skywalking链路追踪完整流程
"24 of the 29 students in the class successfully went to graduate school" rushed to the hot search! Where are the remaining five?
Xuri 3sdb, installing the original ROS
AI for Science:科研范式、开源平台和产业形态
R language uses the polR function of mass package to construct the ordered multi classification logistic regression model, and uses the vglm function of VGAM package to test the parallelism hypothesis
面试突击60:什么情况会导致 MySQL 索引失效?
优博讯出席OpenHarmony技术日,全新打造下一代安全支付终端
器审科普:创新医疗器械系列科普——胸骨板产品
alibaba jarslink
esp32s3 IPERF例程测试 esp32s3吞吐量测试
Fork/Join 框架基本使用和原理
MySQL高阶语句(一)
alibaba jarslink
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
Jwas: a Bayesian based GWAS and GS software developed by Julia
如何修改 node_modules 裏的文件
Talk about go language and cloud native technology
Youboxun attended the openharmony technology day to create a new generation of secure payment terminals
Unity shader learning (I) understanding the basic structure of unity shader
Daily leetcode force deduction (21~25)