关闭

Automated Drawing of UML Diagrams

529人阅读 评论(0) 收藏 举报
UMLGraph allows the declarative specification and drawing ofUML class and sequence diagrams.The current featuresare part of an ongoing effort aiming to provide support forall types UML diagrams.An IEEE Software article titledOn the declarative specification of modelsexplains the rationale behind this approach.The tehnology behind UMLGraph was used to draw many of the diagramsappearing in the award-winning booksCode Quality: The Open Source Perspective (Addison Wesley, 2006) andCode Reading: The Open Source Perspective (Addison Wesley, 2003).In addition,the UMLGraphDoc doclet included in this distribution automaticallyadds UML diagrams to javadoc documentation.

Many programs build on UMLGraph; follow this linkfor more details.In addition,Martin Fowler, the author ofUML Distilled, writes:

I thought I'd send you a note saying how much I enjoyed discovering UML Graph.I've long fancied a text based way of describing UML diagrams,but never felt sufficiently time-rich to develop anything.

Class Diagrams

One specifies a class diagram using the Java syntax complemented byjavadoctags.Running the UmlGraph doclet on the specification will generateaGraphvizdiagram specification that can be automatically processed tocreate Postscript, GIF, SVG, JPEG, fig, or Framemaker drawings.

The following is an example of a class diagram specification and the resulting UMLdiagram:

class Person {
	String Name;
}

class Employee extends Person {}

class Client extends Person {}
Simple UML class diagram

Sequence Diagrams

One specifies a sequence diagram using pic macros to defineobjects and method invocations.The GNU plotutilspic2plot program can then process the sequence diagram to create aPNG, PNM, (pseudo)GIF, SVG, AI, Postscript, CGM, FIG, PCL, HPGL, Regis, or TEKdrawing.

The following is an example of a sequence diagram specification and theresulting UML diagram:

# Define the objects
object(O,"o:Toolkit");
placeholder_object(P);
step();

# Activation and messages
active(O);
message(O,O,"callbackLoop()");
create_message(O,P,"p:Peer");
message(O,P,"handleExpose()");
active(P);
return_message(P,O,"");
inactive(P);
destroy_message(O,P);
inactive(O);

# Complete the lifeline of O
step();
complete(O);
Simple UML sequence diagram

0
0

猜你在找
【直播】机器学习&数据挖掘7周实训--韦玮
【套餐】系统集成项目管理工程师顺利通关--徐朋
【直播】3小时掌握Docker最佳实战-徐西宁
【套餐】机器学习系列套餐(算法+实战)--唐宇迪
【直播】计算机视觉原理及实战--屈教授
【套餐】微信订阅号+服务号Java版 v2.0--翟东平
【直播】机器学习之矩阵--黄博士
【套餐】微信订阅号+服务号Java版 v2.0--翟东平
【直播】机器学习之凸优化--马博士
【套餐】Javascript 设计模式实战--曾亮
查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:373133次
    • 积分:5438
    • 等级:
    • 排名:第4876名
    • 原创:70篇
    • 转载:210篇
    • 译文:81篇
    • 评论:14条
    文章分类
    网摘
    最新评论