使用流程图或图表表示跨程序的例程

发布于 2024-11-09 07:17:32 字数 854 浏览 1 评论 0原文

我有一组繁忙的例程来验证或下载当前的客户端应用程序。它以调用 .WSF 文件的 Windows 桌面快捷方式启动。这需要几个 .VBS 文件、一个用于设置的 .INI 文件以及可能的 .BAT 文件。其中一些脚本文档具有内部函数。最后阶段打开一个 Microsoft Access 数据库,其中需要一个 AutoExec 宏,该宏启动一些 VBA,包括一个在 VBA 中具有自己的加载例程的表单。

这些细节都不是特别重要(所以请不要添加 VBA 标签,或批评我宝贵的复杂性)。关键是我有各种工具和容器,它们可能在功能上嵌套。

我需要更好的技术来解析流程图中的内容。目前,我依赖于以下任何或全部:

  • 独特的颜色
  • 包含例程的大盒子
  • 经典的“控制权转移”符号
  • 也许是解释性的标注

我不应该增加我的流程图词汇量吗?教程解释了正方形、菱形、圆形,仅此而已。当然,FC 可以帮助我处理这些事情

  1. 过多的脚本类型让我可以满足不同的需求,我想指出工具/语言。
  2. 子例程可能会导致整个任务的中止或错误,我想展示更高级别的“封闭”例程对此的处理(或后果)。
  3. 我想将“内部”子例程与不同脚本文件中的子例程区分开。
  4. 并发脚本处理可能变得至关重要,所以我想指出这一点。
  5. .INI 文件允许我为所有例程提供持久值。这是如何绘制的?
  6. 函数可能有一个参数和一个返回值/引用......我什至不知道如何有效地引用它。

请提供指导或向我指出额外有用的资源。如果你推荐一个分析工具集(比如UML,我还没掌握它的窍门),也请告诉我在哪里可以找到好的介绍。

我对软件不感兴趣。请将此视为白板练习。

I have a busy set of routines to validate or download the current client application. It starts with a Windows desktop shortcut that invokes a .WSF file. This calls on several .VBS files, an .INI for settings, and potentially a .BAT file. Some of these script documents have internal functions. The final phase opens a Microsoft Access database, which entails an AutoExec macro, which kicks off some VBA, including a form which has a load routine of its own in VBA.

None of this detail is specifically important (so please don't add a VBA tag, OR criticize my precious complexity). The point is I have a variety of tools and containers and they may be functionally nested.

I need better techniques for parsing that in a flow chart. Currently I rely on any or all of the following:

  • a distinct color
  • a big box that encloses a routine
  • the classic 'transfer of control' symbol
  • perhaps an explanatory call-out

Shouldn't I increase my flow charting vocabulary? Tutorials explain the square, the diamond, the circle, and just about nothing more. Surely FC can help me deal with these sorts of things:

  1. The plethora of script types lets me answer different needs, and I want to indicate tool/language.
  2. A sub-routine could result in an abort of the overall task, or an error, and I want to show the handling of that by (or consequences for) higher-level "enclosing" routines.
  3. I want to distinguish "internal" sub-routines from ones in a different script file.
  4. Concurrent script processing could become critical, so I want to note that.
  5. The .INI file lets me provide all routines with persistent values. How is that charted?
  6. A function may have an argument(s) and a return value/reference ... I don't know how to effectively cite even that.

Please provide guidance or point me to a extra-helpful resource. If you recommend an analysis tool set (like UML, which I haven't gotten the hang of yet), please also tell me where I can find a good introduction.

I am not interested in software. Please consider this a white board exercise.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

人│生佛魔见 2024-11-16 07:17:32

对这个问题的讨论表明流程图没有用处或不准确。

准确性取决于流程图的构建方式。如果它们是手动构建的,它们就像任何其他手动构建的文档一样,几乎会立即过时;这使得手工构建的流程图毫无用处,这就是为什么人们倾向于查看代码。

[此响应的其余部分违反了 OP 的“对软件不感兴趣(生成流程图)”的要求,因为我认为这是以某种有用的形式获得它们的唯一方法。]

如果流程图是通过一个适当的语言准确的分析工具,它们就会准确。请参阅示例 http://www.semanticdesigns.com/Products/DMS/FlowAnalysis.html< /a> 这些示例在语义上是精确的,尽管其中的页面没有提供确切的语义,但这只是一个文档细节。

很难找到这样的工具:-}特别是如果你想要跨越多种语言和多个“执行范例”的流程图(OP希望包括他的INI文件;它们是某种隐含的赋值语句,我很确定他想要对没有有效流程图的 SQL 操作进行建模,因为它们往往是对表的纯计算)。

目前还不清楚这样的流程图是否有用。我提供的页面上的示例应该是半令人信服的;如果您考虑到所有微观细节(例如,每次子例程调用都可能出现 ABORT 控制流弧[因为每次调用都可能抛出异常]),那么这些图就会变得非常大、速度很快。事实上,图表非常消耗空间(方框、菱形、线条、大量空白),这一事实严重加剧了这一问题。一旦它们变大,你就会沿着弧线迷失在太空中。这又是人们避免使用整个系统流程图的一个很好的理由。 (人们喜欢文本语言的另一个原因是它们实际上可以非常密集;您可以使用简洁的语言在页面上获得很多信息,然后您就会看到 APL :)

如果该函数具有复杂的逻辑。

我认为您不太可能获得语言准确的分析器,为您想要的所有语言生成流程图,这样的分析器可以很好地编写流程图(您希望 JavaScript 调用 C# 运行 SQL ...?)

您可能希望的是折衷的解决方案:显示带有指向所引用的其他工件的各种超链接的代码。您仍然需要能够生成此类超链接代码(请参阅 http://www.semanticdesigns.com /Products/Formatters/JavaBrowser.html 是一种可行的方法),但您还需要跨语言边界的超链接。

据我所知,目前还没有工具可以做到这一点。我怀疑您是否有兴趣或意志力自己构建此类工具。

Discussion of the question suggests flowcharts are not useful or accurate.

Accuracy depends on how the flow charts are constructed. If they are constructed manually, they are like any other manually built document and will be out of date almost instantly; that makes hand-constructed flowcharts really useless, which is why people tend to like looking at the code.

[The rest of this response violate's the OPs requirement of "not interested in software (to produce flowcharts)" because I think that's the only way to get them in some kind of useful form.]

If the flowcharts are derived from the code by an an appropriate language-accurate analysis tool, they will be accurate. See examples at http://www.semanticdesigns.com/Products/DMS/FlowAnalysis.html These examples are semantically precise although the pages there don't provide the exact semantics, but that's just a documetation detail.

It is hard to find such tools :-} especially if you want flowcharts that span multiple languages, and multiple "execution paradigms" (OP wants his INI files included; they are some kind of implied assignment statements, and I'm pretty sure he'd want to model SQL actions which don't flowchart usefully because they tend to be pure computation over tables).

It is also unclear that such flowcharts are useful. The examples at the page I provided should be semiconvincing; if you take into account all the microscopic details (e.g., the possiblity of an ABORT control flow arc emanating from every subroutine call [because each call may throw an exception]) these diagrams get horrendously big, fast. The fact that the diagrams are space-consuming (boxes, diamonds, lines, lots of whitespace) aggravates this pretty badly. Once they get big, you literally get lost in space following the arcs. Again, a good reason for people to avoid flowcharts for entire systems. (The other reason people like text languages is they can in fact be pretty dense; you can get a lot on a page with a succinct language, and wait'll you see APL :)

They might be of marginal help in individual functions, if the function has complex logic.

I think it unlikely that you are going to get language accurate analyzers that produce flowcharts for all the languages you want, that such anlayzers can compose their flowcharts nicely (you want JavaScript invoking C# running SQL ...?)

What you might hope for is a compromise solution: display the code with various hyper links to the other artifacts referenced. You still need the ability to produce such hyperlinked code (see http://www.semanticdesigns.com/Products/Formatters/JavaBrowser.html for one way this might work), but you also need hyperlinks across the language boundaries.

I know of no tools that presently do that. And I doubt you have the interest or willpower to build such tools on your own.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文