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.
Description
AddOrUpdateAlarmController
should be initialised with theAddOrUpdateAlarmView
. instead, it is initialising with bottomNavigationBarBindings.The main reason behind this is the
InputTimeController
. It has a dependency on both theAddOrUpdateAlarmController
andTimerController
. We are initializing theInputTimeController
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, theInputTimeController
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
andTimerInputTimeController
, each consisting of their independent logic. By refactoring in this way, theAddOrUpdateAlarmController
need not be initialized withbottomNavigationBarBindings
; instead, it can be initialized withAddOrUpdateAlarmView
.I suspect that issues #538, #531 and #546 are related to this.