ultimate_alarm_clock
ultimate_alarm_clock copied to clipboard
Bug: AddOrUpdateAlarmController initializing ahead of time causing multiple bugs
Description
AddOrUpdateAlarmController
should be initialised with the AddOrUpdateAlarmView
. instead, it is initialising with bottomNavigationBarBindings.
The main reason behind this is the InputTimeController
. It has a dependency on both the AddOrUpdateAlarmController
and TimerController
. We are initializing the InputTimeController
in the timer view. So when the bottom navigation bar is created, these controllers are initialized.
There can be multiple ways to tackle this issue. I would like to suggest that we decompose the InputTimeController
into two classes. Currently, the InputTimeController
violates the Single Responsibility Principle (SRP) because it contains the function/logic of the input time widget for both the alarm view and timer view, which require both controllers to be initialized.
Therefore, I will create two controllers named AlarmInputTimeController
and TimerInputTimeController
, each consisting of their independent logic. By refactoring in this way, the AddOrUpdateAlarmController
need not be initialized with bottomNavigationBarBindings
; instead, it can be initialized with AddOrUpdateAlarmView
.
I suspect that issues #538, #531 and #546 are related to this.