OpenDDD.NET
3.0.0-alpha.3
dotnet add package OpenDDD.NET --version 3.0.0-alpha.3
NuGet\Install-Package OpenDDD.NET -Version 3.0.0-alpha.3
<PackageReference Include="OpenDDD.NET" Version="3.0.0-alpha.3" />
paket add OpenDDD.NET --version 3.0.0-alpha.3
#r "nuget: OpenDDD.NET, 3.0.0-alpha.3"
// Install OpenDDD.NET as a Cake Addin #addin nuget:?package=OpenDDD.NET&version=3.0.0-alpha.3&prerelease // Install OpenDDD.NET as a Cake Tool #tool nuget:?package=OpenDDD.NET&version=3.0.0-alpha.3&prerelease
OpenDDD.NET
OpenDDD.NET is an open-source framework for domain-driven design (DDD) development using C# and .NET. It provides a set of powerful tools and abstractions to help developers build scalable, maintainable, and testable applications following the principles of DDD.
Note: OpenDDD.NET is currently in an alpha state as part of new major version 3. Use with caution in production environments.
Key Features
- Aggregates: Define domain aggregates with clear boundaries and encapsulate domain logic within them.
- Entities and Value Objects: Create entities and value objects to represent domain concepts and ensure strong type safety.
- Repositories: Abstract away data access and enable persistence of domain objects.
- Domain Events: Facilitate communication between domain objects while maintaining loose coupling.
- Integration Events: Enable communication between bounded contexts in distributed systems.
- Event Listeners: Manage event listeners to handle domain and integration events for scalable, event-driven architectures.
- Domain Services: Encapsulate domain-specific operations that do not naturally belong to an entity or value object.
- Application Services: Use Action classes to coordinate the execution of domain logic in response to commands.
- Infrastructure Services: Provide implementations for technical concerns such as logging, email, or external integrations.
- Transactional Outbox: Ensure event consistency by persisting and publishing events as part of database transactions.
We're adhering to the key principles and building blocks of Domain-Driven Design.
<img src="https://github.com/runemalm/OpenDDD.NET/blob/master/ddd-graph.png" width="636" alt="DDD Concepts Graph" />
Supported Versions
- .NET 8
Example Usage
To get started with OpenDDD.NET, follow these simple steps:
Install the NuGet package: Use the NuGet package manager or the .NET CLI to add the OpenDDD.NET package to your project.
dotnet add package OpenDDD.NET --prerelease
Create a new project: Create a new project in your editor or IDE of choice or use the command below.
dotnet new webapi -n Bookstore
Set up OpenDDD.NET: Register OpenDDD services and middleware in your
Program.cs
file.using OpenDDD.Main.Extensions; var builder = WebApplication.CreateBuilder(args); // Add OpenDDD services builder.Services.AddOpenDDD<BookstoreDbContext>(builder.Configuration, options => { options.UseEfCore() .UseSQLite("DataSource=Main/EfCore/Bookstore.db;Cache=Shared") .UseInMemoryMessaging() .SetEventListenerGroup("Default") .SetEventTopicTemplates( "Bookstore.Domain.{EventName}", "Bookstore.Interchange.{EventName}" ) .EnableAutoRegistration(); }); var app = builder.Build(); // Use OpenDDD Middleware app.UseOpenDDD(); app.Run();
Start building your application: Utilize the power of OpenDDD.NET to build scalable and maintainable applications.
For detailed guides and examples, refer to the documentation.
Documentation
The official OpenDDD.NET documentation provides getting-started guide, examples, and configuration references to help you get started and make the most of the framework.
📖 Read the Docs
Visit the documentation: OpenDDD.NET Documentation
🛠 Topics Covered
- Getting Started: Installation, setup, and basic usage
- Domain Modeling: Aggregates, entities, and value objects
- Repositories & Persistence: Using EF Core and selecting database provider
- Event-Driven Architecture: Domain events, integration events, and event listeners
- Infrastructure & Services: Auto-registration, messaging providers, and more
⭐ Stay Updated
If you find OpenDDD.NET useful, consider starring the repository and following the project on GitHub to stay updated with the latest developments.
Sample Project
The Bookstore
sample project demonstrates how to use OpenDDD.NET in a real-world scenario, including domain modeling, repositories, actions, and framework configuration.
Explore the project in the repository: Bookstore Sample Project.
Release History
3.0.0-alpha.3 (2025-01-30)
- Domain Events: Added support for domain events to enable communication between domain objects while maintaining encapsulation.
- Integration Events: Added support for integration events to facilitate communication between bounded contexts.
- Event Listeners: Added support for event listeners to handle domain and integration events with actions.
- Transactional Outbox: Added reliable event publishing by storing events in an outbox before processing and publishing to the message bus, ensuring consistency with database transactions.
- Messaging Providers: Added pluggable support for messaging backends, including in-memory and Azure Service Bus.
- Infrastructure Services: Added
IInfrastructureService
interface for managing infrastructure services, with automatic registration. - Repository Refactoring: Refactored repository pattern by introducing
EfCoreRepository<TAggregate, TId>
as the default for the EfCore persistence provider, improving consistency and customization. - Configuration Refactoring: Restructured OpenDDD.NET configuration system into hierarchical options classes, improving clarity and maintainability.
For a complete list of releases and their changelogs, please visit the Releases page.
Contributing
We welcome contributions from the community. To contribute to OpenDDD.NET, please follow these steps:
- Fork the repository on GitHub.
- Clone your forked repository to your local machine.
- Create a new branch from the
master
branch for your changes. - Make your modifications and ensure they adhere to our coding conventions.
- Write appropriate tests for your changes, ensuring they pass.
- Commit your changes with a descriptive and meaningful commit message.
- Push your branch to your forked repository on GitHub.
- Open a pull request (PR) against the
develop
branch of the main repository.
Please make sure to review our Contributing Guidelines before submitting a pull request.
License
OpenDDD.NET is licensed under the GPLv3 License. Feel free to use it in your own projects.
Acknowledgements
OpenDDD.NET is inspired by the principles and ideas of Domain-Driven Design (DDD) and the fantastic work done by the DDD community. We would like to thank all the contributors and supporters who have helped make this project possible.
Get in Touch
If you have any questions, suggestions, or feedback, please don't hesitate to reach out to us.
Let's build better software together with OpenDDD.NET!
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
-
net8.0
- Azure.Messaging.ServiceBus (>= 7.18.3)
- Microsoft.AspNetCore.Hosting (>= 2.3.0)
- Microsoft.AspNetCore.Http.Abstractions (>= 2.3.0)
- Microsoft.EntityFrameworkCore (>= 9.0.1)
- Microsoft.EntityFrameworkCore.InMemory (>= 9.0.1)
- Microsoft.EntityFrameworkCore.Sqlite (>= 9.0.1)
- Microsoft.EntityFrameworkCore.SqlServer (>= 9.0.1)
- Microsoft.Extensions.Configuration.Binder (>= 9.0.1)
- Microsoft.Extensions.Hosting (>= 9.0.1)
- Microsoft.NET.Test.Sdk (>= 17.12.0)
- Newtonsoft.Json (>= 13.0.3)
- Npgsql.EntityFrameworkCore.PostgreSQL (>= 9.0.1)
- xunit (>= 2.9.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
3.0.0-alpha.3 | 32 | 1/30/2025 |
3.0.0-alpha.2 | 36 | 1/21/2025 |
3.0.0-alpha.1 | 33 | 1/19/2025 |
2.0.0-alpha.3 | 102 | 10/3/2023 |
2.0.0-alpha.2 | 91 | 10/3/2023 |
2.0.0-alpha.1 | 87 | 10/1/2023 |
1.0.0-alpha.17 | 98 | 6/27/2023 |
1.0.0-alpha.16 | 99 | 5/7/2023 |
1.0.0-alpha.15 | 107 | 5/1/2023 |
1.0.0-alpha.14 | 99 | 4/30/2023 |
1.0.0-alpha.13 | 100 | 4/28/2023 |
1.0.0-alpha.12 | 105 | 4/28/2023 |