软件设计-Tutroial22
```mermaid classDiagram class BankAccount { - double balance - AccountState state + deposit(double) + withdraw(double) + setBalance(double) + setState(AccountState) } class AccountState { <<interface>> + deposit(double) + withdraw(double) } class NormalState { - BankAccount account + deposit(double) + withdraw(double) } class OverdraftState { - BankAccount account + deposit(double) + withdraw(double) } BankAccount --> AccountState AccountState <|.. NormalState AccountState <|.. OverdraftState ```