blob: 6e0305dc447eb50eae6ceaa818076e12dc2ff5fd (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
@startuml constraint-enforcement-strategies
!theme plain
title Constraint Enforcement Strategies
state "Operation Request" as Request
state "Immediate Validation" as Immediate
state "Deferred Validation" as Deferred
state "Execute Operation" as Execute
state "Transaction Commit" as Commit
state "Rollback" as Rollback
state "Success" as Success
Request --> Immediate: Strategy 1:\nEager
Request --> Execute: Strategy 2:\nDeferred
Immediate --> Execute: Valid
Immediate --> Rollback: Invalid
Execute --> Deferred: At commit
Deferred --> Commit: Valid
Deferred --> Rollback: Invalid
Commit --> Success
Rollback --> Request: Retry
note right of Immediate
Immediate Checking:
- Validate before execute
- Simple reasoning
- May reject valid intermediate states
- Lower performance
end note
note right of Deferred
Deferred Checking:
- Validate at transaction end
- Allows intermediate invalid states
- Better performance
- Complex error handling
end note
@enduml
|