Product Design, Manufacturing & Innovation Resources
家 » 抽象(OOP编程)

抽象(OOP编程)

1970
  • Barbara Liskov
Software engineer coding abstract classes in a modern IDE environment.

(图片仅供参考)

抽象 面向对象编程 抽象的概念在于隐藏复杂的实现细节,只展现对象的核心特性。它关注对象“做什么”,而不是“如何做”。这可以通过抽象类和接口来实现,它们为其他类定义了蓝图,而无需提供完整的实现,从而简化了复杂的系统。

Abstraction is a process of managing complexity. In programming, it involves creating a simplified representation of a system or component. In 面向对象编程, this is primarily done using abstract classes and interfaces. An abstract class is a class that cannot be instantiated on its own and is meant to be subclassed. It can contain abstract methods (methods without a body) that subclasses must implement. An interface is a similar concept but is purely abstract; it can only define method signatures, not implementations. A class can then ‘implement’ an interface, promising to provide the functionality defined in it.

这使得程序员能够定义一个通用的契约或 API,供多个不同的类遵循。例如,接口“Storable”可以定义“save()”和“load()”方法。像“Document”、“Image”和“UserSettings”这样的不同类都可以实现“Storable”接口,各自提供自己的保存和加载逻辑。与“Storable”对象交互的代码不需要知道它正在处理的对象的具体类型;它只需要知道它可以调用“save()”方法。以及“load()”。这使得客户端代码与具体实现解耦,从而使系统更加模块化、灵活,并且更容易从宏观层面理解。

UNESCO Nomenclature: 1203
– Computer science

类型

抽象系统

中断

Foundational

用法

广泛使用

前体

  • 数学抽象
  • 子程序和函数的概念作为一种程序抽象的形式
  • 抽象数据类型(ADT)理论
  • 需要管理大型工程项目的复杂性

应用程序

  • 隐藏特定 SQL 查询的数据库访问层 (DAL)
  • 设备驱动程序从操作系统中抽象出硬件复杂性
  • 图形 user interface 提供高级控件的(GUI)库
  • HTTP 等网络协议抽象了底层底层技术。 TCP/IP 沟通
  • C++ 中的标准模板库 (stl)

专利:

NA

潜在创新理念

  • 云计算 API(例如 AWS S3)抽象底层存储硬件
  • 跨平台开发框架,例如 React Native 或 Flutter
  • 对象关系映射 (orm) 库,例如 Hibernate 或实体框架
  • standardized apis for machine learning frameworks (e.g., scikit-learn’s estimator api)
  • Java 虚拟机 (jvm) 抽象了底层操作系统和硬件
  • 软件定义网络(SDN)抽象网络控制平面
  • 区块链 smart contract interfaces (e.g., erc-20 for tokens)
  • 嵌入式系统的通用硬件抽象层(hals)
  • 与大型语言模型(llms)交互的api
  • 抽象量子硬件细节的量子计算编程框架
相关概念:抽象、接口、抽象类、API、信息隐藏、复杂性、面向对象编程、契约、解耦、模块化。

历史背景

抽象(OOP编程)

1967
1967
1970
1970
1970
1970-01-01
1975-06-01
1960
1967
1970
1970
1970
1970
1973
1980

(如果日期未知或不相关,例如“流体力学”,则提供其显著出现的近似估计)

第十年 周年纪念日

只有注册会员才能免费获取完整尺寸的图片和下载内容。

> 登录 <