Umbrella.DDD
8.0.0.3085
dotnet add package Umbrella.DDD --version 8.0.0.3085
NuGet\Install-Package Umbrella.DDD -Version 8.0.0.3085
<PackageReference Include="Umbrella.DDD" Version="8.0.0.3085" />
<PackageVersion Include="Umbrella.DDD" Version="8.0.0.3085" />
<PackageReference Include="Umbrella.DDD" />
paket add Umbrella.DDD --version 8.0.0.3085
#r "nuget: Umbrella.DDD, 8.0.0.3085"
#:package Umbrella.DDD@8.0.0.3085
#addin nuget:?package=Umbrella.DDD&version=8.0.0.3085
#tool nuget:?package=Umbrella.DDD&version=8.0.0.3085
Repository Content
Library to implement a light-weight Framework for Domain Driven Design
To install it, use proper command:
dotnet add package Umbrella.DDD
dotnet add package Umbrella.DDD.GCP
For more details about download, see NuGet Web Site
Configuration
to configure properly the application, it's necessary to add the section to ppSettings.json file as the example below:
{
"UmbrellaMessageBus": {
"PublisherName": "InMemory"
},
}
where we have:
- PublisherName: name of the provider for the publisher component. Valid names: [InMemory,PubSub]
Usage
for the usage of the library, please refer to extension methods.
<b>Standard usage</b>
services.AddInMemoryEventPublisher();
services.AddEventHanders(new MyMessageBusDependencyResolver());
services.AddMessageBus();
Based on the snippet, some important notice:
- AddInMemoryEventPublisher: it should be avoided for PROD environments
- AddEventHanders: it scans the assembly to inject dynamically IMessageHandler and ISaga components
- instruction AddMessageBus should be states after all DI injections
<b>Publishing message on Google Pub Sub</b>
services.AddPubSubEventPublisher("umbrella-proj-id");
services.AddEventHanders(new MyMessageBusDependencyResolver());
services.AddMessageBus();
Using PubSub publisher, you are decoupling the publish action to handler action. the message will be handled asyncronously.
Application Modules
to simplify the aggregation of assemblies into MOdules (or generically speaking Domains), IApplicationModuleProvider is provided. implementig such interface per Domain, you can easily setup your dependencies across domain assemly, infrastructure, ecc. Here you find a simple snippet:
services.AddApplicationModules(new MyApplicationModuleProvider())
How to add an Event Handler
To implement a new event handler, you have to follow the snippet below:
/// <summary>
/// Handlers to manage episode creations
/// </summary>
internal class TestEventHandler : MessageHandler<TestEventOccurred>
{
/// <summary>
/// Default COnstr
/// </summary>
/// <param name="logger"></param>
/// <param name="repo"></param>
public TestEventHandler(ILogger logger) : base(logger)
{
}
/// <summary>
/// handels the msg
/// </summary>
/// <param name="message"></param>
public override void HandleThisMessage(TestEventOccurred message)
{
this._Logger.LogInformation("Handling message {message}", message);
. . . .
this._Logger.LogInformation("Message succesfully handled");
}
}
then register the handler using a custom extension linke the one below:
/// <summary>
/// Adds domains ervices
/// </summary>
/// <param name="services"></param>
public static void AddMyDomainEventHandlers(this IServiceCollection services)
{
services.AddScoped<IMessageHandler TestEventHandler>();
// add here other domain event handlers
// . . .
}
Please notice that you handlers must to be registered aas IMessageHandler.
| 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. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- microsoft.extensions.configuration (>= 8.0.0)
- microsoft.extensions.configuration.Binder (>= 8.0.2)
- Microsoft.Extensions.DependencyInjection (>= 8.0.0)
- Microsoft.Extensions.Logging (>= 8.0.0)
- System.Text.Json (>= 8.0.4)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Umbrella.DDD:
| Package | Downloads |
|---|---|
|
Umbrella.DDD.GCP
Library to implement GCP concrete component defined from Umbrella.DDD library |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 8.0.0.3085 | 291 | 7/11/2024 | |
| 2.0.0.2792 | 445 | 8/2/2023 | |
| 1.3.0.2469 | 769 | 2/11/2023 | |
| 1.2.0.2437 | 618 | 1/26/2023 | |
| 1.1.0.2401 | 638 | 1/14/2023 | |
| 1.1.0.2390 | 746 | 1/14/2023 | |
| 1.0.2.2365 | 764 | 1/5/2023 | |
| 1.0.1.2301 | 766 | 12/29/2022 | |
| 1.0.0.2286 | 820 | 12/24/2022 | |
| 0.9.0.2267 | 1,066 | 12/23/2022 |