Skip to content

3.用例图

简单用法

可使用usecase或者()来表示用例

(哈哈)
(哈哈)
plantuml
(第一个用例)
(第二个用例) as (UC2)
usecase (Last\nusecase) as UC3
(第一个用例)
(第二个用例) as (UC2)
usecase (Last\nusecase) as UC3
plantuml
:User: --> (Use the application)

"Main Admin" as Admin  
Admin ---> (Admin the application)
:User: --> (Use the application)

"Main Admin" as Admin  
Admin ---> (Admin the application)

使用package将内容包起来,使用left to right direction可指定方向。

plantuml
@startuml
left to right direction
actor "Food Critic" as fc
package Restaurant {
  usecase "Eat Food" as UC1
  usecase "Pay for Food" as UC2
  usecase "Drink" as UC3
}
fc --> UC1
fc --> UC2
fc --> UC3
@enduml
@startuml
left to right direction
actor "Food Critic" as fc
package Restaurant {
  usecase "Eat Food" as UC1
  usecase "Pay for Food" as UC2
  usecase "Drink" as UC3
}
fc --> UC1
fc --> UC2
fc --> UC3
@enduml