企业架构师与代码同步 [英] Enterprise Architect Synchronize with Code

查看:114
本文介绍了企业架构师与代码同步的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习 EA .我用Java代码进行了保留工程设计,并生成了一些类图.然后,我更改了代码并将其复制到EA项目(删除EA使用的原始源代码并将修改后的内容放入其中).然后使用 Code Engineering->带代码的同步包来使用修改后的代码更新EA,在类图之一中显示了添加的新参考,但是在更新后的代码中删除了旧参考仍在类图之一中.

I am learning EA. I did reserve engineering with my java code and generated some class diagrams. Then I changed my code and copy over to EA project (delete the original source code which EA used and put the modified in). Then use Code Engineering -> Synchroize Package with Code to update EA with the modified code, the new reference added was shown up in one of the class diagrams but the old reference which was removed in the updated code was still in one of the class diagrams.

添加的新文件也未显示在EA项目中.我以前尝试过重新导入源,但是后来我的图表丢失了.

And also the new files added were not shown up in the EA project. I tried reimport source before but my diagrams were lost then.

我尝试了与代码同步在不同级别(位置),甚至使用查看源代码功能在本地修改了代码,但仍然相同.

I tried Synchronize with Code in different level (places) and even modified code locally with View Source Code feature but still the same.

我需要为此设置任何选项吗?

Is there any options I need to set up for this?

EA版本为8.0.860.

The EA version is 8.0.860.

推荐答案

相关的EA选项位于源代码工程"分支下的选项"对话框(工具"-选项")中.

The relevant EA options are located in the Options dialog (Tools - Options), under the Source Code Engineering branch.

在属性/操作"下,有一个选项在反向同步时,删除代码中不存在的模型关联",我认为默认情况下处于关闭状态.启用该功能可以解决悬空关联的问题. (属性和方法也有类似的选项.)

Under Attribute/Operations, there is an option "On reverse synch, delete model associations not in code" which I think is off by default. Switching that on should fix the dangling association problem. (There are similar options for attributes and methods.)

相反,在生成代码时,需要设置选项在向前同步时,提示删除不处于模式(sic)的代码功能",以使EA从已从模型中删除的代码中删除内容.

Conversely, when generating code, the option "On forward synch, prompt to delete code features not in mode (sic)" needs to be set in order for EA to remove stuff from the code which has been deleted from the model.

让EA为新添加的Java类创建UML类的通常方法是从顶层重做导入.在同步包"期间未拾取它们.除非有可能添加了自己的图(在源模型中不应该这样做),否则不要以这种方式丢失图.

The normal way to get EA to create UML classes for newly added Java classes is to redo the import from the top level; they're not picked up during a Synchronize Package. No diagrams should be lost this way, unless possibly if you've added diagrams of your own which you shouldn't do in a source model.

这篇关于企业架构师与代码同步的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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