I don't really understand the difference between a Use Case Interactor and a Service in Clean Architecture. Is a domain service just a collection of "Use Case Interactor methods"?
I want to implement the clean architecture in my ASP.net Core Application, but i am not sure if I should implement it in the "Use Case Interactor" way (https://fullstackmark.com/post/18/building-aspnet-core-web-apis-with-clean-architecture), the "Service" way (https://github.com/ardalis/CleanArchitecture) or if I should combine them (if possible at all).
In Clean Architecture "use case" and "interactor" means the same: it is the component which contains business logic. The presenter in this architecture does not contain any business logic.
Uses Cases as the Units of Work In practice, a use case is just a function (a query or a command) that should ideally be pure — deterministic and without side effects. Side effects are supposed to be delegated. A use case is like an algorithm to accomplish a client-driven task. ( Clean Architecture for the rest of us)
Use cases show us the intent of the software. They describe the behavior of a system and its interactions with users. They are likely the first thing to be listed when we think about a new application. Despite the above, it seems to me that the role of the use case is not entirely clear within the Android community.
The domain layer is an optional layer that sits between the UI layer and the data layer. Figure 1. The domain layer's role in app architecture. The domain layer is responsible for encapsulating complex business logic, or simple business logic that is reused by multiple ViewModels.
Strictly speaking, the term "Domain Service" does not exist in Uncle Bob's Clean Architecture but in DDD. In Clean Architecture all business logic goes to Use Case Interactors and Entities. So if you want to strictly follow Uncle Bob's architecture, follow the Use Case Interactors way described in the first article you linked.
For a more detailed discussion on use cases and use case Interactors pls refer to my post: http://www.plainionist.net/Implementing-Clean-Architecture-UseCases/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With