Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Cases #21

Closed
RikDriever opened this issue Jul 18, 2018 · 3 comments
Closed

Use Cases #21

RikDriever opened this issue Jul 18, 2018 · 3 comments

Comments

@RikDriever
Copy link

I'm reviewing multiple Clean Architecture solutions and virtually all have a setup with Use Cases in the form of Interactors with a Request and a Response message.
I don't see any of that in this solution; why is that?

@ardalis
Copy link
Owner

ardalis commented Jul 19, 2018

Can you link to one so I can see an example of what you mean? This one is meant to be a solution starter kit, so it's light on features such that when you start from it, you don't have to rip a whole lot out.

@RikDriever
Copy link
Author

Sure, for example this article https://medium.com/@stephanhoekstra/clean-architecture-in-net-8eed6c224c50 with this solution structure https://github.com/stephanhoekstra/clean-architecture

This series of blogposts is also worth looking into: https://plainionist.github.io/Implementing-Clean-Architecture-UseCases/
The image below comes from this series and is particularly interesting for this topic.
user interactor flow

I understand this is a starter solution, but it just seemed odd to me that others see the use cases as an integral part of the architecture and you might not? The phrase "use case" is not mentioned once in your e-book either.

@ardalis
Copy link
Owner

ardalis commented Jul 19, 2018

It's true, 'use case' isn't really a term I use in this context. In my experience a use case is similar to a user story, and is captured as documentation of requirements, not part of the software domain itself. From the diagram you've provided, it seems like a use case maps to an application service. In fact, if one uses MediatR or something similar to minimize the size of one's controllers, you'll end up creating message types that could easily map to the Use Case Input Port (Request) and Use Case Output Port (Response). With the Use Case Interactor as simply the Handler in that case.

I'll check out the Medium article you linked to and respond later perhaps once I've had a chance to read it. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants