User Tools

Site Tools


go:architecture:clean_arch

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
go:architecture:clean_arch [2026/01/30 01:25] – [Overall Structure (Clean Architecture Only)] phong2018go:architecture:clean_arch [2026/01/30 01:33] (current) – [2. Application Layer — Usecase Orchestration] phong2018
Line 85: Line 85:
 ===== V. Processing Flow (Request → Response) ===== ===== V. Processing Flow (Request → Response) =====
  
-<code> Client (gRPC / HTTP Request) ↓ Interface Layer (Handler) - Receive request - Validate input ↓ Application Layer (Usecase) - Orchestrate business logic ↓ Domain Layer (Repository Interface) - Define contracts ↓ Infrastructure Layer (Implementation) - Access DB / External API ↓ Database / External Service </code> +<code text> 
 +Client (gRPC / HTTP Request) 
 +         
 +Interface Layer (Handler) 
 +  - Receive request 
 +  - Validate input 
 +         
 +Application Layer (Usecase) 
 +  - Orchestrate business logic 
 +         
 +Domain Layer (Repository Interface) 
 +  - Define contracts 
 +         
 +Infrastructure Layer (Implementation) 
 +  - Access DB / External API 
 +         
 +Database / External Service 
 +</code>
 ===== VI. Detailed Layer Examples ===== ===== VI. Detailed Layer Examples =====
  
Line 100: Line 116:
  
 File location: File location:
-<code>+<code text>
 internal/domain/repository/add_point_repository.go internal/domain/repository/add_point_repository.go
-</code> 
  
 <code go> type AddPointRepository interface { FetchProcessingOrders( ctx context.Context, limit, offset int, ) ([]ProcessingOrder, error) <code go> type AddPointRepository interface { FetchProcessingOrders( ctx context.Context, limit, offset int, ) ([]ProcessingOrder, error)
Line 131: Line 146:
 <code> <code>
 internal/application/usecase/point_add_usecase.go internal/application/usecase/point_add_usecase.go
 +
 </code> </code>
  
-<code go> type PointAddUsecase struct { repo domain.AddPointRepository }+<code go> 
 +type PointAddUsecase struct { repo domain.AddPointRepository }
  
 func (u *PointAddUsecase) Execute(ctx context.Context) error { func (u *PointAddUsecase) Execute(ctx context.Context) error {
go/architecture/clean_arch.1769736358.txt.gz · Last modified: by phong2018