emerged_entity
FluentResults in the Domain layer
I have already used my custom simpler implementations of this and it worked. So theoretically there is no issue at all since there is no issue at this point. But I just started a new project and I knew about a pretty popular library and wanted to use it since it just seems that it is more preferable to use well-tested library with a lot of functionality rather than recreating the wheel. And since for sure this library is used with Clean Architecture in some production environments, I am curious how people usually do that.
I also found now such thing as raising Domain Events and handing them with MediatR which seems like a potential solution in this case, but I am not sure yet.
14 replies
FluentResults in the Domain layer
As per my understanding, Domain layer has to signal somehow that business rules are not followed and this validation logic should be encapsulated inside this layer. So it is either throwing exceptions or returning Results objects. And I really seem to prefer the second approach in this case and this leads me to a problem with either custom implementation or depdning on the package for consistency throughout the whole solution and avoiding additional complexity.
14 replies