Timeline for Clean architecture - How do I deal with use case reuse?
Current License: CC BY-SA 4.0
22 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 28, 2022 at 12:43 | comment | added | Konrad | I agree, therefore a use case is not necessarily directly triggered by a user action, it can be an internal task. This is something I wasn't totally sure about (is a use case necessarily only callable by controllers that manage user requests, or can it be something callable by internal parts of the application), but it does make sense to me, thanks! | |
Feb 27, 2022 at 18:47 | comment | added | candied_orange | @konrad A user subscribing to a magazine, getting monthly issues of it, and getting sent a "time to renew" email sounds a lot like a use case to me. | |
Feb 27, 2022 at 14:01 | comment | added | Konrad | Say the use case involves scheduling the sending of an email at a later date. When we do send the email, for instance with a background worker, should we consider "sending the email" as a use case? I'm asking this because the latter "use case" would be "private", e.g. never triggered by the user directly. Is it still considered a use case then? | |
Oct 31, 2020 at 14:23 | comment | added | candied_orange | @Max if logic isn’t shared make your own logic. The use case is what you are supporting. It will both have unique logic and shared logic. | |
Oct 31, 2020 at 14:20 | comment | added | Max |
@candied_orange, I see. But what if no use case contains the shared logic, like in the case of follow/unfollow use cases? Does it make more sense to create a new use case that is only used by other use cases or keep the duplicate code? Maybe the best option is to create an object that contains the shared logic but not call it a use case (e.g., FollowingUpdater )?
|
|
Oct 31, 2020 at 13:59 | comment | added | candied_orange | @Max reusing code can still be a good thing. But the more code is used the more care must be taken when refactoring it. | |
Oct 31, 2020 at 13:52 | comment | added | Max |
Duplication is indeed fine if two use cases have different reasons to change. But what about similar use cases that have pretty much the same reason to change(e.g. FollowUserUseCase and UnfollowUserUseCase )?
|
|
S Jul 19, 2019 at 18:28 | history | suggested | Christopher Broome | CC BY-SA 4.0 |
Changed "then" to "than", added an article to a clause
|
Jul 19, 2019 at 15:47 | review | Suggested edits | |||
S Jul 19, 2019 at 18:28 | |||||
May 2, 2018 at 16:27 | history | edited | candied_orange | CC BY-SA 4.0 |
added 5 characters in body
|
May 2, 2018 at 15:30 | history | edited | candied_orange | CC BY-SA 4.0 |
added 5 characters in body
|
May 2, 2018 at 15:24 | history | edited | candied_orange | CC BY-SA 4.0 |
added 1 character in body
|
May 2, 2018 at 13:44 | history | edited | candied_orange | CC BY-SA 4.0 |
edited body
|
May 2, 2018 at 11:51 | history | edited | candied_orange | CC BY-SA 4.0 |
added 6 characters in body
|
May 2, 2018 at 3:01 | comment | added | Greg Burghardt | To follow Java naming conventions you should capitalize the "l" in "shitlist" i.e. shitList - oh wait!! Why is MY name in there!? | |
May 1, 2018 at 21:16 | history | edited | candied_orange | CC BY-SA 3.0 |
deleted 13 characters in body
|
May 1, 2018 at 21:11 | history | edited | Robert Harvey | CC BY-SA 3.0 |
edited body
|
May 1, 2018 at 21:07 | history | edited | candied_orange | CC BY-SA 3.0 |
added 676 characters in body
|
May 1, 2018 at 21:02 | comment | added | Robert Harvey | Nice code example. ;) | |
May 1, 2018 at 20:43 | history | edited | candied_orange | CC BY-SA 3.0 |
added 92 characters in body
|
May 1, 2018 at 20:29 | history | edited | candied_orange | CC BY-SA 3.0 |
added 223 characters in body
|
May 1, 2018 at 20:20 | history | answered | candied_orange | CC BY-SA 3.0 |