将 UML 模型保存为 XMI 歧义 [英] Saving UML model as XMI ambiguity

查看:37
本文介绍了将 UML 模型保存为 XMI 歧义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在维基百科上关于 XMI 的文章中发现了这句话:

I found this sentence in article about XMI on wikipedia:

目前不同版本之间存在一些不兼容问题XMI 的建模工具供应商实现,甚至在交换之间抽象模型数据.

At the moment there are several incompatibilities between different modeling tool vendor implementations of XMI, even between interchange of abstract model data.

我想知道,尽管使用了详细记录的标准,但工具怎么可能不兼容.在查看了 UML 和 XMI 的文档以及其他人的问题后,我发现保存为 XMI 的 UML 模型没有 XML 模式或 DTD.

I wondered how it is possible that, despite using a well-documented standard, tools are not compatible. After looking through documentations of UML and XMI and through other people's questions I found out that there is no XML scheama or DTD for UML models saved as XMI.

根据这个问题的最佳答案 -https://stackoverflow.com/a/36885550/9329778 -检查 XMI 格式是否正确的正确方法应该是通过符合标准的 UML 模型对其进行验证/处理.

According to the best answer to this question -https://stackoverflow.com/a/36885550/9329778 -the correct approach to check if XMI is well formed should be to validate/process it through a conforming UML model.

我还在 XMI 2.5.1 文档的7.3.2 模型类表示"部分中找到了这一点:

I also found this in XMI 2.5.1 documentation in section "7.3.2 Model Class Representation":

默认情况下,XMI 允许您使用任一 XML 序列化功能元素或 XML 属性;但是,XMI 允许您指定如何如果您愿意,可以将它们序列化.

By default, XMI allows you to serialize features using either XML elements or XML attributes; however, XMI allows you to specify how to serialize them if you wish.

在我看来,这就是问题的根源.

This looks to me like a source of the problem.

我的问题是:

  1. 是否有官方指南严格描述如何使用 XMI 保存 UML 模型?我不是的意思是 UML 语法肉类模型(可以从 OMG 网站下载).

  1. Is there an official guide that strictly describes how to save UML model using XMI? I don't mean the UML syntax meatamodel (which can be downloaded from OMG website).

如果第一个问题的答案是否"——这是否意味着不同的建模工具即使使用相同版本的 XMI 也可以以不同的方式执行相同 UML 模型的序列化?

If the answer to the first question is "no" - does it mean that different modeling tools can perform serialization of the same UML model differently even if they use the same version of XMI?

推荐答案

  1. 参考是这个 OMG 的当前文档
  2. 虽然有一个标准",但定义它的人来自 OMG 旗下的不同供应商.当然,每个供应商都试图让他的羊保持干燥和温暖(如果可能的话,可能会将其他人的羊留在雨中——好吧).这只会导致一个对任何人开放的标准.虽然 OMG(试图"放弃此类标准)允许添加供应商单独的扩展通过,但每个供应商都利用并使用此附录来为自己谋利.这就是我们在不同论坛中看到的:为什么我不能将我的模型(完全/根本)从供应商 A 的工具导入供应商 B 的工具.这是一个十字架.

注意:关于 1:不可以.你不能拿这个文件从模型中创建 XMI.它不是这样写的.我所做的是创建一个简单的模型,将其导出(从我最喜欢的工具中)并查看已创建的内容.然后我尝试将其导入另一个工具(查找失败的地方).或者甚至在同一个工具中导出和导入以查找之后丢失的内容.

Note: regarding 1: No. You can not take this document and create XMI from a model. It's not written that way. What I did was to create a simple model, export it (from my favorite tool) and see what had been created. Then I tried to import that into another tool (finding to where it fails). Or even export and import in the same tool to find what was missing afterwards.

这篇关于将 UML 模型保存为 XMI 歧义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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