当前位置:网站首页>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 .
边栏推荐
- Unity shader learning (I) understanding the basic structure of unity shader
- 1. Mx6ull startup mode
- Master formula
- 聊聊 Go 语言与云原生技术
- [high frequency interview questions] difficulty 1.5/5, LCS template questions
- Secyun won the "2022 AI analysis · it operation and maintenance vendor panorama report" as the representative vendor of intelligent operation and maintenance aiops Market
- Topic37——64. 最小路径和
- Usage of rxjs mergemap
- uni-app 使用escook/request-miniprogram插件发请求说明
- Heap heap sort TOPK
猜你喜欢

dried food! What problems will the intelligent management of retail industry encounter? It is enough to understand this article

动态规划【四】(计数类dp)例题:整数划分

How histrix works

Nifi from introduction to practice (nanny level tutorial) - identity authentication

树莓派 3b+ 学习

"24 of the 29 students in the class successfully went to graduate school" rushed to the hot search! Where are the remaining five?

Research Report on the overall scale, major producers, major regions, products and application segments of swine vaccine in the global market in 2022

Rxjs mergeMap 的使用场合

Unity Shader学习(一)认识unity shader基本结构

I.MX6ULL启动方式
随机推荐
56. Core principle of flutter - flutter startup process and rendering pipeline
Interviewer: with the for loop, why do you need foreach?
What is the TCP 3-time handshake process?
Take stock of some easy-to-use and niche markdown editors
In depth analysis of error solutions and problems in dynamic loading of unity shadow and outline components
[on Nacos] get started quickly
Deep understanding of happens before principle
How to participate in openharmony code contribution
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
Wechat applet realizes five-star evaluation
esp32s3 IPERF例程测试 esp32s3吞吐量测试
Interview shock 60: what will cause MySQL index invalidation?
MySQL高阶语句(一)
Wait, how do I use setmemorylimit?
[high frequency interview questions] difficulty 1.5/5, LCS template questions
mysql学习1:安装mysql
深入理解 happens-before 原则
R语言使用epiDisplay包的followup.plot函数可视化多个ID(病例)监测指标的纵向随访图、使用stress.labels参数在可视化图像中为强调线添加标签信息
MapReduce实战小案例(自定义排序、二次排序、分组、分区)
【On nacos】快速上手 Nacos