類別圖:資料庫連線(單例模式)

Example: 資料庫連線


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
@startuml Example-DB-Connection-Singleton-Pattern

class Program
{
+ getDBConnection()
}

class DBConnection
{
- instance

- __construct()
- __clone()
- __wakeup()
+ getInstance()
}

Program -> DBConnection


@enduml

ʕ •ᴥ•ʔ:若不熟悉 UML 類別圖,可參考UML類別圖說明

Share