使用UML图解释SQL查询吗? [英] Explain SQL query using UML diagram?
本文介绍了使用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:
- 实际上,您可以使用类图 解释数据结构.这使人们能够理解数据之间的关联/连接方式.此外,如果您的受众是面向对象的开发人员,将会非常熟悉.
- 您可以使用 对象图 使用上述类.
- 如果PL/SQL代码非常复杂,则可以使用 活动图 ,以直观地概述处理逻辑.有趣的是,活动图还支持对象流,它允许将活动与您的班级模型.但是,请避免进行详细的重新记录(逐条控制流语句):活动图并非用于可视化编程,并且鉴于可视性的复杂性,它会适得其反.
- 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:
- 有趣的入门参考关于使用SQL连接映射UML关联
- 另一个SO答案有关使用类模型记录数据模型(包括SQL)的信息.有一个指向UML-> SQL的循序渐进的教程的链接.
- SQL-反向工程的简短说明>UML
- 伟大的文章,来自Scott Ambler .它说明甚至(PL/SQL DML)触发 ,它提供了一个随时可用的UML概要文件,该概要文件允许使用UML构造型突出显示某些数据库结构;
- 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屋!
查看全文