YUML支持3种图示风格,分别是:
- plain
- scruffy
- boring
用例图
- 角色(Actor)
- 使用[角色名]
![](http://yuml.me/diagram/plain/usecase/[Customer])
![](http://yuml.me/diagram/scruffy/usecase/[Customer])
![](http://yuml.me/diagram/boring/usecase/[Customer])
用例(Use Case)
使用(用例名)表示用例,-
表示角色和用例之间的关联。
![](http://yuml.me/diagram/scruffy/usecase/[Customer]-(Login),[Customer]-(Logout))
- 备注(Notes)
- 如果用例名以note:开头,表明那是一个备注,可以用{bg:颜色名}定义备注的背景色
![](http://yuml.me/diagram/plain/usecase/[Customer]-(Login),
[Customer]-(note:Cust can be registered or not{bg:beige}))
![](http://yuml.me/diagram/plain/usecase/[Customer]-(Login),
[Customer]-(note:Cust can be registered or not{bg:beige}))
![](http://yuml.me/diagram/scruffy/usecase/[Customer]-(Login),
[Customer]-(note:Cust can be registered or not{bg:beige}))
![](http://yuml.me/diagram/scruffy/usecase/[Customer]-(Login),
[Customer]-(note:Cust can be registered or not{bg:beige}))
角色继承(Actor Inheritance)
使用符号^表示角色之间的继承关系
![](http://yuml.me/diagram/scruffy/usecase/[Cms Admin]^[User], [Customer]^[User],[Agent]^[User])
![](http://yuml.me/diagram/scruffy/usecase/[Cms Admin]^[User], [Customer][User],[Agent][User])
扩展和包含(Extends and Includes)
使用>表示用例之间的包含关系,<表示用例之间的扩展
![](http://upload-images.jianshu.io/upload_images/46259-dc05b84aa2bc8bed?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)<(Register),(Login)<(Request Password Reminder),(Register)>(Confirm Registration))
<(Register),(Login)<(Request Password Reminder),(Register)>(Confirm Registration))
完整示例
plain
![](http://yuml.me/diagram/plain/usecase/(note: figure 1.2{bg:beige}), [User]-(Login),[Site Maintainer]-(Add User),(Add User)<(Add Company),[Site Maintainer]-(Upload Docs),(Upload Docs)<(Manage Folders),[User]-(Upload Docs),[User]-(Full Text Search Docs), (Full Text Search Docs)>(Preview Doc),(Full Text Search Docs)>(Download Docs),[User]-(Browse Docs), (Browse Docs)>(Preview Doc),[Site Maintainer]-(Post New Event To The Web Site),[User]-(View Events))
![](http://yuml.me/diagram/plain/usecase/(note: figure 1.2{bg:beige}), [User]-(Login),[Site Maintainer]-(Add User),(Add User)<(Add Company),[Site Maintainer]-(Upload Docs),(Upload Docs)<(Manage Folders),[User]-(Upload Docs),[User]-(Full Text Search Docs), (Full Text Search Docs)>(Preview Doc),(Full Text Search Docs)>(Download Docs),[User]-(Browse Docs), (Browse Docs)>(Preview Doc),[Site Maintainer]-(Post New Event To The Web Site),[User]-(View Events))
scruffy
![](http://yuml.me/diagram/scruffy/usecase/(note: figure 1.2{bg:beige}), [User]-(Login),[Site Maintainer]-(Add User),(Add User)<(Add Company),[Site Maintainer]-(Upload Docs),(Upload Docs)<(Manage Folders),[User]-(Upload Docs),[User]-(Full Text Search Docs), (Full Text Search Docs)>(Preview Doc),(Full Text Search Docs)>(Download Docs),[User]-(Browse Docs), (Browse Docs)>(Preview Doc),[Site Maintainer]-(Post New Event To The Web Site),[User]-(View Events))
boring
![](http://yuml.me/diagram/boring/usecase/(note: figure 1.2{bg:beige}), [User]-(Login),[Site Maintainer]-(Add User),(Add User)<(Add Company),[Site Maintainer]-(Upload Docs),(Upload Docs)<(Manage Folders),[User]-(Upload Docs),[User]-(Full Text Search Docs), (Full Text Search Docs)>(Preview Doc),(Full Text Search Docs)>(Download Docs),[User]-(Browse Docs), (Browse Docs)>(Preview Doc),[Site Maintainer]-(Post New Event To The Web Site),[User]-(View Events))
nofunky
![](http://yuml.me/diagram/nofunky/usecase/(note: figure 1.2{bg:beige}), [User]-(Login),[Site Maintainer]-(Add User),(Add User)<(Add Company),[Site Maintainer]-(Upload Docs),(Upload Docs)<(Manage Folders),[User]-(Upload Docs),[User]-(Full Text Search Docs), (Full Text Search Docs)>(Preview Doc),(Full Text Search Docs)>(Download Docs),[User]-(Browse Docs), (Browse Docs)>(Preview Doc),[Site Maintainer]-(Post New Event To The Web Site),[User]-(View Events))