android10 / android10/Android-CleanArchitecture

How to make an alarm following the principles of Clean Architecture?

未關閉
#106 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
discussion question
主要語言
Java
星號
15.5k
分支
3.3k
PR 合併指標
30 天內沒有已合併 PR

描述

Hi, I have a question, if I have to implement something like alarm, that will trigger at specific time and run my use case, setting an alarm is business logic of my app, so it should be located in domain(direct me if I wrong) and it's use case should set up my alarm, so it should has the android classes. At this moment I have domain module like android library, and one use case set up an alarm that starts a broadcast, ideally that broadcast should run the same use case (and set up another alarm). I would like to know a valid approach, how to do that.

Logic:

(implemented) 1. User add cycle transaction and add set alarm. AddCycleOperationUseCase --> write to db
(implemented) 2. AddCycleOperationUseCase set the AlarmManager with intent with CycleOperation model
(want) triggering broadcast that ideally has injected AddCycleOperationUseCase and it will do same operation again.

P.S. I saw few examples of CA by Uncle Bob and it seems domain module it's something like a wrapper that encapsulates CRUD, it isn't?

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。