使用UML图解释SQL查询吗? [英] Explain SQL query using UML diagram?

查看:79
本文介绍了使用UML图解释SQL查询吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须向对我的项目一无所知的人们提出一些复杂的查询和PL/SQL代码.我需要解释表如何连接,条件如何影响结果,联接,循环等.

I have to present some complex queries and PL/SQL codes to people who don't know anything about my project. I need to explain how tables are connected, how conditions are affecting the outcome, joins, loops, etc.

是否可以使用UML图记录这种SQL和PL/SQL逻辑?

Is there a way to document this SQL and PL/SQL logic using UML diagrams?

推荐答案

您的问题非常广泛.不过有一些提示:

Your question is very broad. Nevertheless some hints:

  • Indeed, you can explain the data structure with class diagram. This allows people to understand how the data is related/connected. Moreover, it will be very familiar if your audience is object oriented developer.
  • You can explain some specific scenarios with example data, using object diagrams that use the above mentioned classes.
  • If the PL/SQL code is very complex, you may use activity diagrams to give a visual overview of the processing logic. Interestingly, activity diagrams also support object flows, which allows to relate the activities to your class model. However, avoid to go into a detailed retranscription (control flow statement by statement): activity diagrams are not meant for visual programming, and it would be counter productive in view of the visual complexity.

如果您想了解更多信息:

If you want to know more:

  • an interesting introductory reference about mapping UML associations with SQL joins
  • another SO answer on using class models to document data models, including SQL. There's a link to a nice step by step tutorial for UML->SQL.
  • a short explanation for reverse engineering for SQL-> UML
  • great article from Scott Ambler. It explains that even (PL/SQL DML) triggers can be documented in a class diagram, and it provides a ready to use UML profile that allows to use UML stereotypes to highlight some database constructs;

这篇关于使用UML图解释SQL查询吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆