결제 전환 목표 아키텍처 정의 #5
4 changed files with 71 additions and 0 deletions
3
.forge/SPRING-ARC-SPLIT-1783827796-attempt-5.md
Normal file
3
.forge/SPRING-ARC-SPLIT-1783827796-attempt-5.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# SPRING-ARC-SPLIT-1783827796-attempt-5
|
||||
|
||||
Forge 이슈 작업 브랜치 `forge/SPRING-ARC-SPLIT-1783827796-attempt-5`.
|
||||
20
docs/architecture/adr-payment-boundary.md
Normal file
20
docs/architecture/adr-payment-boundary.md
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# Architectural Decision Record for Payment Boundary
|
||||
|
||||
## Context
|
||||
In order to ensure the integrity and separation of concerns within the payment processing system, we need to define firm boundaries between various components: Controller, Service, Repository, Domain, and Integration. This helps in minimizing unintended dependencies that may arise during development.
|
||||
|
||||
## Decision
|
||||
The payment boundary will be strictly defined such that:
|
||||
- Controllers interact only with Services.
|
||||
- Services interact only with Repositories and Domains (no direct interaction between Services and Controllers).
|
||||
- Repositories handle data access and business logic is encapsulated within Services.
|
||||
- Integration with external systems is managed separately and will not cross into the Service layer.
|
||||
|
||||
## Alternatives
|
||||
1. Allow Services to directly interact with Repositories for data retrieval.
|
||||
**Consequences:** Increases coupling and can lead to issues with data integrity and business logic being bypassed.
|
||||
2. Utilize an Event-Driven Architecture for communications between Services and Integrations.
|
||||
**Consequences:** Increased complexity and potential performance hits.
|
||||
|
||||
## Consequences
|
||||
By setting these boundaries, we are ensuring that changes in one component do not inadvertently affect others, thus maintaining a clean architecture that adheres to SOLID principles. Scalability and maintainability of the system are expected to improve as team members can work more independently without overlapping concerns.
|
||||
9
docs/architecture/package-map.md
Normal file
9
docs/architecture/package-map.md
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
# Package Responsibility and Forbidden Dependencies
|
||||
|
||||
| Package | Responsibility | Forbidden Dependencies |
|
||||
|---------------|-------------------------------------------------------|-------------------------------|
|
||||
| Controller | Handles incoming requests and responses | Service -> Repository |
|
||||
| Service | Contains business logic and service level operations | Repository -> Service |
|
||||
| Repository | Manages data persistence and retrieval | Controller -> Repository |
|
||||
| Domain | Defines domain model and logic | Not applicable |
|
||||
| Integration | Interfaces with external services | Service -> Integration |
|
||||
39
docs/architecture/transaction-sequence.md
Normal file
39
docs/architecture/transaction-sequence.md
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
```mermaid
|
||||
sequenceDiagram
|
||||
participant Controller
|
||||
participant Service
|
||||
participant Repository
|
||||
participant Domain
|
||||
participant Integration
|
||||
|
||||
Controller->>Service: processPayment()
|
||||
Service->>Repository: savePayment()
|
||||
Repository-->>Service: paymentSaved
|
||||
Service-->>Controller: paymentProcessed
|
||||
|
||||
alt External API call
|
||||
Service->>Integration: sendPaymentRequest()
|
||||
Integration-->>Service: paymentResponse
|
||||
end
|
||||
|
||||
opt Within DB transaction
|
||||
Service->>Repository: beginTransaction()
|
||||
Repository-->>Service: transactionStarted
|
||||
Service->>Repository: commitTransaction()
|
||||
end
|
||||
Note over Service: Success (commit)
|
||||
|
||||
opt External Failure
|
||||
Service->>Integration: sendPaymentRequest()
|
||||
Integration-->>Service: paymentFailure
|
||||
Service->>Repository: rollbackTransaction()
|
||||
Repository-->>Service: transactionRolledBack
|
||||
end
|
||||
|
||||
opt DB Failure
|
||||
Service->>Repository: throwException()
|
||||
Repository-->>Service: exceptionOccurred
|
||||
Service->>Repository: rollbackTransaction()
|
||||
Repository-->>Service: transactionRolledBack
|
||||
end
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue