1、plantuml

2、Mermaid

Mermaid
classDiagram
direction LR
class Customer {
-String name
-String customerId
+placeOrder(products) Order
+getOrderHistory() List~Order~
}
class Order {
-String orderId
-Date orderDate
-OrderStatus status
+calculateTotal() double
+addProduct(product, quantity)
}
class Product {
-String productId
-String name
-double price
+updatePrice(newPrice)
+getStock() int
}
class Address {
-String street
-String city
-String zipCode
+getFullAddress() String
}
Customer "1" --> "*" Order : 拥有
Order "*" --> "*" Product : 包含
Customer "1" --> "1..*" Address : 使用
Order ..> Address : 发往
note for Customer "顾客可以有一个或多个地址,\n用于收货和开票。"