Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sang-hyeon/Plastic
This project provides encapsulation of things like Domain, Application Rules, Business Rules or Business Logic in Application.
https://github.com/sang-hyeon/Plastic
application application-rules business-logic business-rules clean-architecture command-pattern cqrs csharp-sourcegenerator ddd domain-driven-design domain-service ebi-architecture usecase
Last synced: 10 days ago
JSON representation
This project provides encapsulation of things like Domain, Application Rules, Business Rules or Business Logic in Application.
- Host: GitHub
- URL: https://github.com/sang-hyeon/Plastic
- Owner: sang-hyeon
- License: mit
- Created: 2021-07-25T05:14:51.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-11-21T07:21:28.000Z (12 months ago)
- Last Synced: 2024-05-06T10:35:07.363Z (6 months ago)
- Topics: application, application-rules, business-logic, business-rules, clean-architecture, command-pattern, cqrs, csharp-sourcegenerator, ddd, domain-driven-design, domain-service, ebi-architecture, usecase
- Language: C#
- Homepage:
- Size: 543 KB
- Stars: 56
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
- awesome-csharp - Plastic - Plastic provides encapsulation of things like Domain, Application Rules, Business Rules or Business Logic in Application. For this, Command pattern is used. (Application Frameworks)
- RSCG_Examples - Plastic - hyeon/Plastic (Do not want to test 114 ( old ISourceGenerator ) / 1. [ThisAssembly](https://ignatandrei.github.io/RSCG_Examples/v2/docs/ThisAssembly) , in the [EnhancementProject](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#enhancementproject) category)
- csharp-source-generators - Plastic - ![stars](https://img.shields.io/github/stars/sang-hyeon/Plastic?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/sang-hyeon/Plastic?style=flat-square&cacheSeconds=86400) This project provides encapsulation of things like Domain, Application Rules, Business Rules or Business Logic in Application. (Source Generators / Patterns)
- awsome-dotnet - Plastic - Plastic provides encapsulation of things like Domain, Application Rules, Business Rules or Business Logic in Application. For this, Command pattern is used. (Application Frameworks)
- awesome-dotnet - Plastic - Plastic provides encapsulation of things like Domain, Application Rules, Business Rules or Business Logic in Application. For this, Command pattern is used. (Application Frameworks)
README
[![Build Source Code](https://github.com/sang-hyeon/PlasticCommand/actions/workflows/continous-integration.yaml/badge.svg)](https://github.com/sang-hyeon/PlasticCommand/actions/workflows/continous-integration.yaml)
[![Nuget](https://img.shields.io/nuget/v/PlasticCommand)](https://www.nuget.org/packages/PlasticCommand/)
# Abstract
This project provides encapsulation of things like Domain, Application Rules, Business Rules or Business Logic in Application. For this, Command pattern is used.All applications such as Web, CLI, GUI application can use this project.
This can be part of the Usecase Layer, Domain Service Layer or CQRS.The source generator introduced in .Net 5 is used to implement this Idea. If metaprogramming such as Source generator is properly used, it's possible to provide flexible source code that has not been provided by traditional programming.
Generated source code has the same effect as the source code you wrote yourself because it will be injected at compile time.The name of this project is Plastic Command.
[Blog post](https://medium.com/@Thwj/heres-a-new-proposal-to-encapsulate-domain-layer-5940dc6c738)
[Blog post(한국어)](https://medium.com/@Thwj/%EC%83%88%EB%A1%9C%EC%9A%B4-domain-layer%EC%9D%98-%EC%BA%A1%EC%8A%90%ED%99%94-5661a3240184)
# Flow of the plastic command
![Platstic의 명령 흐름](docs/resources/flow.jpg)
# Plastic Command
## Quick Start
Step 1. Specify The Command
```cs
// [CommandName("AddCommand")]
class AddCommandSpec : ICommandSpecification
{
public AddCommandSpec(IMyCalculator calculator)
{
...
}public Task ExecuteAsync(int param, CancellationToken token = default)
{
...
}
}
```Step 2. Add Plastic to IServiceCollection
```cs
void Configure(IServiceCollection services)
{
var pipelineBuilder = new BuildPipeline(...);services.UsePlastic(pipelineBuilder);
}
```Step 3. Use a Generated Command
```cs
class AddController : ControllerBase
{
public AddController(AddCommand addCommand)
{
...
...
int result = addCommand.ExecuteAsync( 1 );
}
}
```