如何在序列图中表示通过继承进行的方法调用? (Ruby)
How to represent a method call that's through inheritance in a sequence diagram? (Ruby)
class FirstClass < SecondClass; end
class SecondClass
include ThirdModule
end
module ThirdModule
def inherited_method
end
end
如何在 UML 序列图中表示 FirstClass.new.inherited_method
?我想明确地表明该方法是从 ThirdClass 继承的(因为我将绘制一个平行于另一个也使用相同继承方法的序列)。
虽然我的 Ruby 有点生疏,但这里有一个方法。 class 图看起来像
(假设Ruby中的“<”运算符是继承)。 ThirdModule
被构造为 <<module>>
因为它只是一些操作的容器而不是真正的 class。这不是标准,而是您需要在您建模的领域中引入的东西。
对 inherited_method
的调用看起来像
请注意,像 Enterprise Architect 这样的工具无法识别导入的操作,也不会在消息列表中将它们提供给 FirstClass
,因此您需要手动输入。
class FirstClass < SecondClass; end
class SecondClass
include ThirdModule
end
module ThirdModule
def inherited_method
end
end
如何在 UML 序列图中表示 FirstClass.new.inherited_method
?我想明确地表明该方法是从 ThirdClass 继承的(因为我将绘制一个平行于另一个也使用相同继承方法的序列)。
虽然我的 Ruby 有点生疏,但这里有一个方法。 class 图看起来像
(假设Ruby中的“<”运算符是继承)。 ThirdModule
被构造为 <<module>>
因为它只是一些操作的容器而不是真正的 class。这不是标准,而是您需要在您建模的领域中引入的东西。
对 inherited_method
的调用看起来像
请注意,像 Enterprise Architect 这样的工具无法识别导入的操作,也不会在消息列表中将它们提供给 FirstClass
,因此您需要手动输入。