银行系统的用例图 类图
时间: 2024-03-17 12:37:15 浏览: 107
以下是银行系统的用例图和类图的介绍:
用例图(Use Case Diagram)是一种用于描述系统功能的图形化工具,它展示了系统的各个角色(Actor)和系统的各个用例(Use Case)之间的关系。用例图可以帮助我们理解系统的功能需求和用户与系统的交互。
类图(Class Diagram)是一种用于描述系统中的类、类之间的关系以及类的属性和方法的图形化工具。类图可以帮助我们理解系统的结构和设计,包括系统中的各个类及其之间的关系。
以下是银行系统的用例图和类图的示例:
用例图示例:
```plantuml
@startuml
left to right direction
actor Customer
actor BankEmployee
actor ATM
rectangle BankSystem {
Customer --> (Login)
Customer --> (Withdraw)
Customer --> (Deposit)
Customer --> (Transfer)
Customer --> (CheckBalance)
BankEmployee --> (CreateAccount)
BankEmployee --> (CloseAccount)
ATM --> (Withdraw)
ATM --> (Deposit)
ATM --> (CheckBalance)
}
@enduml
```
类图示例:
```plantuml
@startuml
class BankSystem {
+login(username: String, password: String): boolean
+withdraw(accountNumber: String, amount: double): boolean
+deposit(accountNumber: String, amount: double): boolean
+transfer(fromAccountNumber: String, toAccountNumber: String, amount: double): boolean
+checkBalance(accountNumber: String): double
}
class Customer {
-name: String
-address: String
-phoneNumber: String
+login(username: String, password: String): boolean
+withdraw(accountNumber: String, amount: double): boolean
+deposit(accountNumber: String, amount: double): boolean
+transfer(fromAccountNumber: String, toAccountNumber: String, amount: double): boolean
+checkBalance(accountNumber: String): double
}
class BankEmployee {
-name: String
-employeeId: String
+createAccount(customer: Customer): boolean
+closeAccount(accountNumber: String): boolean
}
class ATM {
-location: String
+withdraw(accountNumber: String, amount: double): boolean
+deposit(accountNumber: String, amount: double): boolean
+checkBalance(accountNumber: String): double
}
BankSystem "1" *-- "1..*" Customer
BankSystem "1" *-- "1..*" BankEmployee
BankSystem "1" *-- "1..*" ATM
@enduml
```
相关推荐
![application/msword](https://img-home.csdnimg.cn/images/20210720083327.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)