抽象:设计模式与基本概念

Abstraction: design pattern versus essential concept

我正在阅读的一本关于 UML 的书是这样定义抽象的:

Abstraction is a design principle. In a classification (type) hierarchy, the supertype is an abstraction of its subtypes. Abstractions let you define a common feature in the supertype and that common feature propagates down the type hierarchy to all subtypes.

我认为 "abstraction" 在 Alloy 中有不同的含义。以下是 Software Abstractions:

一书中的一些摘录

Software is built on abstractions. Pick the right ones and programming will flow naturally from design; modules will have small and simple interfaces; and new functionality will more likely fit in without extensive reorganization ... Users want programs whose abstractions are simple and easy to understand; experts want abstractions that are robust and general enough to be combined in new ways ... An abstraction is not a module, or an interface, class, or method; it is a structure, pure and simple--an idea reduced to its essential form.

因此,在 UML 和 OO 中,抽象是一种特定的设计方法,而在 Alloy 中,抽象是一种想法。那正确吗?请描述一下 UML 和 OO(面向对象)中的抽象与 Alloy 中的抽象之间的区别吗?

术语抽象可以在两种意义上使用:作为 activity 和作为 activity 的结果。你的UML书是在第一种意义上使用它,而Alloy书是在第二种意义上使用它。现在,我会在您引用的那段摘录中使用 "concept" 而不是 "abstraction"。