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

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

Open
deniszink opened this issue Feb 5, 2016 · 1 comment
Open

Comments

@deniszink
Copy link

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?

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

No branches or pull requests

3 participants