空 UML class 的正确图形表示是什么?

What is the correct graphical representation of an empty UML class?

大多数 UML 工具表示一个空的 UML class,属性和操作的字段都是空的。但是查看 UML 基础结构和上层结构,有很多空 classes 显示为一个矩形,包括 class 的名称。但是我找不到一个明确的说法,这两种表述中哪一种是绝对正确的。

那么哪个图形表示是正确的 - 两者都是或只是其中之一 - 你的信息来自哪里?

两者都是正确的。显示隔间是可选的。

尽管@JimL 的回答是正确的,但这是 Superstructures 2.5 中解释隔间使用的部分:

The model in Figure B.6 specializes UMLDiagramElement and UMLShape into UMLCompartmentableShape and UMLCompartment, respectively, to make them concrete, add properties, and redefine inherited properties for shapes with segregated contents.

UMLCompartmetableShape is the most general class for UML elements that may have information shown in separated portions inside their shapes, usually arranged linearly and separated by solid lines (compartments). It subsets ownedElement from UMLDiagramElement to specify compartments that are to appear vertically ordered (first in order is shown at the top), where are captured with UMLCompartment. UMLCompartment subsets ownedElement from UMLDiagramElement to specify contents of compartments that are to appear vertically ordered (first in order is shown at the top). UMLCompartments have no modelElements.

Compartment titles shall be interchanged as UMLLabels with no modelElements, and as the first orderedElement of UMLCompartments.

这意味着您可以显示从零到 N 个隔间。