什么是抽象? [英] What is abstraction?

查看:85
本文介绍了什么是抽象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到了流程中的抽象。
我看到了数据中的抽象。

I see abstraction in processes. I see abstraction in data.

我看到抽象正在丢失不重要的细节。

I see that abstraction is losing the unimportant details.

我看到抽象为一组元素命名,并将它们视为一个单元。 (但是我不知道为什么将其视为抽象。因此,请在这一点上进行说明)

I see that abstraction is giving a group of elements a name and treating them as one unit. (But I don't know why that is considered abstraction. So, please I need clarification on this particular point)

我知道也有抽象级别,尽管这个名字暗示着一些东西,我没有一个实际的例子,我想不出一个具体的东西,我对抽象的定义感到困惑。

I know there are also levels of abstraction, and although the name implies something, I don't have a practical example, and I can't think of a specific one I'm confused about the definition of abstraction.

可以有人写一篇综合文章吗?刮一下。有人可以给出全面的答案吗?

Can somebody write a comprehensive article? Scratch that. Can somebody give a comprehensive answer?

编辑:-
谢谢您的回答。
但是,我正在寻找一个广义的答案。
例如,我正在阅读一篇文章,其中将过程视为抽象。
但是,这里的答案是有关C#和Java中的抽象类的(直到现在。)
再次感谢您。

- Thank you for your answers. However, I was looking for a generalized answer. For example, I'm reading an article in which procedures are considered abstractions. However, here the answers are about abstract classes in C# and Java, (until now.) Thank you again.

推荐答案

抽象是隐藏实现的技术。从根本上讲,这个答案就不多了。抽象的含义主要来自如何使用以及为什么使用。

Abstraction is the technique of hiding implementation. At it's core there's not much more to that answer. The bulk of meaning to abstraction come from how and why it is used.

它用于以下情况


  • 降低复杂性。 (创建一个简单的界面)

  • 允许修改实现而不会影响其用户。

  • 创建一个通用的接口以支持多态(处理所有实现)

  • 强制用户扩展实现而不是修改。

  • 通过更改每个平台的实现来支持跨平台。

  • Reduce complexity. (Create a simple interface)
  • Allow for implementation to be modified without impacting its users.
  • Create a common interface to support polymorphism (treating all implementations of the abstracted layer the same.
  • Force users to extend the implementation rather than modify.
  • Support cross platform by changing the implementation per platform.

这篇关于什么是抽象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆