Thursday, September 26, 2024

What to put in clean architecture layers and get a ready-made template?

 




Clean architecture follows a set of design principles (mostly SOLID) and divides the solution into different layers (mostly 4). Mostly we divide our solution into 4 layers - Domain - Application - Infrastructure - Presentation We should put the following in each layer : 1) Domain - Events - Entities - Exceptions - Repository Interfaces 2) Application - Services - Behaviours - Validators - Queries/Commands 3) Infrastructure (if the persistence layer doesn't exist) - Email - Storage - Database - Background Jobs - Repository Implementations 4) Persistence - Database - Repository Implementations Exclude these two from the infrastructure if the persistence layer exists 5) Presentation - Controller - Middlewares - View or Request Models

No comments:

Post a Comment