Enterprise Architect:当光盘中的绝对路径不同时,如何与源代码(源->模型)同步? [英] Enterprise Architect: how to synchronize with source code (source -> model) when its in a different absolute path in the disc?

查看:105
本文介绍了Enterprise Architect:当光盘中的绝对路径不同时,如何与源代码(源->模型)同步?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用逆向工程工具在Enterprise Architect中建立了一个模型,将我的Java类导入到EA模型中。现在,我打算随着开发的进行,使该模型与代码保持最新。

I've made a model in Enterprise Architect using the 'reverse engineering' tool to import my Java classes into the EA model. Now I intend to keep this model up-to-date with the code as the development goes on.

问题是:当我尝试在模型中同步代码时(源->模型)仅当源代码仍与我首次导入时在光盘中的绝对路径相同时,它才起作用。但是,如果我更改了源代码在光盘上的位置,它将复制我的类。

The thing is: when I try to synchronize the code within the model (source -> model) it only works if the source code is still in the same absolute path it was in the disc when I first imported. But if I change the source code's location on the disc, it duplicates my classes.

考虑到每个开发人员都有自己的文件夹结构,这是一个很大的问题。当涉及到不同的操作系统时,情况可能会变得更糟(我就是这种情况)。

That is a huge problem considering that every developer has it's own folder structure. It can get worst when it comes to different operational systems (which is my case).

示例:

导入时源代码的位置:

/Volumes/Data/Projects/xxx_project/src/...

当源代码必须由另一个开发人员同步时的位置:

Location of the source code when it has to be synchronized by another developer:

C:\projects\xxx_project\src\...

有人知道如何使用到源代码的相对路径,或者更改源代码在模型上的位置的绑定吗?

Does anybody know how to use a "relative path" to the source code, or to change the binding of the source code's location on the model?

推荐答案

我使用的版本是8.0.860

The version I use is 8.0.860

解决方案是使用称为语言环境路径的功能在EA中。
您可以在菜单项设置->区域设置路径...中找到它。
它会打开一个对话框,使您可以用ID替换模型中的局部路径,反之亦然。利用此功能,可以用另一条路径替换模型中的当前路径。它还使您可以在具有不同本地路径的不同机器上使用模型。

The solution is to use a feature called "Locale Paths" in EA. You find it in the menue item Settings-->Locale Paths... It opens a dialog box that enables you to replace local paths in the model with an ID and vice versa. With this feature it is possible to replace a present path in the model with another one. It also gives you the possibility to use the model on different machines with different local paths.

要找出模型中给定类绑定到的本地路径,我对模型的二进制文件进行了grep处理。然后,我用按钮ApplyPath和ExpandPath替换了路径名。在我看来,有关路径的模型更改直到关闭EA并重新启动才生效。

To find out to which local path a given class in the model was bound I grepped the binary file of the model. Then I replaced the path name with the buttons ApplyPath and ExpandPath. To me it seemed that the changes in the model concerning the path take effect not until closing EA and restarting it again.

之后,可以通过右键单击该类并在磁盘上的新位置执行查看源代码...来查看该类的源代码。

After that it was possible to see the source code of a class by right clicking the class and executing "View source code..." at the new location on the disk.

这篇关于Enterprise Architect:当光盘中的绝对路径不同时,如何与源代码(源->模型)同步?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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