问题描述
一种方法对一些传递的数据进行连续的验证检查。
如果验证检查失败,则将立即引发异常并且该方法将中止。
A method performs successively validation checks with some passed data.If a validation check fails, a exception will be immediately thrown and the method aborted.
如何用UML序列图可视化此流程?
How can visualize this flow with UML sequence diagrams? Is it possible / allowed to show exceptions in sequence diagrams?
一种可能的解决方案也许是使用嵌套替代方法。
A possible solution perhaps is to use nested alternatives.
推荐答案
UML不提供特定于模型异常的内容。查看
UML does not provide something specific to model exceptions. Look at http://www.uml-diagrams.org/sequence-diagrams-questions-answers.html
但是,有一些方法可以在序列图中对其进行建模。您可以在
However there are ways to model it in a sequence diagram. You can read more about sequence diagrams at http://www.ibm.com/developerworks/rational/library/3101.html
我更喜欢忽略序列图中的异常。在您的情况下,我会将所有验证都包含在仅能进行验证的一种方法中。因此,此方法的序列图将仅显示验证步骤。
I prefer to ignore exceptions from sequence diagrams. In your case, I would include all validations in one method that only makes that. So the sequence diagram of this method would show the validation steps only.
这篇关于UML平方图-可视化数据验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!