android10 / android10/Android-CleanArchitecture

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

Offen
#106 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
discussion question
Vorherrschende Sprache
Java
Sterne
15.5k
Forks
3.3k
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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?

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.