Core abstractions and building blocks for Forma pattern-based architecture in .NET.
$ dotnet add package Forma.CoreForma is a lightweight and modular .NET library that provides abstractions and infrastructure for implementing common behavioral design patterns such as Mediator, Decorator, Pipeline, and more.
Build composable, decoupled, and maintainable application flows using clean architectural principles.
IMediator, IRequestHandler, IPipelineBehavior, IDecorator, etc.)Available on NuGet.org:
# Core components
dotnet add package Forma.Core
dotnet add package Forma.Mediator
dotnet add package Forma.Decorator
# Additional components
dotnet add package Forma.Chains
dotnet add package Forma.PubSub.InMemory
| Method | Categories | Mean | Error | StdDev | Median | Rank |
|---|---|---|---|---|---|---|
| Forma_RequestWithResponse | RequestWithResponse | 334.8 ns | 6.23 ns | 10.92 ns | 332.0 ns | 1 |
| MediatR_RequestWithResponse | RequestWithResponse | 492.4 ns | 9.54 ns | 10.98 ns | 491.9 ns | 2 |
| Forma_SendAsync_object | SendAsObject | 335.7 ns | 6.46 ns | 8.63 ns | 335.2 ns | 1 |
| MediatR_Send_object | SendAsObject | 452.4 ns | 9.31 ns | 26.25 ns | 441.3 ns | 2 |
| Forma_SimpleRequest | SimpleRequest | 283.0 ns | 5.50 ns | 5.40 ns | 282.7 ns | 1 |
| MediatR_SimpleRequest | SimpleRequest | 412.1 ns | 7.47 ns | 10.71 ns | 408.1 ns | 2 |
# Build the project
dotnet build
# Run tests
dotnet test
# Run benchmarks
dotnet run -c Release --project src/Forma.Benchmarks/Forma.Benchmarks.csproj
Forma uses a hybrid approach for releasing its NuGet packages:
Forma.Core, Forma.Mediator, Forma.Decorator): Released together with the same versionForma.Chains, Forma.PubSub.InMemory): Released independentlyFor more information on the release process, see the Release Guide.
Contributions are welcome! If you'd like to contribute to Forma:
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)Before contributing, please review the development documentation in the docs/ folder.