Best practice to reuse UseCases

Wish you to clarify something, dear fellows.

Imagine that you have two UseCases.

One of them is CreateCustomerHandler, other is SignUpCustomerByGoogleAuthHandler. So, the SignUpCustomerByGoogleAuthHandler has to reuse the CreateCustomerHandler to eventually create a Customer.

Is it legit to inject CreateCustomerHandler to SignUpCustomerByGoogleAuthHandler as a dependency? Are there any pitfalls?

Read that it's not recommended to reuse your UseCases, but what to do in that simple case? Extract the whole CreateCustomerHandler as Application Service and inject it both to the CreateCustomerHandler and SignUpCustomerByGoogleAuthHandler UseCases?

submitted by /u/hapanda
[link] [comments]

from Software Development – methodologies, techniques, and tools. Covering Agile, RUP, Waterfall + more! https://ift.tt/3yzjWz8

Leave a comment

Design a site like this with WordPress.com
Get started
search previous next tag category expand menu location phone mail time cart zoom edit close