classDiagram
class User {
-int id
-string name
+login()
+logout()
}
class Order {
-int orderId
-float amount
+pay()
}
User "1" --> "0..*" Order : 创建
class Payment {
<<interface>>
+process()
}
Order ..|> Payment : 实现
erDiagram
STUDENT ||--o{ ENROLLMENT : has
COURSE ||--o{ ENROLLMENT : includes
STUDENT {
int studentId PK
string name
string major
}
COURSE {
int courseId PK
string title
int credits
}
ENROLLMENT {
int studentId FK
int courseId FK
date enrollDate
string grade
}