您不能在UML中以这种方式合法地建模它。 17.12.6 DestructionOccurrenceSpecification ... 17.12.6.4 约束条件 no_occurrence_specifications_below 在InteractionOperand中给定的Lifeline上不得出现其他OccurrenceSpecifications,除了DestructionOccurrenceSpecification。 这基本上意味着您只能让销毁发生一次。但是,您可以像这样对其进行建模:
alt
片段。但是我使用的工具(EA)仅允许一个销毁。因此,我会拖出销毁并将if not destroy
放入opt
片段中,它基本上是相同的。 - qwerty_so