UML modeling tool Enterprise Architect (EA) - install and simple to use

Copyright: please leave a message like Give me praise problematic -------------------------------- will be updated from time to time , because learning, so happy, because the share, so convenient! Reprint please indicate the source, ha ha! https://blog.csdn.net/Appleyk/article/details/88994356

First, what is EA?

 

Enterprise Architect is Sparx Systems  company's flagship product. It covers the entire cycle of system development, in addition to the development of the class model, the transaction also includes the process of analysis, use cases demand, dynamic models , components and layout, systems management, non-functional requirements, user interface design , testing and maintenance.

                                                                                                                            - - Excerpt from Baidu Encyclopedia

 

More powerful than the Rose UML modeling tool, after installation, the overall UI style as follows:

 

 

 

 

 

Second, install EA

 

Baidu network disk link: https://pan.baidu.com/s/14zk04mge9ihmKPUoqnTWJg

Extraction code: eg37 

 

 

 

 

 

 

Third, why should learn to use EA?

 

I direct it three rhetorical questions, straightforward:

 

1, you still have not been designed to directly knock code? The first design concept which went?

2, Do not you want to have a tool that you can design something directly converted into code or sql statement, to ease your workload you?

3, you want to always knock code? Programmers not eat the young rice, over time, it's time to carefully consider the role of the development of things change.

 

 

 

 

Fourth, create EA modeling project

 

 

(1) new construction, named test (.eapx)

 

 

 

 

 

 

 

(2) create a view

 

 

 

 

 

for example:

 

 

 

 

右键选择添加:

 

 

 

案列效果:

 

 

 

 

从左至右,依次是:工程的目录结构,主视图窗口,属性面板(设置对象的属性值)

 

 

 

 

五、创建类视图,构建类和接口

 

我们不使用案列带的Diagrams例子,直接新建一个package,在package下添加我们需要的类

 

 

(1)创建一个包,命名为类视图

 

 

 

(2)在构建的包(目录)下面添加一个视图

 

 

 

 

(3)选择Class(类)

 

 

 

 

(4)瞅准工具箱(Toolbox,往视图面板上拖类和接口组件)

 

工具箱的位置:Design-->Toolbox

 

 

 

(5)拖入两个类和一个接口(一个子类,一个抽象超类,一个接口)

 

 

 

 

 

(6)给类或接口添加说明(标注)

 

 

 

 

 

(7)改变字体大小

 

 

 

 

(8)废话不多说,直接构建关系,看效果

 

 

 

 

(9)给QQPlayer类添加属性字段

 

 

 

 

添加一个name字段:

 

 

 


 

添加方法playMovies():

 

 

 


 

调整变量或方法的“出场”顺序:

 

 

 

 

(10)标识类为抽象类

 

 

 

 

抽象类的字体是倾斜的,如下:

 

 

 

 

(11)至此,类和接口的简单使用结束

   难点在于:关系的认知,比如哪根线表示继承,哪根线又表示实现等;如何给类添加字段和方法;如何标识类为抽象类;

 

 

 

 

六、选中模型目录,自动检出Java代码

 

 

(1)改变类视图的目录(包)结构如下(第五步的结果一定要记得保存!!!)

 

 

 

(2)见证奇迹,检出代码

 

 

 

 

勾选选项(配置一下)如下:

 

 

 

勾选 Include all Child Packages

 

 

 

点击Generate按钮,成功了即可看到如下:

 

 

 

 

(3)回到桌面,检查上一步自动生成的代码是否OK

 

 

 

 

 

目录结构很package,很ok,就是不知道代码是否也ok呢?

 

 

(4)检查下代码,看一下QQPlayer类是否继承和实现都体现在代码里了

 

 

 

就连抽象类Mp3也是很ok的

 

 

 

 

 

 

七、趁热打铁,构建数据表视图并检出SQL脚本

 

 

(1)创建Data Modeling

 

 

 

 

点击ok完成后,效果如下:

 

 

 

 

(2)基于PostGreSql,构建一张表和一个ID自增序列

 

 

 

 

 

 

(3)给User表添加列

 

 

 

添加id、name、age、sex等(简单意思下就行):

 

 

 

 

(4)最终视图效果如下

 

 

 

(5)自动检出sql脚本(操作和生成代码有点区别)

 

选中所有元素(对象):

 

 

 

选中后效果如下:

 

 

 

 

(6)Generate后,桌面验证SQL脚本

 

查看内容:

 

 

 

 

(7)PostGreSql数据库验证一下,SQL脚本是否可用

 

 

 

 

刷新一下,查看构建的user表:

 

 

 

使用下刚才创建的user_id序列:

 

 

 

 

 

八、其他UML建模视图不再陈述

 

 

test.eapx工程下载地址:

 

链接:https://pan.baidu.com/s/1ptaaxqgvPhs9XsUEz3J1mg 


提取码:azj0 
 

Guess you like

Origin blog.csdn.net/Appleyk/article/details/88994356