UML Squence Diagram - visualize validation of data

走远了吗. 提交于 2020-01-15 12:35:08

问题


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.

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.


回答1:


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.



来源:https://stackoverflow.com/questions/16471039/uml-squence-diagram-visualize-validation-of-data

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!