开发者

Which type of UML diagram is best suited to modelling form validation rules?

Would an activity diagram be the best way to express va开发者_运维知识库lidation rules for an HTML form, using a whole bunch of decision nodes? I am not convinced that it is, but I can't find a more appropriate one, nor can I find any examples of validation rules models online.


None - no one in their right mind would create a graphical representation of form validation rules. UML is not the same thing as engineering drawings, in spite of the best efforts of its proponents.

You're doing it wrong if the effort required to create the UML diagrams for a system approaches that of actually developing the code. Better to have running code that you can actually unit test. The unit tests are better documentation than UML will ever be.

Don't try to represent everything in UML.


An UML diagram is good idea. Activity diagram can be created with graphical rules (e.g. pink annotation). It is a good start even before codding.


For any non-trivial rule you´ll need to use a language like OCL to be able to express the rule.


Validation is fired in case of a misuse case so it Can be represented using activity diagrams. Sequence and activity diagrams also help you debug production issues and nail them quickly

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜