https://github.com/nikoo-asadnejad/productservice
This project is a sample implementation of Domain-Driven Design (DDD), Command Query Responsibility Segregation (CQRS), and Clean Architecture using .NET. It demonstrates a modern approach to building scalable and maintainable applications.
https://github.com/nikoo-asadnejad/productservice
cqrs cqrs-architectural-pattern cqrs-pattern csharp ddd ddd-architecture ddd-cqrs ddd-example ddd-patterns ddd-sample domain-driven-design domain-event domain-events dotnet-core event-driven fluent-api fluentvalidation
Last synced: 4 months ago
JSON representation
This project is a sample implementation of Domain-Driven Design (DDD), Command Query Responsibility Segregation (CQRS), and Clean Architecture using .NET. It demonstrates a modern approach to building scalable and maintainable applications.
- Host: GitHub
- URL: https://github.com/nikoo-asadnejad/productservice
- Owner: Nikoo-Asadnejad
- Created: 2023-10-23T17:41:32.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-09-17T19:24:49.000Z (7 months ago)
- Last Synced: 2024-11-08T12:15:35.531Z (6 months ago)
- Topics: cqrs, cqrs-architectural-pattern, cqrs-pattern, csharp, ddd, ddd-architecture, ddd-cqrs, ddd-example, ddd-patterns, ddd-sample, domain-driven-design, domain-event, domain-events, dotnet-core, event-driven, fluent-api, fluentvalidation
- Language: C#
- Homepage:
- Size: 2.8 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ProductService
Welcome to the ProductService repository. This project is a sample implementation of Domain-Driven Design (DDD), Command Query Responsibility Segregation (CQRS), and Clean Architecture using .NET. It demonstrates a modern approach to building scalable and maintainable applications.
## Overview
ProductService is designed to manage product-related operations in an e-commerce system. The project adheres to the following architectural principles:
- Domain-Driven Design (DDD): Organizes code around the business domain, ensuring a clear separation of concerns and encapsulation of business logic.
- CQRS (Command Query Responsibility Segregation): Separates read and write operations to optimize performance and scalability.
- Clean Architecture: Ensures that the application is structured in a way that maintains a separation between core business logic and external concerns.## Key Features
- Fluent Validation: Implemented for validating inputs in a fluent and expressive manner.
Internal Message Queue: Uses .NET channels to handle internal messaging and communication between components.
Domain Event Handlers: Processes domain events to trigger actions or updates based on changes in the domain model.
CQRS with MediatR: Utilizes MediatR for implementing the CQRS pattern, handling commands and queries in a decoupled manner.
Architecture- Domain Layer
Entities: Core business objects representing concepts like Product.
Value Objects: Immutable types representing attributes with business logic.
Aggregates: Consist of entities and value objects to enforce consistency rules.- Application Layer
Commands and Command Handlers: Defines actions and their corresponding handlers for processing write operations.
Queries and Query Handlers: Defines read operations and their handlers for fetching data.- Infrastructure Layer
Repositories: Implement data access logic and repository patterns to interact with data sources.
Message Queue: Implements internal messaging using .NET channels for asynchronous communication.- Presentation Layer
API Controllers: Expose endpoints for interacting with the service, handling HTTP requests and responses.- Validation
Fluent Validation is used to ensure that inputs meet the required specifications before processing.- Internal Messaging
Internal communication between components is handled using .NET channels. This provides a scalable approach to managing asynchronous tasks and events.- Domain Events
Domain events are published and handled to manage changes in the domain model. This allows for decoupled and efficient processing of domain-related actions.